Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n,d = map(int,input().split())
sight = 2*d+1
print((n//sight) + (n%sight != 0))
    


Fixed submission:
print(3*(int(input())**2))
Buggy python submission (verdict: Runtime Error):
n,d = map(int,input().split())
sight = 2*d+1
i = 1
while(True)
  if n <= i*sight:
    print(i)
    break
  i += 1
    

Fixed submission:
n,d = list(map(int,input().split()))
sight = 2*d+1
print((n//sight) + (n%sight != 0))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
lis = list(map(int,input().split()))
count = 0
i = 0
while(i < n-2):
  temp = lis[i:i+3]
  if temp[1] == sorted(temp)[1]:
    count += 1
print(count)

Fixed submission:
n = int(input())
lis = list(map(int,input().split()))
count = 0
i = 0
while(i < n-2):
  temp = lis[i:i+3]
  if temp[1] == sorted(temp)[1]:
    count += 1
  i += 1
  
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
lis = list(map(int,input().split()))

import fractions
from functools import reduce

def gcds(numbers):
  return reduce(fractions.gcd,numbers)

nm = 0

for i in range(n):
  t = gcds(lis[:i]+lis[i+1:])
  if nm < t:
    nm = t
print(nm)


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

import fractions
from functools import reduce

def gcds(numbers):
  return reduce(fractions.gcd,numbers)
def gcd2(*numbers):
  return reduce(fractions.gcd,numbers)
  

mx = 0

lisgcd = [0]*n
rlisgcd = [0]*n

lisgcd[0] = lis[0]
rlisgcd[n-1] = lis[n-1]

for i in range(n-1):
  lisgcd[i+1] = gcd2(lisgcd[i],lis[i])
  
for i in range(n-2,-1,-1):
  rlisgcd[i] = gcd2(rlisgcd[i+1],lis[i])
  
for i in range(n):
  if i == 0:
    if mx < rlisgcd[1]:
      mx = rlisgcd[1]
  elif i == n-1:
    if mx < lisgcd[n-1]:
      mx = lisgcd[n-1]
  else:
    t = gcd2(lisgcd[i],rlisgcd[i+1])
    if mx < t:
      mx = t
print(mx)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
lis = list(map(int,input().split()))

import fractions
from functools import reduce

def gcds(numbers):
  return reduce(fractions.gcd,numbers)

nm = 0

for i in range(n):
  t = gcds(lis[:i]+lis[i+1:])
  if nm < t:
    nm = t
print(nm)

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

import fractions
from functools import reduce

def gcds(numbers):
  return reduce(fractions.gcd,numbers)
def gcd2(*numbers):
  return reduce(fractions.gcd,numbers)
  

mx = 0

lisgcd = [0]*n
rlisgcd = [0]*n

lisgcd[0] = lis[0]
rlisgcd[n-1] = lis[n-1]

for i in range(n-1):
  lisgcd[i+1] = gcd2(lisgcd[i],lis[i])
  
for i in range(n-2,-1,-1):
  rlisgcd[i] = gcd2(rlisgcd[i+1],lis[i])
  
for i in range(n):
  if i == 0:
    if mx < rlisgcd[1]:
      mx = rlisgcd[1]
  elif i == n-1:
    if mx < lisgcd[n-1]:
      mx = lisgcd[n-1]
  else:
    t = gcd2(lisgcd[i],rlisgcd[i+1])
    if mx < t:
      mx = t
print(mx)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
lis = []
for i in range(1,min(a,b)+1):
  if a%i == 0 and b%i == 0:
    lis.append(i)
print(lis[-1*c])

Fixed submission:
a,b,c = map(int,input().split())
if a*c < b:
  print(c)
else:
  print(b//a)

Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input(),split())
if a*c < b:
  print(c)
else:
  print(b//a)

Fixed submission:
a,b,c = map(int,input().split())
if a*c < b:
  print(c)
else:
  print(b//a)
Buggy python submission (verdict: Runtime Error):
lis = list(input().split("/"))
if lis[1] <= 4:
  print("Heisei")
else:
  print("TBD")

Fixed submission:
lis = list(map(int,input().split("/")))
if lis[1] <= 4:
  print("Heisei")
else:
  print("TBD")
Buggy python submission (verdict: Runtime Error):
lis = [0,0,0,0]
for n,m in lis(map(int,input().split())):
  lis[n-1] += 1
  lis[m-1] += 1
if 3 in lis:
  print("NO")
else:
  print("YES")

Fixed submission:
lis = [0,0,0,0]
for _ in range(3):
  n,m = list(map(int,input().split()))
  lis[n-1] += 1
  lis[m-1] += 1
if 3 in lis:
  print("NO")
else:
  print("YES")
Buggy python submission (verdict: Time Limit Exceeded):
s = list(input())
count = 0


for i in range(len(s)):
    for j in range(len(s)-1, i, -1):
        if s[j] > s[j-1]:
            count += 1
            s[j], s[j-1] = s[j-1], s[j]

print(count)

Fixed submission:
count  = 0
ans = 0
s = list(input())

for item in s:
  if item == "W":
    ans += count
  else:
    count += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
lis = [[] for i in range(n)]
lnum = [0]*100001
query = []

for _ in range(m):
  tp = tuple(map(int,input().split()))
  query.append(tp)
  lis[tp[0]-1].append(tp[1])
  
for i in range(n):
  lis[i].sort()

for pref in lis:
  for i,city in enumerate(pref):
    lnum[city] = i+1
  
for item in query:
  print("{:06}{:06}".format(item[0],lnum[item[1]]))

Fixed submission:
n,m = map(int,input().split())
lis = [[] for i in range(n)]
query = []

for num in range(m):
  tp = tuple(map(int,input().split()))
  query.append(tp)
  lis[tp[0]-1].append((tp[1],num))  

ans = [[0,0] for i in range(m)]

for num_p , pref in enumerate(lis):
  pref.sort(key = lambda tp:tp[0])
  for i,tp_city in enumerate(pref):
    ans[tp_city[1]][0] = num_p
    ans[tp_city[1]][1] = i+1

for item in ans:
  print("{:06}{:06}".format(item[0]+1,item[1]))

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
lis = [[] for i in range(n)]
lnum = [0]*100001
query = []

for _ in range(m):
  tp = tuple(map(int,input().split()))
  query.append(tp)
  lis[tp[0]-1].append(tp[1])
  
for i in range(n):
  lis[i].sort()

for pref in lis:
  for i,city in enumerate(pref):
    lnum[city] = i
  
for item in query:
  print("{:06}{:06}".format(item[0],lnum[item[1]]+1))

Fixed submission:
n,m = map(int,input().split())
lis = [[] for i in range(n)]
query = []

for num in range(m):
  tp = tuple(map(int,input().split()))
  query.append(tp)
  lis[tp[0]-1].append((tp[1],num))  

ans = [[0,0] for i in range(m)]

for num_p , pref in enumerate(lis):
  pref.sort(key = lambda tp:tp[0])
  for i,tp_city in enumerate(pref):
    ans[tp_city[1]][0] = num_p
    ans[tp_city[1]][1] = i+1

for item in ans:
  print("{:06}{:06}".format(item[0]+1,item[1]))

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
lis = [[] for i in range(n)]

query = []

for _ in range(m):
  tp = tuple(map(int,input().split()))
  query.append(tp)
  lis[tp[0]-1].append(tp[1])
  
for i in range(n):
  lis[i].sort()

for item in query:
  print("{:06}{:06}".format(item[0],lis[item[0]-1].index(item[1])+1))

Fixed submission:
n,m = map(int,input().split())
lis = [[] for i in range(n)]
query = []

for num in range(m):
  tp = tuple(map(int,input().split()))
  query.append(tp)
  lis[tp[0]-1].append((tp[1],num))  

ans = [[0,0] for i in range(m)]

for num_p , pref in enumerate(lis):
  pref.sort(key = lambda tp:tp[0])
  for i,tp_city in enumerate(pref):
    ans[tp_city[1]][0] = num_p
    ans[tp_city[1]][1] = i+1

for item in ans:
  print("{:06}{:06}".format(item[0]+1,item[1]))
Buggy python submission (verdict: Time Limit Exceeded):
numq = int(input())
lis = [1]*100001
lis[0] = 0
lis[1] = 0
i = 2
while(i < 318):
  if lis[i] == 1:
    k = 2
    while(i*k < 100001):
      lis[i*k] = 0
      k += 1
  i += 1
for _ in range(numq):
  count = 0
  a,b = map(int,input().split())
  for i in range(a,b+1):
    if i % 2 == 1 and lis[i] == lis[(i+1)//2] == 1:
      count += 1
  print(count)


Fixed submission:
numq = int(input())
lis = [1]*100001
lis[0] = 0
lis[1] = 0
i = 2
while(i < 318):
  if lis[i] == 1:
    k = 2
    while(i*k < 100001):
      lis[i*k] = 0
      k += 1
  i += 1
lis2 = [0]*100001

for i in range(1,100001):
  if i % 2 == 1 and lis[i] == lis[(i+1)//2] == 1:
    lis2[i] = lis2[i-1] + 1
  else:
    lis2[i] = lis2[i-1]

for _ in range(numq):
  a,b = map(int,input().split())
  print(lis2[b] - lis2[a-1])

Buggy python submission (verdict: Time Limit Exceeded):
numq = int(input())
lis = [1]*100001
lis[0] = 0
lis[1] = 0
i = 2
while(i < 318):
  if lis[i] == 1:
    k = 2
    while(i*k < 100001):
      lis[i*k] = 0
      k += 1
  i += 1
lis2 = [0]*100001

for i in range(1,100001):
  if i % 2 == 1 and lis[i] == lis[(i+1)//2] == 1:
    lis2[i] = 1

for _ in range(numq):
  a,b = map(int,input().split())
  print(sum(lis2[a:b+1]))


Fixed submission:
numq = int(input())
lis = [1]*100001
lis[0] = 0
lis[1] = 0
i = 2
while(i < 318):
  if lis[i] == 1:
    k = 2
    while(i*k < 100001):
      lis[i*k] = 0
      k += 1
  i += 1
lis2 = [0]*100001

for i in range(1,100001):
  if i % 2 == 1 and lis[i] == lis[(i+1)//2] == 1:
    lis2[i] = lis2[i-1] + 1
  else:
    lis2[i] = lis2[i-1]

for _ in range(numq):
  a,b = map(int,input().split())
  print(lis2[b] - lis2[a-1])

Buggy python submission (verdict: Time Limit Exceeded):
numq = int(input())
lis = [1]*100001
lis[0] = 0
lis[1] = 0
i = 2
while(i < 318):
  if lis[i] == 1:
    k = 2
    while(i*k < 100001):
      lis[i*k] = 0
      k += 1
  i += 1
lis2 = [0]*100001

for i in range(1,100001):
  if i % 2 == 1 and lis[i] == lis[(i+1)//2] == 1:
    lis2[i] = 1

for _ in range(numq):
  a,b = map(int,input().split())
  print(sum(lis2[a:b+1]))


Fixed submission:
numq = int(input())
lis = [1]*100001
lis[0] = 0
lis[1] = 0
i = 2
while(i < 318):
  if lis[i] == 1:
    k = 2
    while(i*k < 100001):
      lis[i*k] = 0
      k += 1
  i += 1
lis2 = [0]*100001

for i in range(1,100001):
  if i % 2 == 1 and lis[i] == lis[(i+1)//2] == 1:
    lis2[i] = lis2[i-1] + 1
  else:
    lis2[i] = lis2[i-1]

for _ in range(numq):
  a,b = map(int,input().split())
  print(lis2[b] - lis2[a-1])
Buggy python submission (verdict: Runtime Error):
N,A,B = list(map(int,input().split()))
s = 0
for i in range(1,N+1):
  lis = list(str(i))
  if A <= sum(lis) and sum(lis) <= B:
    s += i
print (s)
    

Fixed submission:
N,A,B = list(map(int,input().split()))
s = 0
for i in range(1,N+1):
  lis = list(map(int,list(str(i))))
  if A <= sum(lis) and sum(lis) <= B:
    s += i
print (s)
Buggy python submission (verdict: Runtime Error):
M = input()
lis =list(str(M))
count = 0
for item in lis:
  if item == ‘1’:
    count += 1
print (count)

Fixed submission:
lis = list(input())
count = 0
for item in lis:
    if item == "1":
        count += 1
print (count)

Buggy python submission (verdict: Runtime Error):
M = input()
lis =list(M)
count = 0
for item in lis:
  if item == ‘1’:
    count += 1
print (count)

Fixed submission:
lis = list(input())
count = 0
for item in lis:
    if item == "1":
        count += 1
print (count)
Buggy python submission (verdict: Runtime Error):
N = int(raw_input())
lis = [None]*86
lis[0] = 2
lis[1] = 1
for i in xrange(84):
	lis[i+2] = lis[i+1] + lis[i]
print lis[N]

Fixed submission:
N = int(raw_input())
lis = map(int, list(str(N)))
if lis[1] == lis[2] and (lis[0] == lis[1] or lis[2] == lis[3]) :
    print "Yes"
else:
  print "No"
Buggy python submission (verdict: Runtime Error):
N = int(raw_input())
lis = [None]*86
lis[0] = 2
lis[1] = 1
for i in xrange(84):
	lis[i+2] = lis[i-1] + lis[i]
print lis[N-1]

Fixed submission:
N = int(raw_input())
lis = [None]*87
lis[0] = 2
lis[1] = 1
for i in xrange(85):
	lis[i+2] = lis[i+1] + lis[i]
print lis[N]
Buggy python submission (verdict: Time Limit Exceeded):
import bisect

N = int(input())
s = sorted(list(map(int,input().split())))
m = sorted(list(map(int,input().split())))
l = sorted(list(map(int,input().split())))
count = 0
for sitem in s:
  for mitem in m[bisect.bisect_right(m,sitem):]:
    count += len(l)-bisect.bisect_right(l,mitem)

print (count)


Fixed submission:
import bisect

N = int(input())
s = sorted(list(map(int,input().split())))
m = sorted(list(map(int,input().split())))
l = sorted(list(map(int,input().split())))
count = 0
for mitem in m:
  count += bisect.bisect_left(s,mitem)*(N-bisect.bisect_right(l,mitem))
print (count)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
s = list(map(int,input().split()))
m = list(map(int,input().split()))
l = list(map(int,input().split()))
count = 0
for sitem in s:
  for mitem in m:
    for litem in l:
      if sitem < mitem and mitem < litem:
        count += 1
print (count)

Fixed submission:
import bisect

N = int(input())
s = sorted(list(map(int,input().split())))
m = sorted(list(map(int,input().split())))
l = sorted(list(map(int,input().split())))
count = 0
for mitem in m:
  count += bisect.bisect_left(s,mitem)*(N-bisect.bisect_right(l,mitem))
print (count)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(raw_input())
lis = []
for i in xrange(N):
	num = int(raw_input())
	for j in xrange(len(lis)):
		if lis[j] == num:
			lis.pop(j)
			break
		elif lis[j] > num:
			lis.insert(j,num)
			break
	else:
		lis.append(num)
print len(lis)

Fixed submission:
from collections import Counter
N = int(raw_input())
lis = []
for i in xrange(N):
	lis.append(int(raw_input()))
lis.sort()
lister = dict(Counter(lis)).items()
count = 0
for item in lister:
	if item[1] % 2 == 1:
		count += 1
print count

Buggy python submission (verdict: Time Limit Exceeded):
N = int(raw_input())
lis = []
for i in xrange(N):
	num = int(raw_input())
	if not lis:
		lis.append(num)
	else:
		for j in xrange(len(lis)):
			if lis[j] == num:
				lis.pop(j)
				break
			elif lis[j] > num:
				lis.insert(j,num)
				break
		else:
			lis.append(num)
print len(lis)

Fixed submission:
from collections import Counter
N = int(raw_input())
lis = []
for i in xrange(N):
	lis.append(int(raw_input()))
lis.sort()
lister = dict(Counter(lis)).items()
count = 0
for item in lister:
	if item[1] % 2 == 1:
		count += 1
print count

Buggy python submission (verdict: Time Limit Exceeded):
N = int(raw_input())
lis = []
for i in xrange(N):
	num = int(raw_input())
	try:
		lis.remove(num)
	except ValueError:
		lis.append(num)
print len(lis)

Fixed submission:
from collections import Counter
N = int(raw_input())
lis = []
for i in xrange(N):
	lis.append(int(raw_input()))
lis.sort()
lister = dict(Counter(lis)).items()
count = 0
for item in lister:
	if item[1] % 2 == 1:
		count += 1
print count

Buggy python submission (verdict: Time Limit Exceeded):
N = int(raw_input())
lis = []
count = 0
for i in xrange(N):
	num = int(raw_input())
	if num in lis:
		lis.remove(num)
		count -= 1
	else:
		lis.append(num)
		count += 1
print count

Fixed submission:
from collections import Counter
N = int(raw_input())
lis = []
for i in xrange(N):
	lis.append(int(raw_input()))
lis.sort()
lister = dict(Counter(lis)).items()
count = 0
for item in lister:
	if item[1] % 2 == 1:
		count += 1
print count

Buggy python submission (verdict: Time Limit Exceeded):
N = int(raw_input())
lis = []
for i in xrange(N):
	num = int(raw_input())
	if num in lis:
		lis.remove(num)
	else:
		lis.append(num)
print len(lis)

Fixed submission:
from collections import Counter
N = int(raw_input())
lis = []
for i in xrange(N):
	lis.append(int(raw_input()))
lis.sort()
lister = dict(Counter(lis)).items()
count = 0
for item in lister:
	if item[1] % 2 == 1:
		count += 1
print count
Buggy python submission (verdict: Runtime Error):
N=int(raw_input())
lis = []
for i in range(0,N):
	lis.append(int(raw_input()))
if sum(lis) % 0 == 0:
	print sum(lis)-min(lis)
else:
	print sum(lis)


Fixed submission:
a,b = map(int,raw_input().split())
if (a + b) < 10:
	print a+b
else:
	print "error"

Buggy python submission (verdict: Runtime Error):
S = raw_input()
lis = list(S)
for i in lis:
	mat = []
	if i in S
		print "no"
		break
	mat.add(i)
else:
	print "yes"

Fixed submission:
a,b = map(int,raw_input().split())
if (a + b) < 10:
	print a+b
else:
	print "error"
Buggy python submission (verdict: Runtime Error):
S = raw_input()
lis = list(S)
for i in lis:
	mat = []
	if i in S:
		print "no"
		break
	mat.append(i)
	else:
		print "yes"

Fixed submission:
S = raw_input()
lis = list(S)
mat = []
for i in lis:
	if i in mat:
		print "no"
		break
	mat.append(i)
else:
	print "yes"

Buggy python submission (verdict: Runtime Error):
S = raw_input()
lis = list(S)
for i in lis:
	mat = []
	if i in S
		print "no"
		break
	mat.append(i)
else:
	print "yes"

Fixed submission:
S = raw_input()
lis = list(S)
mat = []
for i in lis:
	if i in mat:
		print "no"
		break
	mat.append(i)
else:
	print "yes"

Buggy python submission (verdict: Runtime Error):
S = raw_input()
lis = list(S)
for i in lis:
	mat = []
	if i in S
		print "no"
		break
	mat.add(i)
else:
	print "yes"

Fixed submission:
S = raw_input()
lis = list(S)
mat = []
for i in lis:
	if i in mat:
		print "no"
		break
	mat.append(i)
else:
	print "yes"

Buggy python submission (verdict: Runtime Error):
S = raw_input()
mat = []
lis = list(S)
for i in lis:
	if i in S
		print "no"
		break
	mat.add(i)
else:
	print "yes"

Fixed submission:
S = raw_input()
lis = list(S)
mat = []
for i in lis:
	if i in mat:
		print "no"
		break
	mat.append(i)
else:
	print "yes"
Buggy python submission (verdict: Runtime Error):
N=int(raw_input())
lis = []
for i in range(0,N):
	num = int(raw_input())
	lis.append(num)
get = sum(lis)
if sum(lis) % 10 == 0:
	for j in range(0,N):
		lis.remove(min(lis))
		if min(lis) % 10 != 0:
			print get - min(lis)
	else:
		print 0
else:
	print get

Fixed submission:
N=int(raw_input())
lis = []
for i in range(0,N):
	num = int(raw_input())
	lis.append(num)
get = sum(lis)
if sum(lis) % 10 == 0:
	for j in range(0,N-1):
		if min(lis) % 10 != 0:
			print get - min(lis)
			break
		lis.remove(min(lis))
	else:
		print 0
else:
	print get

Buggy python submission (verdict: Runtime Error):
N=int(raw_input())
lis = []
for i in range(0,N):
	num = int(raw_input())
	lis.append(num)
get = sum(lis)
if sum(lis) % 10 == 0:
	for j in range(0,N)
		lis.remove(min(lis))
		if min(lis) % 10 != 0
			print get - min(lis)
else:
	print get

Fixed submission:
N=int(raw_input())
lis = []
for i in range(0,N):
	num = int(raw_input())
	lis.append(num)
get = sum(lis)
if sum(lis) % 10 == 0:
	for j in range(0,N-1):
		if min(lis) % 10 != 0:
			print get - min(lis)
			break
		lis.remove(min(lis))
	else:
		print 0
else:
	print get

Buggy python submission (verdict: Runtime Error):
N=int(raw_input())
lis = []
for i in range(0,N):
	num = int(raw_input())
	lis.append(num)
if sum(lis) % 10 == 0:
	if min(lis) % 10 != 0:
		print sum(lis)-min(lis)
	else:
		print sum(lis)-min(lis.remove(min(lis)))
else:
	print sum(lis)



Fixed submission:
N=int(raw_input())
lis = []
for i in range(0,N):
	num = int(raw_input())
	lis.append(num)
get = sum(lis)
if sum(lis) % 10 == 0:
	for j in range(0,N-1):
		if min(lis) % 10 != 0:
			print get - min(lis)
			break
		lis.remove(min(lis))
	else:
		print 0
else:
	print get

Buggy python submission (verdict: Runtime Error):
N=int(raw_input())
lis = []
for i in range(0,N):
	lis.append(int(raw_input()))
if sum(lis) % 0 == 0:
	print sum(lis)-min(lis)
else:
	print sum(lis)


Fixed submission:
N=int(raw_input())
lis = []
for i in range(0,N):
	num = int(raw_input())
	lis.append(num)
get = sum(lis)
if sum(lis) % 10 == 0:
	for j in range(0,N-1):
		if min(lis) % 10 != 0:
			print get - min(lis)
			break
		lis.remove(min(lis))
	else:
		print 0
else:
	print get

Buggy python submission (verdict: Runtime Error):
N=int(raw_input())
lis = []
for i in N:
	lis.append(int(raw_input()))
if sum(lis) % 0 == 0:
	print sum(lis)-min(lis)
else:
	print sum(lis)

Fixed submission:
N=int(raw_input())
lis = []
for i in range(0,N):
	num = int(raw_input())
	lis.append(num)
get = sum(lis)
if sum(lis) % 10 == 0:
	for j in range(0,N-1):
		if min(lis) % 10 != 0:
			print get - min(lis)
			break
		lis.remove(min(lis))
	else:
		print 0
else:
	print get
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=input().split()
l0=[]
sums=[1 for i in range(30)]
for i in range(n):
  newl=[]
  k=int(a[i])
  for j in range(30):
    if k%2==0:
      newl.append(0)
      k/=2
    else:
      newl.append(1)
      sums[j]*=-1
      k=(k-1)/2
  l0.append(newl)
      
for i in range(n):
  ans=0
  for j in range(30):
    if sums[j]==1:
      if l0[i][j]==1:
        ans+=2**j
    else:
      if l0[i][j]==0:
        ans+=2**j
  print(ans,end=" ")
print("")

Fixed submission:
n=int(input())
a=input().split()
nl=[]
jo=0
for i in range(n):
  nl.append(int(a[i]))
  jo=jo^int(a[i])

for i in range(n):
  ans=nl[i]^jo
  print(ans,end=" ")
print("")
Buggy python submission (verdict: Runtime Error):
b0=input().split()
book=int(b0[0])
pro=int(b0[1])
norma=int(b0[2])

bl=[]
for x in range(book):
  bl.append([int(y) for y in input().split()])
  
def find(n,exl):
  if n==book:
    if min(exl)<norma:
      return -1
    else:
      return 0
  else:
    if min(exl)>=norma:
      return 0
    else:
      newexl=[]
      for i in range(pro):
        newexl.append(exl[i]+bl[n][i+1])
      if min(newexl)>=norma:
        f0=bl[n][0]
      else:
        re=find(n+1,newexl)
        if re==-1:
          f0=-1
        else:
          f0=re+bl[n][0]
      re2=find(n+1,exl)
      if re2==-1:
        f1=-1
      else:
        f1=re2
      if f0==-1 and f1==-1:
        return -1
      elif f0==-1 or f1==-1:
        return max(f0,f1)
      else:
        return min(f0,f1)
      
print(find(0,[0 for i in range(book)]))

Fixed submission:
b0=input().split()
book=int(b0[0])
pro=int(b0[1])
norma=int(b0[2])

bl=[]
for x in range(book):
  bl.append([int(y) for y in input().split()])
  
mn=-1
for x in range(2**book):
  if book>9:
    k=str(book)+"b"
  else:
    k="0"+str(book)+"b"
  x2=format(x, k)
  m=0
  exl=[0 for i in range(pro)]
  for y in range(book):
    if x2[y]=="1":
      m+=bl[y][0]
      for j in range(pro):
        exl[j]+=bl[y][j+1]
  if min(exl)>=norma and (mn==-1 or mn>m):
    mn=m

print(mn)
Buggy python submission (verdict: Time Limit Exceeded):
import math

bl=input().split()
A=int(bl[0])
B=int(bl[1])
C=int(bl[2])
m=0
for x in range(C+1):
  y=math.floor(A*x/B)-A*math.floor(x/B)
  if y>m:
    m=y
print(m)

Fixed submission:
import math

bl=input().split()
A=int(bl[0])
B=int(bl[1])
C=int(bl[2])

if C<B:
  m=math.floor(A*C/B)-A*math.floor(C/B)
else:
  m=math.floor(A*(B-1)/B)

print(m)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
slist=[]
var=0
for a in range(n):
  s=input()
  if not s in slist:
    var+=1
    slist.append(s)
print(var)

Fixed submission:
n=int(input())
slist=[]
var=0
for a in range(n):
  s=input()
  slist.append(s)
sset=set(slist)
print(len(sset))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
k=int(input())
count=0
for i in range(1,n+1):
    if len(str(i).replace('0','')) == k:
        count += 1
print(count)

Fixed submission:
N = list(map(int, list(input())))
L = len(N)
K = int(input())
 
dp = [[[0] * (K+1) for j in range(2)] for i in range(L+1)]
dp[0][0][0] = 1
 
for i in range(L):
    ni = N[i]
    if ni == 0:
        for j in range(K):
            dp[i+1][1][j+1] += dp[i][1][j] * 9
        for j in range(K+1):
            dp[i+1][0][j] += dp[i][0][j]
    else:
        for j in range(K+1):
            dp[i+1][1][j] += dp[i][0][j]
        for j in range(K):
            dp[i+1][1][j+1] += (dp[i][0][j] * (ni-1) + dp[i][1][j] * 9)
            dp[i+1][0][j+1] += dp[i][0][j]
 
    for j in range(K+1):
        dp[i+1][1][j] += dp[i][1][j]
 
print(dp[L][0][K]+dp[L][1][K])
Buggy python submission (verdict: Runtime Error):
a=input()
b=input()
c=input()

print('bust'if a+b+c>=22 else 'win')

Fixed submission:
a=input()
lst = [int(e) for e in a.split(' ')]

print('bust'if sum(lst)>=22 else 'win')

Buggy python submission (verdict: Runtime Error):
return 'bust' if a+b+c>=22 else 'win'

Fixed submission:
a=input()
lst = [int(e) for e in a.split(' ')]

print('bust'if sum(lst)>=22 else 'win')
Buggy python submission (verdict: Runtime Error):
import numpy as np
s = np.array([ord(c) for c in input()])
t = np.array([ord(c) for c in input()])
print(np.count_nonzero(s - t))

Fixed submission:
import numpy as np
s = np.array([ord(c) for c in input()])
t = np.array([ord(c) for c in input()])
print(np.count_nonzero(s - t))