The Lead Game

My code is failing for a condition, they have said there wont be a condition of equal points in The Lead game problem

#include
using namespace std;

int main() {
int t,a,b,max;
cin>>t;
max = 1;
while(t–)
{
cin>>a;
cin>>b;

    if(abs(a-b)>abs(max))
    {  
   max =a-b;
       
    }
}
if(max>0)
    cout<<"1"<<" "<<abs(max);
else
     cout<<"2"<<" "<<abs(max);
return 0;

}

someone pls tell me wt the pblm is .

You seem to have multiple test cases from reading your code but you aren’t printing a new line. Also, it seems like you should be initialising “max” inside your while loop.