Could you please tell what is wrong with my solution. #include
using namespace std;
int main()
{
int test;
cin>>test;
int a,b,w1=0,w2=0;
for(int i=0;i<test;i++)
{
cin>>a>>b;
if(a>b)
if(a-b>w1)
w1=a-b;
if(b>a)
if(b-a>w2)
w2=b-a;
}
if(w1>w2)
{
cout<<"1 "<<w1;
}
else
cout<<"2 "<<w2;
}