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