MohamedAbdel3al

Untitled

Jul 13th, 2021
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std ;
  4.  
  5. int main() {
  6.  
  7. long long l1 , r1 , l2 , r2 ;
  8. cin >> l1 >> r1 >> l2 >> r2 ;
  9. if (r1 >= l2 && r2 >= l1) {
  10. cout << max(l1,l2) << " " << min(r1,r2) ;
  11. } else {
  12. cout << "-1" ;
  13. }
  14.  
  15.  
  16.  
  17.  
  18. return 0;
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment