Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- main()
- {
- int l1, r1, l2, r2;
- cin>>l1>>r1>>l2>>r2;
- if(l2 > r1)
- {
- cout<<"-1";
- }
- else if(l2 <= r1 && r2 <= r1)
- {
- cout<<l2<<" "<<r2;
- }
- else if(l2 == r1)
- {
- cout<<r1<<" "<<l2;
- }
- else if(l2 < r1 && r1 < r2)
- {
- cout<<l2<<" "<<r1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement