Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
s = [list(map(int,input().split()))[1:]for i in range(m)]
p = list(map(int,input().split()))
form = "0"+str(n)+"b"
ans = 0
for i in range(2**n):
    ptn = format(i,form)
    light = True
    for j in range(m):
        s = sum(int(ptn[k-1])for k in s[j])
        if s%2 != p[j]:
            light = False
    if light == True:
        ans += 1
print(ans)

Fixed submission:
n,m = map(int,input().split())
l = [list(map(int,input().split()))[1:]for i in range(m)]
p = list(map(int,input().split()))
form = "0"+str(n)+"b"
ans = 0
for i in range(2**n):
    ptn = format(i,form)
    light = True
    for j in range(m):
        s = sum(int(ptn[k-1])for k in l[j])
        if s%2 != p[j]:
            light = False
    if light == True:
        ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
s = [list(map(int,input().split()))for i in range(m)]
p = list(map(int,input().split()))
ans = 0
for i in range(2**n):
    ptn = bin(i)[2:].rjust(n,"0")
    light = True
    for j in range(m):
        tmp = 0
        for k in range(1,s[j][0]+1):
            if ptn[s[j][n]-1] == "1":
                tmp += 1
        if tmp % 2 != p[j]% 2:
            light = False
    if light:
        ans += 1
print(ans)

Fixed submission:
n,m = map(int,input().split())
l = [list(map(int,input().split()))[1:]for i in range(m)]
p = list(map(int,input().split()))
form = "0"+str(n)+"b"
ans = 0
for i in range(2**n):
    ptn = format(i,form)
    light = True
    for j in range(m):
        s = sum(int(ptn[k-1])for k in l[j])
        if s%2 != p[j]:
            light = False
    if light == True:
        ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
if a >= 13:
    print(b)
elif a >= 6 and a <= 12:
    print(b//2)
else:
    print(0)

Fixed submission:
a,b = map(int,input().split())
if a >= 13:
    print(b)
elif 6 <= a <= 12:
    print(b//2)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
l = [0]*m
r = [0]*m
for i in range(m):
    l[i],r[i] = map(int,input().split())
if min(r)-max(l)<0:
    print(0)
else:
    print(min(r)-max(l)+1

Fixed submission:
n,m = map(int,input().split())
l = [0]*m
r = [0]*m
for i in range(m):
    l[i],r[i] = map(int,input().split())
if min(r)-max(l) < 0:
    print(0)
else:
    print(min(r)-max(l)+1)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = map(int,input().split())
bc =[list(map(int,input().split()))for _ in [0]*m]

a.sort()
bc.sort(key=lambda x:-x[1])
i =0
for b,c in bc:
    for j in range(i,min(n,i+b)):
        if a[j]< c:a[j]=c
    i = i+b
print(sum(a))

Fixed submission:
n,m = map(int,input().split())
*a, = map(int,input().split())
bc =[list(map(int,input().split()))for _ in [0]*m]
 
a.sort()
bc.sort(key=lambda x:-x[1])
i =0
for b,c in bc:
    for j in range(i,min(n,i+b)):
        if a[j]< c:a[j]=c
    i = i+b
print(sum(a))

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = map(int,input().split())
bc =[list(map(int,input().split()))for _ in [0]*m]

a.sort()
bc.sort(key=lamda x:-x[1])
i =0
for b,c in bc:
    for j in range(i,min(n,i+b)):
        if a[j]< c:a[j]=c
    i = i+b
print(sum(a))

Fixed submission:
n,m = map(int,input().split())
*a, = map(int,input().split())
bc =[list(map(int,input().split()))for _ in [0]*m]
 
a.sort()
bc.sort(key=lambda x:-x[1])
i =0
for b,c in bc:
    for j in range(i,min(n,i+b)):
        if a[j]< c:a[j]=c
    i = i+b
print(sum(a))
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
s = input()

print(s[:k-1]+s.upper[k-1]+s[k:])

Fixed submission:
_, K = map(int, input().split())
S = input()
 
print(S[: K - 1] + S[K - 1].lower() + S[K:])

Buggy python submission (verdict: Runtime Error):
n,k = map(int,inoput().split())
s = input()

print(s[:k-1]+s[k-1].lower()+s[k:])

Fixed submission:
_, K = map(int, input().split())
S = input()
 
print(S[: K - 1] + S[K - 1].lower() + S[K:])

Buggy python submission (verdict: Runtime Error):
n,k = map(int,inoput().split())
s = input()

print(s[:k-1]+s[k-1].lower+s[k:])

Fixed submission:
_, K = map(int, input().split())
S = input()
 
print(S[: K - 1] + S[K - 1].lower() + S[K:])

Buggy python submission (verdict: Runtime Error):
n,k = map(int,inoput().split())
s = input()

print(s[:k-1]+lower.s[k]+s[k+1:])

Fixed submission:
_, K = map(int, input().split())
S = input()
 
print(S[: K - 1] + S[K - 1].lower() + S[K:])
Buggy python submission (verdict: Runtime Error):
s = input()
a = int(s[:2])
b = int(s[2:])

if 1 <= a and a <= 12 and 1 <= b and b <=12:
    print("AMBIGUOUS")
elif 1 <= a <=　12 and (12 < b or b < 1):
    print("MMYY")
elif (12 < a or a < 1) and 1 <= b <= 12:
    print("YYMM")
else:
    print("NA")

Fixed submission:
S = input()
a = int(S[:2])
b = int(S[2:])
 
if 1 <= a and a <= 12 and 1 <= b and b <= 12:
    print("AMBIGUOUS")
elif 1 <= a and a <= 12 and (b > 12 or b < 1):
    print("MMYY")
elif (a > 12 or a < 1) and 1 <= b and b <= 12:
    print("YYMM")
else:
    print("NA")
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
ans = 0
for i in range(1,n+1):
    j =0
    if i < k:
        while i *(2**j) < k:
            j += 1
        ans +=(1/n)*/(2**j)
    else:
        ans += (1/n)
print(ans)

Fixed submission:
n,k = map(int,input().split())
ans = 0
for i in range(1,n+1):
    j = 0
    if i < k:
        while i*(2**j) < k:
            j +=1
        ans += (1/n) *1/(2**j)
    else:
        ans += (1/n)
print(ans)

Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
ans = 0
for i in range(1,n+1):
    j = 0
    if i < k:
        while i*(2**j) < k:
            j += 1
            ans += (1/n)*1/(2**j)
    else:
    ans += (1/n)
print(ans)

Fixed submission:
n,k = map(int,input().split())
ans = 0
for i in range(1,n+1):
    j = 0
    if i < k:
        while i*(2**j) < k:
            j +=1
        ans += (1/n) *1/(2**j)
    else:
        ans += (1/n)
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split()))
c = 1
for i in range(n):
    if h[i] >= max(h[0:i]):
        c += 1
print(c)

Fixed submission:
n = int(input())
h = list(map(int,input().split()))
c = 1
for i in range(1,n):
    if h[i] >= max(h[:i]):
        c += 1
print(c)
Buggy python submission (verdict: Runtime Error):
a = [int(input())for in range(6)]
if a[4] - a[0] > a[5]:
    print(":(")
else:
    print("Yay!")

Fixed submission:
a = [int(input())for i in range(6)]
if a[4] - a[0] > a[5]:
    print(":(")
else:
    print("Yay!")
Buggy python submission (verdict: Runtime Error):
b = input()
if b == T:
  print("A")
elif b == A:
  print("T")
elif b == G:
  print("C")
else:
  print("G")

Fixed submission:
b = input()
if b == "T":
  print("A")
elif b == "A":
  print("T")
elif b == "G":
  print("C")
else:
  print("G")
Buggy python submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
ans = 0
for i in range(1,101):
    if a % i == b % i == 0:
        ans.append(i)
print(ans[-k])

Fixed submission:
a,b,k=map(int,input().split())
ans = []
for i in range(1,101):
    if a % i == b % i == 0:
        ans.append(i)
print(ans[-k])

Buggy python submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
ans = 0
for i in range(1,101):
    if a % i == b % i == 0:
        ans.append(i)
print(ans[-k])

Fixed submission:
a,b,k=map(int,input().split())
ans = []
for i in range(1,101):
    if a % i == b % i == 0:
        ans.append(i)
print(ans[-k])
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split('/'))
if b%a ==0:
    print(a+b)
else:
    print(b-a)
    

