Advertisement
Zeinab_Hamdy

Untitled

Nov 29th, 2022
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <iomanip>
  4.  
  5. using namespace std;
  6.  
  7.  
  8. int main()
  9. {
  10. long long x1,r1,x2,r2;
  11.  
  12. cin>>x1>>r1>>x2>>r2;
  13. if(x2>=x1 && r1<=r2 && r1>=x2 ){
  14.     cout<<x2<<" "<<r1<<"\n";
  15. }
  16.  
  17.  
  18. else if(x2>=x1 && r2<=r1 ){
  19.     cout<<x2<<" "<<r2<<"\n";
  20. }
  21.  
  22. else if(x1>=x2 && r2<=r1 && x1<=r2 ){
  23.     cout<<x1<<" "<<r2<<"\n";
  24. }
  25.  
  26.  
  27. else if(x1>=x2 && r1<=r2 ){
  28.     cout<<x1<<" "<<r1<<"\n";
  29. }
  30.  
  31.  
  32. else{
  33.     cout<<"-1"<<"\n";
  34. }
  35.     return 0;
  36. }
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement