Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n,w = map(int,input().split())
WV = [list(map(int,input().split())) for i in range(n)]
dp = [[0 for i in range(w+1)] for j in range(n+1)]

for i in range(n):
    for j in range(w+1):
        if j >= WV[i][0]:
            dp[i+1][j] = max(dp[i][j],dp[i][j-WV[i][0]]+WV[i][1])
        else:
            dp[i + 1][j] = dp[i][j]
print(dp[n][w])

Fixed submission:
n,w = map(int,input().split())
WV = [list(map(int,input().split())) for i in range(n)]
dp = [[0 for i in range(w+1)] for j in range(n+1)]

for i in range(n):
    for j in range(w+1):
        if j >= WV[i][0]:
            dp[i+1][j] = max(dp[i][j],dp[i][j-WV[i][0]]+WV[i][1])
        else:
            dp[i + 1][j] = dp[i][j]
print(dp[n][w])
Buggy python submission (verdict: Runtime Error):
v

Fixed submission:
n = int(input())
P = [int(input()) for _ in range(n)]

P.sort()
print(int(P[n-1]/2) + sum(P[:n-1]))
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int, input().split())
Y = [[] for _ in range(n)]
L = []
for i in range(m):
    p,yi = map(int, input().split())
    Y[p-1].append(yi)
    L.append(yi)
for i in range(n):
    Y[i].sort()
    for k in range(len(Y[i])):
        L[L.index(Y[i][k])] = str(i+1).rjust(6,"0") + str(k+1).rjust(6,"0")
for j in range(len(L)): print(L[j])


Fixed submission:
n,m = map(int, input().split())
Y = [[] for _ in range(n)]
for i in range(m):
    p,yi = map(int, input().split())
    Y[p-1].append((yi,i))
ans = [-1 for _ in range(m)]
for i,d in enumerate(Y):
    d.sort()
    for k,(a,b) in enumerate(d):
        ans[b] = str(i+1).rjust(6,"0") + str(k+1).rjust(6,"0")
print(*ans, sep = "\n")
Buggy python submission (verdict: Runtime Error):
s = input()
k = int(input())
for i in range(len(s)):
  if s[i] != 1:
    if k < i:
      print(1)
     else:
      print(s[i])
	break
else:
  print(1)

Fixed submission:
s = input()
k = int(input())
for i in range(len(s)):
    if s[i] != "1":
        if k < i+1:
            print(1)
        else:
            print(s[i])
        break
else:
    print(1)
Buggy python submission (verdict: Runtime Error):
from math import log
n = int(input())
s = ""

for i in range(int(log(abs(n),2))+3):
    #print("i=",i)
    if n % 2**(i+1) == 2**i:
        s = "1" + s
        n -= (-2)**(i)
        #print(i,n)
    else:
        s = "0" + s
if "1" in s:
    for j in s[s.find("1"):]:
        print(j,end = "")
else:
    print(0)

Fixed submission:
from math import log
n = int(input())
s = ""
if n != 0:
    for i in range(int(log(abs(n),2))+3):
        #print("i=",i)
        if n % 2**(i+1) == 2**i:
            s = "1" + s
            n -= (-2)**(i)
            #print(i,n)
        else:
            s = "0" + s
    for j in s[s.find("1"):]:
        print(j,end = "")
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
A = list(map(int, input().split()))
A = [A[i]-(i+1) for i in range(n)]
#print(A)
A.sort()
i = n/2
a,b = A[math.floor(i)], A[math.ceil(i)]
ans,ans1=0,0
for i in A:
    ans += abs(i-a)
    ans1 += abs(i-b)
print(min(ans,ans1))

Fixed submission:
import math
n = int(input())
A = list(map(int, input().split()))
A = [A[i]-(i+1) for i in range(n)]
#print(A)
A.sort()
i = n/2
a = A[math.floor(i)]
b = A[math.ceil(i)] if i>1 else a
ans,ans1=0,0
for i in A:
    ans += abs(i-a)
    ans1 += abs(i-b)
print(min(ans,ans1))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [list(map(int,input().split())) for i in range(2)]
ans = 0
su1 = [0]*n
su2 = [0]*n
su1[0],su2[0] = a[0][0],a[1][0]
for i in range(n):
    if i>0:
        su1[i] = su1[i-1]+a[0][i]
        su2[i] = su2[i - 1] + a[1][i]
#print(su1)
#print(su2)
for i in range(n):
    temp = su1[i]+su2[n-1]-(su2[i-1] if i>0 else 0)
    ans = max(ans, temp)
print(ans)n = int(input())
a = [list(map(int,input().split())) for i in range(2)]
ans = 0
su1 = [0]*n
su2 = [0]*n
su1[0],su2[0] = a[0][0],a[1][0]
for i in range(n):
    if i>0:
        su1[i] = su1[i-1]+a[0][i]
        su2[i] = su2[i - 1] + a[1][i]
#print(su1)
#print(su2)
for i in range(n):
    temp = su1[i]+su2[n-1]-(su2[i-1] if i>0 else 0)
    ans = max(ans, temp)
print(ans)

Fixed submission:
n = int(input())
a = [list(map(int,input().split())) for i in range(2)]
ans = 0
su1 = [0]*n
su2 = [0]*n
su1[0],su2[0] = a[0][0],a[1][0]
for i in range(n):
    if i>0:
        su1[i] = su1[i-1]+a[0][i]
        su2[i] = su2[i - 1] + a[1][i]
#print(su1)
#print(su2)
for i in range(n):
    temp = su1[i]+su2[n-1]-(su2[i-1] if i>0 else 0)
    ans = max(ans, temp)
print(ans)
Buggy python submission (verdict: Runtime Error):
from collections import Counter
n,k = map(int,input().split())
a = list(map(int,input().split()))
cnt = Counter(a)
mo = sorted(cnt,reverse=True)
#print(mo)
ans = 0
for i in range(max(0,len(mo)-k)):
    ans += mo[i][1]
print(ans)


Fixed submission:
from collections import Counter
n,k = map(int,input().split())
a = list(map(int,input().split()))
cnt = Counter(a)
mo = cnt.most_common()[::-1]
#print(mo)
ans = 0
for i in range(max(0,len(mo)-k)):
    ans += mo[i][1]
print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np
l = [list(input()) for i in range(2)]
arr = np.array(l)
if arr == np.rot90(arr,k=2):
    print("YES")
else:
    print("NO")

Fixed submission:
import numpy as np
l = [list(input()) for i in range(2)]
arr = np.array(l)
if np.all(arr == np.rot90(arr,k=2)):
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
n = input()
l = len(n)

# print(l)
temp=''
ans=0

if l==1:
	# print(int(n))
else:
	for i in range(1,l):
		if i%2==1:
			temp='9'
			temp+='0'*(i-1)
			ans+=int(temp)
			# print(ans)

	if l%2==1:
		ans+=(int(n)-int('9'*(l-1)))

print(ans)

Fixed submission:
n = input()
l = len(n)

# print(l)
temp=''
ans=0

if l==1:
	print(int(n))
else:
	for i in range(1,l):
		if i%2==1:
			temp='9'
			temp+='0'*(i-1)
			ans+=int(temp)
			# print(ans)

	if l%2==1:
		ans+=(int(n)-int('9'*(l-1)))

	print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
l,r=map(int,input().split())
ans = 2019
for i in range(l,r):
	for j in range(i+1,r+1):
		ans = min(ans,i*j%2019)
print(ans)



Fixed submission:
l,r=map(int,input().split())
ans = 2019
for i in range(l,min(r,l+2030)):
	for j in range(i+1,min(r+1,i+2030)):
		ans = min(ans,i*j%2019)
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a>=13:
	print(b)
elif a>=6:
	print(int(b/2)
else:
	print(0)

Fixed submission:
a,b = map(int,input().split())
if a>=13:
	print(b)
elif a>=6:
	print(int(b/2))
else:
	print(0)
Buggy python submission (verdict: Runtime Error):
r,d,x = int(input().split())
for i in range(10):
	x = r * x - d
	print(x)

Fixed submission:
r,d,x = map(int, input().split())
for i in range(10):
	x = r * x - d
	print(x)
Buggy python submission (verdict: Runtime Error):
s = input()
a = int(s[:2])
b = int(s[2:])
if a <= 12 && a > 0:
	if b <=12 and b > 0:
		print('AMBIGUOUS')
	else:
		print('MMYY')
else:
	if b <=12 and b > 0:
		print('YYMM')
	else:
		print('NA')

Fixed submission:
s = input()
a = int(s[:2])
b = int(s[2:])
if a <= 12 and a > 0:
	if b <=12 and b > 0:
		print('AMBIGUOUS')
	else:
		print('MMYY')
else:
	if b <=12 and b > 0:
		print('YYMM')
	else:
		print('NA')

Buggy python submission (verdict: Runtime Error):
s = input()
a = int(s[:2])
b = int(s[2:])
if a <= 12 && a > 0:
	if b <=12 && b > 0:
		print('AMBIGUOUS')
	else:
		print('MMYY')
else:
	if b <=12 && b > 0:
		print('YYMM')
	else:
		print('NA')

Fixed submission:
s = input()
a = int(s[:2])
b = int(s[2:])
if a <= 12 and a > 0:
	if b <=12 and b > 0:
		print('AMBIGUOUS')
	else:
		print('MMYY')
else:
	if b <=12 and b > 0:
		print('YYMM')
	else:
		print('NA')
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = [input() for i in range(n)]
a = 0
b = 0
ba = 0
ab = 0
for i in range(n):
    if 'AB' in l[i]:
        for j in range(len(l[i])-1):
            if l[i][j] == 'A' and l[i][j+1] == 'B':
                ab += 1
    if l[i][0] =='B' and l[i][-1] == 'A':
        ba += 1
    elif l[i][-1] == 'A':
        a += 1
    elif l[i][0] == 'B':
        b += 1
if max(a,b) == 0　and ba <= 1:
    print(ab)
elif max(a,b) == 0:
    print(ab+ba-1)
else:
    print(min(a,b)+ab+ba)

Fixed submission:
n,k = map(int, input().split())
print(n-k+1)

Buggy python submission (verdict: Runtime Error):
n,k = int(input().split())
print(n-k+1)

Fixed submission:
n,k = map(int, input().split())
print(n-k+1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = [input() for i in range(n)]
a = 0
b = 0
ba = 0
ab = 0
for i in range(n):
    if 'AB' in l[i]:
        for j in range(len(l[i])-1):
            if l[i][j] == 'A' and l[i][j+1] == 'B':
                ab += 1
    if l[i][0] =='B' and l[i][-1] == 'A':
        ba += 1
    elif l[i][-1] == 'A':
        a += 1
    elif l[i][0] == 'B':
        b += 1
if max(a,b) == 0　and ba <= 1:
    print(ab)
elif max(a,b) == 0:
    print(ab+ba-1)
else:
    print(min(a,b)+ab+ba)

Fixed submission:
n = int(input())
l = [input() for i in range(n)]
a = 0
b = 0
ba = 0
ab = 0
for i in range(n):
    if 'AB' in l[i]:
        for j in range(len(l[i])-1):
            if l[i][j] == 'A' and l[i][j+1] == 'B':
                ab += 1
    if l[i][0] =='B' and l[i][-1] == 'A':
        ba += 1
    elif l[i][-1] == 'A':
        a += 1
    elif l[i][0] == 'B':
        b += 1
if max(a,b) == 0 and ba <= 1:
    print(ab)
elif max(a,b) == 0:
    print(ab+ba-1)
else:
    print(min(a,b)+ab+ba)

Buggy python submission (verdict: Runtime Error):
n = int(input())
l = [input() for i in range(n)]
a = 0
b = 0
ba = 0
ab = 0
for i in range(n):
    if 'AB' in l[i]:
        for j in range(len(l[i])-1):
            if l[i][j] == 'A' and l[i][j+1] == 'B':
                ab += 1
    if l[i][0] =='B' and l[i][-1] == 'A':
        ba += 1
    elif l[i][-1] == 'A':
        a += 1
    elif l[i][0] == 'B':
        b += 1
if max(a,b) == 0　and ba <= 1:
    print(ab)
elif max(a,b) == 0:
    print((ab+ba-1))
else:
    print(min(a,b)+ab+ba)

Fixed submission:
n = int(input())
l = [input() for i in range(n)]
a = 0
b = 0
ba = 0
ab = 0
for i in range(n):
    if 'AB' in l[i]:
        for j in range(len(l[i])-1):
            if l[i][j] == 'A' and l[i][j+1] == 'B':
                ab += 1
    if l[i][0] =='B' and l[i][-1] == 'A':
        ba += 1
    elif l[i][-1] == 'A':
        a += 1
    elif l[i][0] == 'B':
        b += 1
if max(a,b) == 0 and ba <= 1:
    print(ab)
elif max(a,b) == 0:
    print(ab+ba-1)
else:
    print(min(a,b)+ab+ba)

Buggy python submission (verdict: Runtime Error):
n = int(input())
l = [input() for i in range(n)]
a = 0
b = 0
ba = 0
ab = 0
for i in range(n):
    if 'AB' in l[i]:
        for j in range(len(l[i])-1):
            if l[i][j] == 'A' and l[i][j+1] == 'B':
                ab += 1
    if l[i][0] =='B' and l[i][-1] == 'A':
        ba += 1
    elif l[i][-1] == 'A':
        a += 1
    elif l[i][0] == 'B':
        b += 1
if max(a,b) == 0　and ba <= 1:
    print(ab)
elif max(a,b) == 0
    print((ab+ba-1))
else:
    print(min(a,b)+ab+ba)

Fixed submission:
n = int(input())
l = [input() for i in range(n)]
a = 0
b = 0
ba = 0
ab = 0
for i in range(n):
    if 'AB' in l[i]:
        for j in range(len(l[i])-1):
            if l[i][j] == 'A' and l[i][j+1] == 'B':
                ab += 1
    if l[i][0] =='B' and l[i][-1] == 'A':
        ba += 1
    elif l[i][-1] == 'A':
        a += 1
    elif l[i][0] == 'B':
        b += 1
if max(a,b) == 0 and ba <= 1:
    print(ab)
elif max(a,b) == 0:
    print(ab+ba-1)
else:
    print(min(a,b)+ab+ba)
Buggy python submission (verdict: Runtime Error):
n = int(input())

ans = 0
for i in range(1,n):
    if (n-i)/i > i:
        if (n-i)%i == 0:
            ans += (n-i)/i
    else:
        break
print(int(ans)

Fixed submission:
n = int(input())

ans = 0
for i in range(1,n):
    if (n-i)/i > i:
        if (n-i)%i == 0:
            ans += (n-i)/i
    else:
        break
print(int(ans))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
m = 0
c = 0
for i in A:
    if m <= i:
        c += 1
        m = i
 
print(c)

Fixed submission:
a,b = map(int, input().split())
if a == b:
    print(a*2)
elif a > b:
    print(a*2-1)
else:
    print(b*2-1)

Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
sum = 0
m = 0
for i in h:
    if m <= i:
        sum += 1
        m = i
print(sum)

Fixed submission:
a,b = map(int, input().split())
if a == b:
    print(a*2)
elif a > b:
    print(a*2-1)
else:
    print(b*2-1)

Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
sum = 0
max = 0
for i in h:
    if max <= i:
        sum += 1
        max = i
print(sum)

Fixed submission:
a,b = map(int, input().split())
if a == b:
    print(a*2)
elif a > b:
    print(a*2-1)
else:
    print(b*2-1)

Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
sum = 0
max = 0
for i in range(n):
    if max <= h[i]:
        sum += 1
        max = h[i]
print(sum)

Fixed submission:
a,b = map(int, input().split())
if a == b:
    print(a*2)
elif a > b:
    print(a*2-1)
else:
    print(b*2-1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = map(int, input().split())
sum = 0
max = 0
for i in range(n):
    if max <= h[i]:
        sum += 1
        max = h[i]
print(sum)

Fixed submission:
n = int(input())
h = list(map(int, input().split()))
sum = 0
m = 0
for i in h:
    if m <= i:
        sum += 1
        m = i
print(sum)

Buggy python submission (verdict: Runtime Error):
n = int(input())
h = map(int, input().split())
sum = 0
max = 0
for i in range(n):
    if max <= h[i]:
        sum　+= 1
        max = h[i]
print(sum)
        
    

Fixed submission:
n = int(input())
h = list(map(int, input().split()))
sum = 0
m = 0
for i in h:
    if m <= i:
        sum += 1
        m = i
print(sum)
Buggy python submission (verdict: Runtime Error):
l = [int(input()) for i in range(5)]
if l <= int(input()):
    print('Yay!')
else:
    print(':(')

Fixed submission:
l = [int(input()) for i in range(5)]
if l[4]-l[0] <= int(input()):
    print('Yay!')
else:
    print(':(')
Buggy python submission (verdict: Runtime Error):
l = [int(input())for i in range(5)]
l1 = []*5
ans = 0
for i in range(5):
    l1[i] = l[i]%10
for i in range(5):
    ans += -(-l[i]//10)
print(ans*10 + min(l1))

Fixed submission:
l = [int(input())for i in range(5)]
l1 = ['']*5
ans = 0
for i in range(5):
    l1[i] = l[i]%10
    if l1[i] == 0:
        l1[i] = 10
for i in range(5):
    ans += -(-l[i]//10)
print(ans*10 - 10 + min(l1))

Buggy python submission (verdict: Runtime Error):
l = [int(input())for i in range(5)]
num = l.index(min(l))
sum = 0
for i in range(5):
    if i != num:
        ans += -(-l[i] // 10)
print(ans*10 + l[num])

Fixed submission:
l = [int(input())for i in range(5)]
l1 = ['']*5
ans = 0
for i in range(5):
    l1[i] = l[i]%10
    if l1[i] == 0:
        l1[i] = 10
for i in range(5):
    ans += -(-l[i]//10)
print(ans*10 - 10 + min(l1))

Buggy python submission (verdict: Runtime Error):
l = [int(input())for i in range(5)]
num = l.index(min(l))
sum = 0
for i in range(5):
    if i != num:
        ans += -(-l[i] // 10)
print(ans*10)

Fixed submission:
l = [int(input())for i in range(5)]
l1 = ['']*5
ans = 0
for i in range(5):
    l1[i] = l[i]%10
    if l1[i] == 0:
        l1[i] = 10
for i in range(5):
    ans += -(-l[i]//10)
print(ans*10 - 10 + min(l1))
Buggy python submission (verdict: Runtime Error):
n,q=map(int,input().split())
s=input()

for _ in range(q):
	l,r=map(int,input().split())
	# list_=[s[l-1:r]]
	# print(s[l-1:r])
	ans=0
	for i in range(l-1,r-1):
		if s[i] == 'A' and s[i+1] == 'C':
			ans +=1



	print(ans)

Fixed submission:
l = ['A', 'C', 'T', 'G']
b = input()
for i in range(4):
    if l[i] == b:
        print(l[(i+2)%4])
        break

Buggy python submission (verdict: Runtime Error):
l = ['A', 'C', 'T', 'G']
b = input()
for i in range(3):
    if l[i] == b:
        print(l[(i+2)/4])
        break

Fixed submission:
l = ['A', 'C', 'T', 'G']
b = input()
for i in range(4):
    if l[i] == b:
        print(l[(i+2)%4])
        break
Buggy python submission (verdict: Runtime Error):
l = ['A', 'C', 'T', 'G']
s = input()
max = 0
max_temp = 0
for i in len(s):
    if str(s[i]) in l:
        max_temp += 1
        if max < max_temp:
            max = max_temp
    else:
        max_temp = 0
print(max)

Fixed submission:
l = ['A', 'C', 'T', 'G']
s = input()
max = 0
max_temp = 0
for i in s:
    if i in l:
        max_temp += 1
        if max < max_temp:
            max = max_temp
    else:
        max_temp = 0
print(max)

Buggy python submission (verdict: Runtime Error):
l = ['A', 'C', 'T', 'G']
s = input()
max = 0
max_temp = 0
for i in len(s):
    if s[i] in l:
        max_temp += 1
        if max < max_temp:
            max = max_temp
    else:
        max_temp = 0
print(max)

Fixed submission:
l = ['A', 'C', 'T', 'G']
s = input()
max = 0
max_temp = 0
for i in s:
    if i in l:
        max_temp += 1
        if max < max_temp:
            max = max_temp
    else:
        max_temp = 0
print(max)
Buggy python submission (verdict: Runtime Error):
n, m, c = map(int, input().split())
b = input().split()
ans = 0

for j in range(n):
    a = list(int(x) for x in input().split())
    for i in range(m):
        sum = 0
        sum += a[i]*b[i]
        if sum > -c:
            ans += 1

print(ans)

Fixed submission:
n, m, c = map(int, input().split())
b = list(int(x) for x in input().split())
ans = 0

for j in range(n):
    a = list(int(x) for x in input().split())
    sum = 0
    for i in range(m):
        sum += a[i]*b[i]
    if sum > -c:
        ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
n, m, c = map(int, input().split())
b = input().split()
ans = 0

for j in range(n):
    a = input().split()
    for i in range(m):
        sum = 0
        sum += a[i]*b[i]
    if sum > -c:
        ans += 1

print(ans)

Fixed submission:
n, m, c = map(int, input().split())
b = list(int(x) for x in input().split())
ans = 0

for j in range(n):
    a = list(int(x) for x in input().split())
    sum = 0
    for i in range(m):
        sum += a[i]*b[i]
    if sum > -c:
        ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
n, m, c = map(int, input().split())
b = input().split()
ans = 0

for j in range(n):
    a = input().split()
    for i in range(m):
        sum = 0
        sum += a[i]*b[i]
    if sum > -c:
        ans += 1

print(ans)

Fixed submission:
n, m, c = map(int, input().split())
b = list(int(x) for x in input().split())
ans = 0

for j in range(n):
    a = list(int(x) for x in input().split())
    sum = 0
    for i in range(m):
        sum += a[i]*b[i]
    if sum > -c:
        ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
n, m, c = map(int, input().split())
b = [int(x) for x in range(m)]
ans = 0

for j in range(n):
    a = input().split()
    for i in range(m):
        sum = 0
        sum += a[i]*b[i]
    if sum > -c:
        ans += 1

print(ans)

Fixed submission:
n, m, c = map(int, input().split())
b = list(int(x) for x in input().split())
ans = 0

for j in range(n):
    a = list(int(x) for x in input().split())
    sum = 0
    for i in range(m):
        sum += a[i]*b[i]
    if sum > -c:
        ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c = int(input().split())
ans = 0
for i in range(c):
    b = b - a
    if b < 0:
        break
    ans += 1

print(c)

Fixed submission:
a,b,c = map(int, input().split())
d = b // a
print(min(d,c))
Buggy python submission (verdict: Runtime Error):
s = input()
s = s.remove('/').remove('/')
if int(s) <= 20190430:
	print('Heisei')
else:
	print('TBD') 

Fixed submission:
s = input()
s = s.replace('/','')
if int(s) <= 20190430:
	print('Heisei')
else:
	print('TBD')
Buggy python submission (verdict: Runtime Error):
n = int(input())
money = 0
for i in range(n):
	x,u = input().split()
	if u = 'JPY':
		money += int(x)
	else:
		money += int(x)*10000
print(money)

Fixed submission:
n = int(input())
money = 0
for i in range(n):
	x,u = input().split()
	if u == 'JPY':
		money += int(x)
	else:
		money += float(x)*380000.0
 
print(money)
Buggy python submission (verdict: Runtime Error):
*l = map(int, open(0).read().split())
if l[1] % l[0] == 0:
	print(l[0] + l[1])
else:
	print(l[1] - l[0])

Fixed submission:
*l, = map(int, open(0).read().split())
if l[1] % l[0] == 0:
	print(l[0] + l[1])
else:
	print(l[1] - l[0])
Buggy python submission (verdict: Runtime Error):
n = int(input())
# l = sort(map(int, input().split()))
l = (int(x) for x in input().split()).sort()
l_sum = 0
for i in range(n-1):
	l_sum += l[i]
if l_sum > l[n-1]:
	print('Yes')
else:
	print('No')

Fixed submission:
n = int(input())
l = [int(x) for x in input().split()]
l.sort()
# print(l)
l_sum = 0
for i in range(n-1):
	l_sum += l[i]
if l[n-1] < l_sum:
	print('Yes')
else:
	print('No')

Buggy python submission (verdict: Runtime Error):
n = int(input())
# l = sort(map(int, input().split()))
l = sort(int(x) for x in input().split())
l_sum = 0
for i in range(n-1):
	l_sum += l[i]
if l_sum > l[n-1]:
	print('Yes')
else:
	print('No')

Fixed submission:
n = int(input())
l = [int(x) for x in input().split()]
l.sort()
# print(l)
l_sum = 0
for i in range(n-1):
	l_sum += l[i]
if l[n-1] < l_sum:
	print('Yes')
else:
	print('No')

Buggy python submission (verdict: Runtime Error):
n = int(input())
l = sort(map(int, input().split()))
l_sum = 0
for i in range(n-1):
	l_sum += l[i]
if l_sum > l[n-1]:
	print('Yes')
else:
	print('No')

Fixed submission:
n = int(input())
l = [int(x) for x in input().split()]
l.sort()
# print(l)
l_sum = 0
for i in range(n-1):
	l_sum += l[i]
if l[n-1] < l_sum:
	print('Yes')
else:
	print('No')
Buggy python submission (verdict: Runtime Error):
l = map(int, input().split())
print(l[0]*l[1]/2)

Fixed submission:
l = list(map(int, input().split()))
print(int(l[0]*l[1]/2))
Buggy python submission (verdict: Runtime Error):
s = []
s.append(int(input()))
for i in range(1, 1000000):
	if s %2:
		s.append(3*s+1)
	else:
		s.append(s/2)
	for j in range(i):
		if s[j] == s[i]:
			print(i)

Fixed submission:
s = [int(input())]
for i in range(1000000):
	if s[i]%2==0:
		
		# print(s)
		if s[i]/2 in s:
			print(i+2)
			break
		s.append(s[i]/2)
	else:
		
		if 3*s[i]+1 in s:
			print(i+2)
			break
		s.append(3*s[i]+1)
	# print(s)
Buggy python submission (verdict: Runtime Error):
N, *d = map(int, open(0).read().split())
print(sum(d)-max(s)/2)

Fixed submission:
N, *d = map(int, open(0).read().split())
print(int(sum(d)-max(d)/2))

Buggy python submission (verdict: Runtime Error):
N, *d = map(int, open(0))
print(sum(d)-max(s)/2)

Fixed submission:
N, *d = map(int, open(0).read().split())
print(int(sum(d)-max(d)/2))
Buggy python submission (verdict: Runtime Error):
n = int(input())
t,a = map(int, input().split())
h = list(map(int, input().split()))

for i in range(n):
	h[i] = abs(a-(t - h[i]*0.006))

print(h.index(min(h))+1)

Fixed submission:
x,y = map(int, input().split())
print(int(x+y/2))

Buggy python submission (verdict: Runtime Error):
x,y = map(int, input().split())
print(int(x+y/2)

Fixed submission:
x,y = map(int, input().split())
print(int(x+y/2))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = sorted(list(map(int, input().split())), reverse=True)
print(sum(a[::2]) - sum(a[1::2])))

Fixed submission:
n = int(input())
a = sorted(list(map(int, input().split())), reverse=True)
print(sum(a[::2]) - sum(a[1::2]))

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = sorted(list(map(int, input().split())), reverse=True)
print(sum(a[::2] - sum(a[1::2])))

Fixed submission:
n = int(input())
a = sorted(list(map(int, input().split())), reverse=True)
print(sum(a[::2]) - sum(a[1::2]))

Buggy python submission (verdict: Runtime Error):
n = input()
a = sorted(list(map(int, input().split())), reverse=True)
print(sum(a[::2] - a[1::2]))

Fixed submission:
n = int(input())
a = sorted(list(map(int, input().split())), reverse=True)
print(sum(a[::2]) - sum(a[1::2]))