t = int(input())
list = []
for i in range(0,t):
a,b = input().split()
a = int(a)
b = int(b)
list.append(a-b)
x = max(list)
y = min(list) * (-1)
if x>y:
print("1 ",x)
else:
print("2 ",y)
t = int(input())
list = []
for i in range(0,t):
a,b = input().split()
a = int(a)
b = int(b)
list.append(a-b)
x = max(list)
y = min(list) * (-1)
if x>y:
print("1 ",x)
else:
print("2 ",y)
Try this test case
5
92 70
60 80
80 88
75 88
64 75
Output should be 2 30 but your code is printing is 1 21 which is wrong
You did not understand the question properly you were asked to find the maximum total lead after the end of each round not maximum of individual round leads.
I hope this helps
You can refer my solution https://www.codechef.com/viewsolution/18974906