the lead game: why is this answer wrong?

question:TLG Problem - CodeChef

#include

using namespace std;

int main()

{int t,a,b,m=0,n=0;

cin>>t;

for(int i=0;i<t;++i)

{cin>>a>>b;

if(a>b&&a-b>m)

m=a-b;

else if(b-a>n)

n=b-a;}

if(m>n)

cout<<"1 "<<m;

else

cout<<"2 "<<n;

return 0;
}