The question really has unclear explanation about what it means to say. Lets explain this question clearly to you with ans too…
Taking the example given the question :
the input given is:
5
140 82
89 134
90 110
112 106
88 90

In the round 1, the player 1 scores 140 points and player 2 scores 82 so the cumulative score of player 1 becomes 140 (as 0 + 140 = 140 ) and the cumulative score of player 2 becomes 82 (0+82).
now as cumulative score of player 1 is greater then player 2 then we will store the lead score of player 1 ( which is 58 as 14082 = 58) and 58>0(see note). so the lead score of player 1 is now 58.
Note : Here the default lead scores of player 1 and 2 were 0.

now in round 2, player 1 score is 89 and player 2 score is 134. so the cumulative score of player 1 becomes 229 ( 140 + 89) and the cumulative score of player 2 becomes 216 (82+134). Now as cumulative score of player 1 is greater then the cumulative score of player2 so, first we will calculate the difference of cumulative scores of player 1 and player 2 and check whether the difference is greater than lead score of player 1 (as cumulative score of player 1 was greater then the cumulative score of player 2 in the second round ). as 13 (229216) is less than 58, so the lead score of player 1 remains 58.

In the third round, the cumulative score of player 1 becomes 319 (229+90) and cumulative score of player 2 becomes 326 (216+110). now as cumulative score of player 2 is greater then player 1 so now we compare the lead score of player 2 with the difference of cumulative score of player 2 and player 1 (which is 326319 =7 ). now as lead score of player 2 ( which is 0 ) is less than 7 so the lead score of player 2 is updated to 7.

now in the forth round, the cumulative score of player 1 becomes 431(319+112) and cumulative score of player 2 becomes 432 (326+106). now as cumulative score of player 2 is greater then player 1 so now we compare the lead score of player 2 with the difference of cumulative score of player 2 and player 1 (which is 432431 =1 ). now as lead score of player 2 ( which is 7 ) is greater than 1 so the lead score of player 2 is not changed.

Now, in the fifth round, the cumulative score of player 1 becomes 519 (431+88) and cumulative score of player 2 becomes 522 (432+90). now as cumulative score of player 2 is greater then player 1 so now we compare the lead score of player 2 with the difference of cumulative score of player 2 and player 1 (which is 522519 =3 ). now as lead score of player 2 ( which is 7 ) is greater than 3 so the lead score of player 2 is not changed .
now at last we compare the lead scores of both the players and as lead score of player 1 which is 58 is greater than lead score of player 2 which is 7 so player 1 is the winner.
code :
#include <stdio.h>
int main() {
// your code goes here
int i,n,a,b,max1=0,max2=0,cum2=0,cum1=0;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d%d",&a,&b);
cum1+=a;
cum2+=b;
if(cum1>cum2)
{
if(max1<(cum1cum2))
max1=(cum1cum2);
}
else
{
if(max2<(cum2cum1))
max2=(cum2cum1);
}
}
if(max1>max2)
printf("%d %d",1,max1);
else
printf("%d %d",2,max2);
return 0;
}