Here is the question

https://www.codechef.com/IARCSJUD/problems/LEADGAME

My answer

# cook your dish here

try:

leada=0

leadb=0

n=int(input())

b=[]

d=[]

e=[]

for i in range(0,n):

a=input()

b.extend(a.split())

c=list(map(int,b))

for i in range(0,2*n-2):
c[i+2]+=c[i]
for i in range(0,2*n,2):

if c[i]>c[i+1]:

leada=c[i]-c[i+1]

d.append(leada)

elif c[i]<c[i+1]:

leadb= c[i+1]-c[i]

e.append(leadb)

if max(d)>max(e) :

print(1, max(d))

else:

print(2, max(e))

except EOFError:

pass