Please help me in the correcting the error n this code, problem code: TLG

#include<stdio.h>
#include<math.h>

int main()
{
int i,n,pl1[10000],pl2[10000],win,temp,dif=0;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d %d",&pl1[i],&pl2[i]);
temp=pl1[i]-pl2[i];
if(abs(temp)>dif)
{
dif=abs(temp);
if(temp>0)
win=1;
else
win=2;
}

}
printf("%d %d",win,dif);
return 0;

}

#include<stdio.h>
#include<math.h>
int main()
{ int i,n,pl1[10000],pl2[10000],win,temp,dif=0;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d%d",&pl1[i],&pl2[i]);
temp=pl1[i]-pl2[i];
if(abs(temp)>dif)
{ dif=abs(temp);
if(temp>0) win=1;
}
else win=2;

}
printf("%d %d",win,dif);
return 0;
}

Terima kasih dan salam kenal.
codechef Link

code Link