#46279: python簡單解


youxunzhou61@gmail.com (August0422)

學校 : 國立竹北高級中學
編號 : 261385
來源 : [1.161.156.240]
最後登入時間 :
2025-09-26 22:31:43

k = int(input())
t=[]
s=[]

for i in range(k):
    t1,s1 = map(int,input().split())
    t.append(t1)
    s.append(s1)

score = max(s) - k - s.count(-1)*2
index = s.index(max(s))
time = t[index]

if score < 0:
    score = 0

print(score,time)