#include
#include
using namespace std;
int main(){
int a,x,y,s,r,k,f;
cin>>a;
while(a–){
cin>>x>>y;
if(x>y){
s=x-y;
}else{
r=y-x;
}
if(s>r && x>y){
f=s;
k=1;
}
else if(r>s && y>x){
f=r;
k=2;
}
}
cout<<k<<" "<<f<<endl;
}
#include
#include
using namespace std;
int main(){
int a,x,y,s,r,k,f;
cin>>a;
while(a–){
cin>>x>>y;
if(x>y){
s=x-y;
}else{
r=y-x;
}
if(s>r && x>y){
f=s;
k=1;
}
else if(r>s && y>x){
f=r;
k=2;
}
}
cout<<k<<" "<<f<<endl;
}
Please either format your code or (better!) link to your submission - the forum software has mangled it and it won’t compile!
Also - what Problem are you trying to solve?