i am getting wrong answer for the lead game question hereso please help me!!

#include<stdio.h>

int main()

{

int n,s[10000],t[10000],i,r,l[10000],w[10000],max,win;

```
scanf("%d",&n);
if(n>0&&n<=10000)
{
for(i=0;i<n;i++)
{
scanf("%d %d",&s[i],&t[i]);
r=s[i]-t[i];
if(r>0)
{
l[i]=r;
w[i]=1;
}
else
{
l[i]=-r;
w[i]=2;
}
}
}
max=l[0];win=w[0];
for(i=1;i<n;i++)
{
if(l[i]>max)
{
max=l[i];
win=w[i];
}
}
printf("%d %d",win,max);
return 0;
```

}