Here’s my C code for the problem, the lead game, though the prob looked highly simple, my code is always rejected with Wrong Solution, I’m quite sure that my code would probably not be able to function in some corner case, thats why this is happening, but could anyone help me with the corner case, ive tried quite a few myself, but that’s no use, its correct everytime, so please help(but please dont tell me the exact error in my code, only the corner case in which it fails, I want to work on it myself)
#include <stdio.h>
int main(void)
{
int t, i;
scanf ("%d\n", &t);
int A, B, lead = 0, win = 0;
for (i = 0;i < t;i++)
{
scanf("%d %d\n", &A, &B);
if (A > B && (A - B) > lead)
{
lead = (A - B);
win = 1;
}
else if (B > A && (B - A) > lead)
{
lead = (B - A);
win = 2;
}
}
printf ("%d %d\n", win, lead);
return 0;
}