4 solutions

  • 1
    @ 2025-8-13 15:15:59
    #include <bits/stdc++.h>
    using namespace std;
    int x,y,x2,y2;
    int main()
    {
    	cin>>x>>y>>x2>>y2;
    	if(abs(x)+abs(y)>=abs(x2)+abs(y2))
    	{
    		cout<<"("<<x<<","<<y<<")\n"<<abs(x)+abs(y);
    	}
    	else
    	{
    		cout<<"("<<x2<<","<<y2<<")\n"<<abs(x2)+abs(y2);
    	}
    	return 0;
    }
    
    
    
    
    • 0
      @ 2025-5-18 12:10:15
      #include <bits/stdc++.h>
      using namespace std;
      int x,y,x2,y2;
      int main()
      {
      	cin>>x>>y>>x2>>y2;
      	if(abs(x)+abs(y)>=abs(x2)+abs(y2))
      	{
      		cout<<"("<<x<<","<<y<<")\n"<<abs(x)+abs(y);
      	}
      	else
      	{
      		cout<<"("<<x2<<","<<y2<<")\n"<<abs(x2)+abs(y2);
      	}
      	return 0;
      }
      
      
      
      • 0
        @ 2025-4-2 19:07:59
        #include <bits/stdc++.h>
        using namespace std;
        int main()
        {
        	int x1,y1,x2,y2;
        	cin>>x1>>y1>>x2>>y2;
        	int d1 = abs(x1) + abs(y1);
        	int d2 = abs(x2) + abs(y2);
        	if(d1 >= d2)
        	{
        	    cout<<"("<<x1<<","<<y1<<")"<<endl;
        	    cout<<d1<<endl;
        	} 
        	else 
        	{
        	    cout<<"("<<x2<<","<<y2<<")"<<endl;
        	    cout<<d2<<endl; 
        	}
        	return 0; 
        }
        
        • -3
          @ 2024-8-23 11:06:16

          #include<bits/stdc++.h> using namespace std; int main() { int x1,y1,x2,y2; cin>>x1>>y1>>x2>>y2; int d1 = abs(x1) + abs(y1); int d2 = abs(x2) + abs(y2); if(d1 >= d2) { cout<<"("<<x1<<","<<y1<<")"<<endl; } else { cout<<"("<<x2<<","<<y2<<")"<<endl; cout<<d2<<endl; } return 0; }

          • 1

          Information

          ID
          39
          Time
          1000ms
          Memory
          256MiB
          Difficulty
          3
          Tags
          (None)
          # Submissions
          293
          Accepted
          81
          Uploaded By