Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std ;
- int main() {
- long long l1 , r1 , l2 , r2 ;
- cin >> l1 >> r1 >> l2 >> r2 ;
- if (r1 >= l2 && r2 >= l1) {
- cout << max(l1,l2) << " " << min(r1,r2) ;
- } else {
- cout << "-1" ;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment