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