Sohila_Elshiref

two intervals

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