Fixed submission:
a,b = map(int,input().split())
if b%a ==0:
    print(a+b)
else:
    print(b-a)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
A = [list(map(int,input().split())for i in range(n)]
ans = {i+1 for i in range(m)}
for a in A:
    ans = ans & set(a[1:])
print(len(ans))

Fixed submission:
n,m = map(int,input().split())
A = [list(map(int,input().split()))for i in range(n)]
ans = {i+1 for i in range(m)}
for a in A:
    ans = ans & set(a[1:])
print(len(ans))

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
A = list[map(int,input().split()) for i in range(n)]
ans = {i+1 for i in range(m)}
for a in A:
    ans = ans & set(a[1:])
print(len(ans))

Fixed submission:
n,m = map(int,input().split())
A = [list(map(int,input().split()))for i in range(n)]
ans = {i+1 for i in range(m)}
for a in A:
    ans = ans & set(a[1:])
print(len(ans))

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = list[map(int,input().split()) for i in range(n)]
ans = {i+1 for i in range(m)}
for b in a:
    ans = ans & set(a[1:])
print(len(ans))

Fixed submission:
n,m = map(int,input().split())
A = [list(map(int,input().split()))for i in range(n)]
ans = {i+1 for i in range(m)}
for a in A:
    ans = ans & set(a[1:])
print(len(ans))
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
x = sorted(map(int,input().split()))
l = sorted([x[i+1]-x[i]for i in range(m-1)])
if n >=m:
    print(0)
else:
    print(sum(l)-sum([-i-1]for i in range(n-1)))

Fixed submission:
n, m = map(int, input().split())
x = sorted(set(map(int, input().split())))
t = []
for i, j in zip(x, x[1:]):
    t += [abs(i - j)]
t = sorted(t, reverse=True)
print(sum(t[n-1:]))
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split('/'))
print(a*b/2)

Fixed submission:
a,b,c = map(int,input().split())
print(a*b//2)
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split()))
cnt = 0
for i in range(n-1):
    cnt +=min(h[i],h[i+1])
print(sum[h]-cnt)

Fixed submission:
n = int(input())
h = list(map(int,input().split()))
cnt = 0
for i in range(n-1):
    cnt +=min(h[i],h[i+1])
print(sum(h)-cnt)
Buggy python submission (verdict: Runtime Error):
n = int(input())
p =[int,input().split()for i in range(n)]

m = max(p)/2
print(m+sum(p)-max(p))

Fixed submission:
n = int(input())
p =[int(input())for i in range(n)]

m = max(p)//2
print(m+sum(p)-max(p))

Buggy python submission (verdict: Runtime Error):
n = int(input())
p =[map(int,input().split())for i in range(n)]

m = max(p)/2
print(m+sum(p)-max(p))

Fixed submission:
n = int(input())
p =[int(input())for i in range(n)]

m = max(p)//2
print(m+sum(p)-max(p))

Buggy python submission (verdict: Runtime Error):
n = int(input())
p =[list(map(int,input().split()))for i in range(n)]

m = max(p)/2
print(m+sum(p)-max(p))

Fixed submission:
n = int(input())
p =[int(input())for i in range(n)]

