my code is passing all the test cases and is running without any error. whats wrong in this , why its not accepting the solution pls help.
#include
using namespace std;
int main() {
int t,m=0,w;
cin>>t;
while(t>0){
int a,b;
cin>> a >> b;
if(a>b&&m<(a-b))
{
m=a-b;
w=1;
}
else
{
if(b>a&&m<(b-a))
{
m=b-a;
w=2;
}
else
break;
}
t–;
}
cout<<w<<" "<<m;
return 0;
}