m = max(p)//2
print(m+sum(p)-max(p))
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split)
print(a+b//2)

Fixed submission:
a,b = map(int,input().split())
print(a+b//2)
Buggy python submission (verdict: Runtime Error):
n,m = [int(i) for i in input().split()]
a = [[]for i in range(n)]


for i in range(m):
    c,d = map(int,input().split())
    a =[c-1].append((d,i))
ans = [0]*m
for i,b in enumerate(a):
    b.sort()
    for k,(d,j) in enumerate(b):
        ans[j] = str(i+1).zfill(6)+str(k+1).zfill(6)
print(*ans,sep="\n")

Fixed submission:
N,M=map(int, input().split())
A=[[] for i in range(N)]
 
for i in range(M):
  p,y=map(int, input().split())
  A[p-1].append((y, i))
 
X=[0]*M
for i,d in enumerate(A):
  d.sort()
  for k,(y,j) in enumerate(d):
    X[j]=str(i+1).zfill(6)+str(k+1).zfill(6)
print(*X,sep='\n')

Buggy python submission (verdict: Runtime Error):
n,m = [int(i) for i in input().split()]
a = [[]for i in range(n)]
b = []

for i in range(m):
    c,d = [int(i)for i in input().split()]
    a =[c-1].append((d,i))
ans = [None]*m
for j,b in enumerate(a):
    b.sort()
    for k,(d,i) in enumerate(b):
        ans[i] = str(j+1).zfill(6)+str(k+1).zfill(6)
print(*ans,sep="\n")

Fixed submission:
N,M=map(int, input().split())
A=[[] for i in range(N)]
 
for i in range(M):
  p,y=map(int, input().split())
  A[p-1].append((y, i))
 
X=[0]*M
for i,d in enumerate(A):
  d.sort()
  for k,(y,j) in enumerate(d):
    X[j]=str(i+1).zfill(6)+str(k+1).zfill(6)
print(*X,sep='\n')
Buggy python submission (verdict: Runtime Error):
N,T = map(int,input().split())
m = 1001
for i in range(n):
    c,t = map(int,input().split())
    if t <= T:
        m = min(m,c)
print('TLE' if m == 1001 else m)

Fixed submission:
N,T = map(int,input().split())
m = 1001
for i in range(N):
    c,t = map(int,input().split())
    if t <= T:
        m = min(m,c)
print('TLE' if m == 1001 else m)
Buggy python submission (verdict: Runtime Error):
c = []
for i in range(3):
    c.append(list(map(int,input().split())))
a = [0,0,0]
b = [0,0,0]
for i in range(3):
    b[i] = c[i][0]-0
for i in range(3):
    a[i] = c[0][i]-b[0]
for i in range(3):
    for j in range(3):
        if a[j]+b[i] != c[i][j]:
            print("No")
            exit()
print("Yes")

Fixed submission:
from collections import Counter
 
S=input()
T=input()
 
S=list(Counter(S).values())
T=list(Counter(T).values())
 
S.sort()
T.sort()
 
if S==T:
  print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
w = [input() for i in range(n)]
bl = True
if len(w) != len(set(w)):
    bl = False
for i in range(n-1):
    if w[i][1] != w[i+1][0]:
        bl = False
print("Yes" if bl else"No")

Fixed submission:
n = int(input())
w = [input() for i in range(n)]
bl = True
if len(w) != len(set(w)):
    bl = False
for i in range(n-1):
    if w[i][-1] != w[i+1][0]:
        bl = False
print("Yes" if bl else"No")
Buggy python submission (verdict: Runtime Error):
a = int(input())

print((k//2)*((k+1)//2))

Fixed submission:
a = int(input())
print((a//2)*((a+1)//2))
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input(),split())
print(a-b+1)

Fixed submission:
a,b = map(int,input().split())
print(a-b+1)
Buggy python submission (verdict: Runtime Error):
h,w = map(int,input().split())
a = [[i for i in input()] for _ in range(h)]
b = [x for in a if "#" in x]
c = zip(*[x for x in zip(*b) if "#"in x])
for d in c:
    print("".join(d))

Fixed submission:
h,w = map(int,input().split())
a = [[i for i in input()] for _ in range(h)]
b = [x for x in a if "#" in x]
c = zip(*[x for x in zip(*b) if "#"in x])
for d in c:
    print("".join(d))
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input(),split())
print(a*b-a-b)

Fixed submission:
a,b = map(int,input().split())
print((a-1)*(b-1))
Buggy python submission (verdict: Runtime Error):
n = input()
if n % 2 ==0:
    print(n)
else:
    print(n*2)

Fixed submission:
n = int(input())
if n % 2 ==0:
    print(n)
else:
    print(n*2)
Buggy python submission (verdict: Runtime Error):
n = input()
s = sum(map(int,n))
if int(n)% s == 0:
    print("Yes")
else:
    print("No

Fixed submission:
n = input()
s = sum(map(int,n))
if int(n) % s == 0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n,k = list(map(int,input().split()))
a = lsit(map(int,input().split()))
print((n-1+k-2)//(k-1))

Fixed submission:
n,k = list(map(int,input().split()))
a = list(map(int,input().split()))
print((n-1+k-2)//(k-1))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
ans = 0
for i in a:
    while(i % 2 ==0):
        i // = 2
        ans += 1
print(ans)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
ans = 0
for i in a:
    while not i %2:
        i//= 2
        ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
num = [len(set(s[:i]) & set(s[i:])for i in range(n))]
print(max(num))


Fixed submission:
n = int(input())
s = input()
num = [len(set(s[:i]) & set(s[i:]))for i in range(n)]
print(max(num))
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
k = int(input())
print(sum(a,b,c)+(max(a,b,c)*(2**k-1)))

Fixed submission:
a,b,c = map(int,input().split())
k = int(input())
print(sum([a,b,c])+(max(a,b,c)*(2**k-1)))
Buggy python submission (verdict: Runtime Error):
a = input()
print(700+a.count(o)*100)

Fixed submission:
a = input()
print(700+a.count('o')*100)
Buggy python submission (verdict: Runtime Error):
x = int(input())
a = int(input())
b = int(input())

c = x-a
print(int(c%b())

Fixed submission:
x = int(input())
a = int(input())
b = int(input())

print((x-a)%b)
Buggy python submission (verdict: Runtime Error):
n = int(input())
d = [list(input())for i in range(n)]
print(len(set(d)))


Fixed submission:
n = int(input())
d = list(int(input())for i in range(n))
print(len(set(d)))

Buggy python submission (verdict: Runtime Error):
n = int(input())
d = [list(input())for i in ranghe(n)]
print(len(set(d)))


Fixed submission:
n = int(input())
d = list(int(input())for i in range(n))
print(len(set(d)))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))

n = len(a)
a.sort()
a.append()
ans = 0
i = 0

while i < n:
    cnt = 1
    while a[i] == a[i+1]:
        cnt += 1
        i += 1
    if cnt >= a[i]:
        ans += cnt - a[i]
    else:
        ans += cnt
    i += 1
print(ans)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))

n = len(a)
a.sort()
a.append(0)
ans = 0
i = 0

while i < n:
    cnt = 1
    while a[i] == a[i+1]:
        cnt += 1
        i += 1
    if cnt >= a[i]:
        ans += cnt - a[i]
    else:
        ans += cnt
    i += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = [2,1]
for i in range(2,n+1):
    l.append(l[i-1]+l[i-2])
print(l[i])

Fixed submission:
n = int(input())
l = [2,1]
for i in range(2,n+1):
    l.append(l[i-1]+l[i-2])
print(l[n])
Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
if a[0] == b[2] and a[1] == b[1] and a[2] == b[0]:
    print("YES")
else:
    priont("NO")

Fixed submission:
a = input()
b = input()
if a[0] == b[2] and a[1] == b[1] and a[2] == b[0]:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
s = input()
list= []
for i in range(s):
    if i % 2 == 1:
        list += i
print(list)


Fixed submission:
s = input()
a= ""
for i in range(len(s)):
    if i % 2 == 0:
        a += s[i]
print(a)
Buggy python submission (verdict: Runtime Error):
s = input()
a = len(s)-2
print(s[0]+a+s[-1])

Fixed submission:
s = input()
print(s[0]+str(len(s)-2)+s[-1])
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
if n%2 ==0:
    b = a[1::2][::-1]+a[::2]
    print(*b)
else:
    b =a[::2][::-1]*a[1::2]
    print(*b)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
if n%2 ==0:
    b = a[1::2][::-1]+a[::2]
    print(*b)
else:
    b =a[::2][::-1]+a[1::2]
    print(*b)
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = [int(input()-1 for i in range(n))]

a = l[0]
for i in range(n):
    if a == 1:
        print(i+1)
        exit()
    a = l[a]
else:
    print(-1)

Fixed submission:
n = int(input())
l = [int(input())-1 for i in range(n)]

a = l[0]
for i in range(n):
    if a == 1:
        print(i+1)
        exit()
    a = l[a]
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
l =[]
for i in a:
    l.append(i//400)
x = set()
y = 0
for i in l:
    if i< 7:
        x.add(i)
    else:
        y +=1
x = len(x)
if x:
    mi =x
else:
    mi =1
ma =x+y
print('{} {}'.format(mi.ma))

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
l =[]
for i in a:
    l.append(i//400)
x = set()
y = 0
for i in l:
    if i<= 7:
        x.add(i)
    else:
        y +=1
x = len(x)
if x:
    mi =x
else:
    mi =1
ma = x+y
print('{} {}'.format(mi, ma))

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
l =[]
for i in a:
    l.append(i//400)
x = set()
y = 0
for i in l:
    if i< 7:
        x.add(i)
    else:
        y +=1
x = len(x)
if x:
    mi =x
else:
    mi =1
ma =x+y
print('{}{}'.format(mi.ma))

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
l =[]
for i in a:
    l.append(i//400)
x = set()
y = 0
for i in l:
    if i<= 7:
        x.add(i)
    else:
        y +=1
x = len(x)
if x:
    mi =x
else:
    mi =1
ma = x+y
print('{} {}'.format(mi, ma))
Buggy python submission (verdict: Runtime Error):
n,k = map(int(input().split()))
ab = [list(map(int,input().split()))for i in range(n)]

ab.sort()
i = 0
c = ab[0][1]
while c < k:
    i +=1
    c += ab[i][1]
print(ab[i][0])

Fixed submission:
n,k = map(int, input().split())
ab = sorted([list(map(int,input().split())) for _ in range(n)])
i = 0
c = ab[0][1]
while c < k:
    i += 1
    c += ab[i][1]
print(ab[i][0])

Buggy python submission (verdict: Runtime Error):
n,k = map(int(input().split()))
ab = [list(map(int,input().split()))for i in range(n)]

ab.sort()
c = 0
for i in range(n):
    c += ab[i][1]
    if c >= k:
        print(ab[i][0])
        exit()

Fixed submission:
n,k = map(int, input().split())
ab = sorted([list(map(int,input().split())) for _ in range(n)])
i = 0
c = ab[0][1]
while c < k:
    i += 1
    c += ab[i][1]
print(ab[i][0])
Buggy python submission (verdict: Runtime Error):
a,b,c = input().split()
print((a[0]+b[1]+c[2]).upper())

Fixed submission:
a,b,c = input().split()
print((a[0]+b[0]+c[0]).upper())
Buggy python submission (verdict: Runtime Error):
a,b,c = input().split()
if b == '+':
    print(a+c)
else:
    print(a-c)

Fixed submission:
a,b,c = input().split()
if b == '+':
    print(int(a)+int(c))
else:
    print(int(a)-int(c))

Buggy python submission (verdict: Runtime Error):
a,b,c = input().split()
if b == '+':
    print(a+c)
else:
    print(a-c)

Fixed submission:
a,b,c = input().split()
if b == '+':
    print(int(a)+int(c))
else:
    print(int(a)-int(c))
Buggy python submission (verdict: Runtime Error):
n = int(input())
t = list(map(int,input().split()))
m = int(input())
for i in range(m):
    p,x = map(int,input().split())
print(sum[t]-t[p-1]+x)

Fixed submission:
n = int(input())
t = list(map(int,input().split()))
m = int(input())
for i in range(m):
    p,x = map(int,input().split())
    print(sum(t)-t[p-1]+x)

Buggy python submission (verdict: Runtime Error):
n = int(input())
t = list(map(int,input().split()))
m = int(input())
for i in range(m):
    p,x = map(int,input().split())
print(sum[t]-t[m-1]+x)

Fixed submission:
n = int(input())
t = list(map(int,input().split()))
m = int(input())
for i in range(m):
    p,x = map(int,input().split())
    print(sum(t)-t[p-1]+x)
Buggy python submission (verdict: Runtime Error):
a,b,c = input().split()
print("A"+B[0]+"Ç")

Fixed submission:
a,b,c = input().split()
print('A'+b[0]+'C')
Buggy python submission (verdict: Runtime Error):
a,b,c = list(map(int,input().split()))
a.sort()
if a == [5,5,7]:
    print("YES")
else:
    print("NO")

Fixed submission:
a = list(map(int,input().split()))
a.sort()
if a == [5,5,7]:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ar = list(map(int,input().split(" ")))
count = 0
for i in range(n-1):
    br = ar[i+1:n]
    count += ar[i] * sum(br)
print(count % (10 ** 9 + 7))

Fixed submission:
n = int(input())
ar = list(map(int,input().split(" ")))
sm = sum(ar)
count = 0
for i in range(n-1):
    sm -= ar[i]
    count += ar[i] * sm
print(count % (10 ** 9 + 7))