Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

H, W, K = map(int,input().split())

mod = 1000000007

fibonacci = [1,1,2,3,5,8,13,21] # W <= 8なのでこれだけでいい

Amida = [ [0] * W for h in range(H+1)]

for h in range(H+1):
	if W == 1:
		break
	for w in range(W):
		if h == 0:
			if w == 0:
				Amida[h][w] = 1
			else:
				break
		elif w == 0:
			Amida[h][w] = fibonacci[W-2] * Amida[h-1][w+1] + fibonacci[W-1] * Amida[h-1][w]
		elif w == W-1:
			Amida[h][w] = fibonacci[W-2] * Amida[h-1][w-1] + fibonacci[W-1] * Amida[h-1][w]
		else:
			Amida[h][w] += (fibonacci[w-1] * fibonacci[W-w-1] * Amida[h-1][w-1])
			Amida[h][w] += (fibonacci[w] * fibonacci[W-w-1] * Amida[h-1][w])
			Amida[h][w] += fibonacci[w] * fibonacci[W-w-2] * Amida[h-1][w+1]

Amida[h][w] = Amida[h][w] % mod

if W == 1:
	if K == 1:
		print(1)
	else:
		print(0)
else:
	print(Amida[H][K-1])

Fixed submission:
# -*- coding: utf-8 -*-

H, W, K = map(int,input().split())

mod = 1000000007

fibonacci = [1,1,2,3,5,8,13,21] # W <= 8なのでこれだけでいい

Amida = [ [0] * W for h in range(H+1)]

for h in range(H+1):
	if W == 1:
		break
	for w in range(W):
		if h == 0:
			if w == 0:
				Amida[h][w] = 1
			else:
				break
		elif w == 0:
			Amida[h][w] = fibonacci[W-2] * Amida[h-1][w+1] + fibonacci[W-1] * Amida[h-1][w]
		elif w == W-1:
			Amida[h][w] = fibonacci[W-2] * Amida[h-1][w-1] + fibonacci[W-1] * Amida[h-1][w]
		else:
			Amida[h][w] += (fibonacci[w-1] * fibonacci[W-w-1] * Amida[h-1][w-1])
			Amida[h][w] += (fibonacci[w] * fibonacci[W-w-1] * Amida[h-1][w])
			Amida[h][w] += fibonacci[w] * fibonacci[W-w-2] * Amida[h-1][w+1]

		Amida[h][w] = Amida[h][w] % mod

if W == 1:
	if K == 1:
		print(1)
	else:
		print(0)
else:
	print(Amida[H][K-1])
Buggy python submission (verdict: Runtime Error):
N = int(input())

if N == 1:
	print('Hello World')
else:
	for i in range(2):
		A = int(input())
		B = int(input())
		print(A+B)

Fixed submission:
N = int(input())

if N == 1:
	print('Hello World')
else:
	A = int(input())
	B = int(input())
	print(A+B)
Buggy python submission (verdict: Runtime Error):
N = int(input())

N_list = []
M_list = []
answer = -100

for i in range(N):
	s = input()
	N_list.append(s)

N = int(input())

for i in range(M):
	t = input()
	M_list.append(s)

for i in range(N):
	S = N_list[i]
	plus  = N_list.count(S)
	minus = M_list.count(S)
	if answer < (plus - minus):
		answer = (plus - minus)

print(answer)

Fixed submission:
N = int(input())

N_list = []
M_list = []
answer = 0

for i in range(N):
	s = input()
	N_list.append(s)

M = int(input())

for i in range(M):
	t = input()
	M_list.append(t)

for i in range(N):
	S = N_list[i]
	plus  = N_list.count(S)
	minus = M_list.count(S)
	if answer < (plus - minus):
		answer = (plus - minus)

print(answer)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

a_dict = {}

for i in range(1, N+1):
	a_dict[i] = int(input())

answer = 0
now_point = 1
check_list = [1]

for i in range(N):
	now_point = a_dict[now_point]
	answer += 1
	if now_point == 2:
		break

	if now_point in check_list:
		answer = -1
		break
	check_list.append(now_point)

print(answer)

Fixed submission:
N = int(input())

a_dict = {}

for i in range(1, N+1):
	a_dict[i] = int(input())

answer = 0
now_point = 1

for i in range(N):
	now_point = a_dict[now_point]
	answer += 1
	if now_point == 2:
		print(answer)
		break

if now_point != 2:
	print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())

if abs(N - M) > 1:
	print(0)

elif N == M:
	answer = 2
	for i in range(1, N+1):
		answer = answer * i * i

	answer = answer % (1000000000 + 7)
	print (answer)

elif N > M:
	answer = 1
	j = 1
	for i in range(2, N+1):
		answer = answer * i * j
		j = i

	answer = answer % (1000000000 + 7)
	print(answer)

else:
	answer = 1
	j = 1
	for i in range(2, M+1):
		answer = answer * i * j
		j = i

	answer = answer % (1000000000 + 7)
	print(answer)

Fixed submission:
N, M = [int(_) for _ in input().split()]
mod = 10**9+7

if N < M:
    N, M = M, N

if N == M:
	answer = 2
	for i in range(2, N+1):
		answer = answer * i * i
		answer = answer % mod
	print (answer)

elif N == M+1:
	answer = 1
	for i in range(2, N):
		answer = answer * i * i
		answer = answer % mod
	answer = answer * N % mod
	print(answer)

else:
	print(0)
Buggy python submission (verdict: Runtime Error):
X,Y  = input().split()
X = int(X)
Y = int(Y)
if (X+Y)%3 != 0:
    print(0)
else:
    n = (2*X-Y)/3
    m = (2*Y-X)/3
    top = 1
    bot = 1
    n = int(n)
    m = int(m)
    for i in range(n):
        top *= (n + m) - i
        bot *= n - i

result = (top/bot) % ((10**9)+7)
result = int(result)
print(result)


Fixed submission:
r = int(input())

print(r**2)

Buggy python submission (verdict: Runtime Error):
X,Y  = input().split()
X = int(X)
Y = int(Y)
if (X+Y)%3 != 0:
    print(0)
else:
    n = (2*X-Y)/3
    m = (2*Y-X)/3
    top = 1
    bot = 1
    n = int(n)
    m = int(m)
    for i in range(n):
        top *= (n + m) - i
        bot *= n - i

result = (top/bot) % ((10**9)+7)

print(result)


Fixed submission:
r = int(input())

print(r**2)

Buggy python submission (verdict: Runtime Error):
N = input()
S = input()

def main(N,S):
    N = int(N)
    if N%2 == 1:
        print('No')
    else:
        l=int(N/2)

        S1 = S[:l]
        S2 = S[l:]

        if S1 == S2:
            print('Yes')
        else:
            print('No')


main(N,S)


Fixed submission:
r = int(input())

print(r**2)

Buggy python submission (verdict: Runtime Error):
N = input()
S = input()

def main(N,S):
    N = int(N)
    if N%2 == 1:
        print('No')
    else:
        l=int(N/2)

        S1 = S[:l]
        S2 = S[l:]

        if S1 == S2:
            print('Yes')
        else:
            print('No')

main(N,S)

Fixed submission:
r = int(input())

print(r**2)

Buggy python submission (verdict: Runtime Error):
r = int(input())

print r**2

Fixed submission:
r = int(input())

print(r**2)
Buggy python submission (verdict: Runtime Error):
A,B,T = map(int,input().split)

def main(A,B,T):
    time = A
    sum = 0
    while time <= T+0.5:
        if time%A == 0:
            sum += B
            time += 1
    print(sum)
    return 0


Fixed submission:
import math
A,B,T = map(int,input().split())

def main(A,B,T):
    sum = B*(math.floor(T/A))
    print(sum)
    return 0

main(A,B,T)
Buggy python submission (verdict: Runtime Error):
#Coding:Utf-8
N=int(input())
print(f'{2/N:.10f}')


Fixed submission:
#Coding:Utf-8
N=int(input())
if N%2==0:
    print('{:.10f}'.format(N/2/N))
elif N%2==1:
    print('{:.10f}'.format((int(N/2)+1)/N))
Buggy python submission (verdict: Time Limit Exceeded):
#Coding:Utf-8
import sys
input=sys.stdin.readline

N=int(input())
A=list(map(int,input().split()))
ans=[]

for i in range(N):
    print((A.index(i+1))+1,end=" ")
print("")


Fixed submission:
#Coding:Utf-8
import sys
input=sys.stdin.readline

N=int(input())
A=list(map(int,input().split()))
ans=[0 for i in range(N)]

for i in range(N):
    ans[(A[i]-1)]=i+1

for l in range(N):
    print(ans[l],end=" ")

print("")
Buggy python submission (verdict: Time Limit Exceeded):
#Coding:Utf-8

N=int(input())
s=[list(input()) for i in range(N)]
total=num=0
for l in range(N):
    s[l].sort()
s.sort()
while len(s)!=0:
    num=s[1:N].count(s[0])
    for m in range(1,num+1):
        total+=m
        s.remove(s[0])
    s.remove(s[0])

print(total)


Fixed submission:
#Coding:Utf-8

N=int(input())
s=[list(input()) for i in range(N)]
total=num=0
dic={}
for l in range(N):
    s[l].sort()
    if dic.get(str(s[l]))==None:
        dic[str(s[l])]=0
    else:
        dic[str(s[l])]+=1
        total+=int(dic[str(s[l])])
print(total)

Buggy python submission (verdict: Time Limit Exceeded):
#Coding:Utf-8

N=int(input())
s=[list(input()) for i in range(N)]
total=num=0
for l in range(N):
    s[l].sort()
s.sort()
for m in range(N):
    if m==0:
        dupl=s[m+1:N+1].count(s[m])
        for o in range(1,dupl+1):
            total+=o
        num+=dupl+1
    elif num!=N:
        dupl=s[num+1:N+1].count(s[num])
        for o in range(1,dupl+1):
            total+=o
        num+=dupl+1
    else:
        break

print(total)

Fixed submission:
#Coding:Utf-8

N=int(input())
s=[list(input()) for i in range(N)]
total=num=0
dic={}
for l in range(N):
    s[l].sort()
    if dic.get(str(s[l]))==None:
        dic[str(s[l])]=0
    else:
        dic[str(s[l])]+=1
        total+=int(dic[str(s[l])])
print(total)

Buggy python submission (verdict: Time Limit Exceeded):
#Coding:Utf-8

N=int(input())
s=[list(input()) for i in range(N)]
total=0
for l in range(N):
    s[l].sort()
for m in range(N):
    total+=s[m+1:N+1].count(s[m])

print(total)

Fixed submission:
#Coding:Utf-8

N=int(input())
s=[list(input()) for i in range(N)]
total=num=0
dic={}
for l in range(N):
    s[l].sort()
    if dic.get(str(s[l]))==None:
        dic[str(s[l])]=0
    else:
        dic[str(s[l])]+=1
        total+=int(dic[str(s[l])])
print(total)
Buggy python submission (verdict: Runtime Error):
#Coding:Utf-8
import sys
input=sys.stdin.readline

N=int(input())
A=list(map(int,input().split()))
ans=[0 for i in range(N)]

for i in range(N):
    ans[(A[i]-1)]=i+1

for l in range(N):
    print(ans[l],end=" ")

print("")


Fixed submission:
#Coding:Utf-8

N=int(input())
A=[int(input()) for i in range(N)]
B=sorted(A,reverse=True)

for l in range(N):
    if A[l]!=B[0]:
        print(B[0])
    else:
        print(B[1])
Buggy python submission (verdict: Runtime Error):
#Coding:Utf-8
N=int(input())
A=list(map(int,input().split()))
Box=[0 for i in range(N)]
BoxNum=[]

for l in reversed(range(N)):
    Incount=0
    for m in range(1,int(N/(l+1))):
        Incount+=Box[A[l]*m]
    if Incount%2!=A[l]:
        Box[A[l]]+=1
        BoxNum.append(l+1)

print(len(BoxNum))
if len(BoxNum)!=0:
    print(" ".join(map(str,BoxNum)))


Fixed submission:
#Coding:Utf-8

N=int(input())
a=list(map(int,input().split()))

check=[0 for i in range(N)]
M=0
b=[]
for j in reversed(range(1,N+1)):
    total=0
    for k in range(1,int(N/j)+1):
        total+=check[int(j*k)-1]
    if a[j-1]!=total%2:
        M+=1
        check[j-1]=1
        b.append(j)

print(M)
for l in range(len(b)):
    print(b[l],end=' ')
else:
    print()
Buggy python submission (verdict: Runtime Error):
# Coding: Utf-8

N=in(input())
a=list(map(int, input().split()))
count=0
zero=0
total=0

for i in range(N):
  if a[i]<0:
    count+=count
    total=toal+abs(a[1])
  if a[1]<0:
    zero+=zero
    
if count%2==0 or zero>0:
  print(total)
else:
  print(total-np.abs(a))
  


Fixed submission:
#Conding: Utf-8

N= int(input())
a=list(map(int, input().split()))

count=num=total=0
b=[]

for i in a:
    if i<0:
        count+=1
    elif i==0:
        num+=1

if count%2==0 or num>0:
    for j in a:
        total=total+abs(j)
    print(total)
else:
    for k in a:
        total=total+abs(k)
    for l in a:
        b.append(abs(l))

    print(total-2*min(b))
Buggy python submission (verdict: Runtime Error):
#Coding: utf-8
N=int(input())
a=[]
for i in 5:
  a.append(int(input()))
import math
print(math.ceil(N/min(a))-4)



Fixed submission:
#Coding: utf-8
N=int(input())
a=[]
for i in range(5):
  a.append(int(input()))
import math
print(math.ceil(N/min(a))+4)

Buggy python submission (verdict: Runtime Error):
#Coding: utf-8
2.N=int(input())
3.a=[]
4.for i in 5:
5.  a.append(int(input()))
6.import math
7.print(math.ceil(N/min(a))-4)


Fixed submission:
#Coding: utf-8
N=int(input())
a=[]
for i in range(5):
  a.append(int(input()))
import math
print(math.ceil(N/min(a))+4)

Buggy python submission (verdict: Runtime Error):
#Coding: utf-8
N=in(input())
a=[]
for i in 5:
  a.append(int(input()))
import math
print(math.ceil(N/min(a))-4)

Fixed submission:
#Coding: utf-8
N=int(input())
a=[]
for i in range(5):
  a.append(int(input()))
import math
print(math.ceil(N/min(a))+4)
Buggy python submission (verdict: Time Limit Exceeded):
#Coding:Utf-8

N,Q=input().split()
S=list(map(str,input()))
b=[]
c=[]
for i in range(int(Q)):
  a=list(map(int, input().split()))
  b.extend((a))
for j in range(0,int(Q)*2,2):
  count=0
  for l in range(b[j],b[j+1]):
    if S[l-1]=="A" and S[l]=="C":
      count+=1
  else:
    print(count)

Fixed submission:
#Coding:Utf-8

N,Q=input().split()
S=input()
S= S.replace("AC","Ac")


def judge(x):
  if x=="c":
    return 1
  else:
    return 0


t=[]
t.append(0)

for i in range(1,int(N)):
  t.append(t[i-1]+judge(S[i]))

for j in range(int(Q)):
  a,b=list(map(int, input().split()))
  print(t[b-1]-t[a-1])
Buggy python submission (verdict: Time Limit Exceeded):
#!python3

def resolve():
    N = int(input())
    A = tuple(map(int, input().rstrip().split()))

    a = 0
    for i in range(N-1):
        for j in range(i+1, N):
            a += A[i] ^ A[j]
    print(a % (10**9+7))

if __name__ == "__main__":
    resolve()


Fixed submission:
#!python3

def resolve():
    N = int(input())
    A = tuple(map(int, input().rstrip().split()))

    ma = max(*A)

    i = 1
    asum = 0
    while i < ma:
        cc = 0
        for x in A:
            if x & i: cc += 1
        asum += i * (N - cc) * cc
        i <<= 1

    print(asum % (10**9+7))

if __name__ == "__main__":
    resolve()
Buggy python submission (verdict: Runtime Error):
s = input()
count = 0

for i in range(len(s)//2):
  if s[i] != s[-1]:
    count += 1
    
return count

Fixed submission:
s = input()
count = 0

for i in range(len(s)//2):
  if s[i] != s[-1-i]:
    count += 1
    
print(count)
Buggy python submission (verdict: Runtime Error):
import itertools

n = input()
array = []
for i in range(n):
  t = input()
  array.append(set())
  for j in range(t):
    tmp = list(map(int, input().split(" ")))
    if tmp[1] == 1:
      array[i].add(tmp[0])
      
allcombs = list(itertools.product([0, 1], repeat=n))
max_val = 0
for comb in allcombs:
  
  if sum(comb) <= max_val:
    continue
  
  for i, j in enumerate(comb):
    broke = False
    if j == 1:
      for k in array[i]:
        if comb[k] == 0:
          broke = True
          break
    if broke:
      break
  if not broke:
    max_val = max(max_val, sum(comb))
   
        
        
print(max_val)

Fixed submission:
import itertools

n = int(input())
array = []
for i in range(n):
    t = int(input())
    array.append([])
    for j in range(t):
        tmp = list(map(int, input().split(" ")))
        array[i].append(tmp)

allcombs = list(itertools.product([0, 1], repeat=n))
max_val = 0
for comb in allcombs:

    if sum(comb) <= max_val:
        continue

    tmp = []
    for i, j in enumerate(comb):
        if j == 1:
            tmp += array[i]
            
    if all([comb[t[0]-1]==t[1] for t in tmp]):
        max_val = max(max_val, sum(comb))

print(max_val)
Buggy python submission (verdict: Runtime Error):
N = int(input())
for i in range(1,10):
  for j in range(1,10):
    if i * j == N:
      print("Yes")
print("No")

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

Buggy python submission (verdict: Runtime Error):
a.b=map(int,input().split())
if a > 9 or b > 9:
  print(-1)
else:
  print(a*b)

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

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

Fixed submission:
n=int(input())
print(n**3)
Buggy python submission (verdict: Runtime Error):
S=input()
T=input()
ans=0
for i in range(3):
	if S[i] == T[i]:
  	ans += 1
    print(ans)

Fixed submission:
a = input()
b = input()
c = 0
for i in range(3):
  if a[i] == b[i]:
    c += 1
print(c)

Buggy python submission (verdict: Runtime Error):
S=input()
T=input()
ans=0
for i in range(3):
	if S[i] == T[i]:
  	ans += 1
print(ans)

Fixed submission:
a = input()
b = input()
c = 0
for i in range(3):
  if a[i] == b[i]:
    c += 1
print(c)

Buggy python submission (verdict: Runtime Error):
S=input()
T=input()
ans=0
for i in range(3):
	if S[i] == T[i]:
  	ans += 1
    print(ans)

Fixed submission:
a = input()
b = input()
c = 0
for i in range(3):
  if a[i] == b[i]:
    c += 1
print(c)

Buggy python submission (verdict: Runtime Error):
S=input()
T=input()
ans=0
for i in range(3)
	if S[i] == T[i]
  	ans += 1
    print(ans)

Fixed submission:
a = input()
b = input()
c = 0
for i in range(3):
  if a[i] == b[i]:
    c += 1
print(c)
Buggy python submission (verdict: Runtime Error):
a=input()
s=input()
if a >= 3200:
  print(s)
else:
  print("red")

Fixed submission:
a=int(input())
s=str(input())
if a >= 3200:
  print(s)
else:
  print("red")
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
c=a+b
d=a-b
e=a*b
print(max(c,d,e)

Fixed submission:
a,b=map(int,input().split())
print(max(a+b,a-b,a*b))

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
print(max(a+b,a-b,a*b)

Fixed submission:
a,b=map(int,input().split())
print(max(a+b,a-b,a*b))
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input())
print(max(0,c-(a-b)))

Fixed submission:
a,b,c=map(int,input().split())
print(max(0,c-(a-b)))

Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input())
print(max(0,c-(a-b))

Fixed submission:
a,b,c=map(int,input().split())
print(max(0,c-(a-b)))
Buggy python submission (verdict: Runtime Error):
p,q,r = map(int(input().split()))
print(min(p+q,p+r,q+r))

Fixed submission:
p,q,r = map(int,input().split())
print(min(p+q, q+r, r+p))

Buggy python submission (verdict: Runtime Error):
p,q,r = map(int(input().split()))
print(min(p+q,p+r,q+r)

Fixed submission:
p,q,r = map(int,input().split())
print(min(p+q, q+r, r+p))

Buggy python submission (verdict: Runtime Error):
p,q,r = map(int(input().split()))
print(min((p+q),(p+r),(q+r)))

Fixed submission:
p,q,r = map(int,input().split())
print(min(p+q, q+r, r+p))
Buggy python submission (verdict: Runtime Error):
T=int(input())
X=int(input())
print(T/X)

Fixed submission:
t,x=map(int,input().split())
print(t/x)
Buggy python submission (verdict: Runtime Error):
a,b,c=int(input())
print("Yes" if (a+b) > c "No" else)

Fixed submission:
a,b,c=map(int,input().split())
print("Yes" if a+b >= c else "No")
Buggy python submission (verdict: Runtime Error):
x,a,b=map(int,input().split())
print((x-a)%b)

Fixed submission:
x,a,b=[int(input()) for _ in range(3)]
print((x-a)%b)
Buggy python submission (verdict: Runtime Error):
S=int(input())
print(2018+S[4::])

Fixed submission:
s=input()
print("2018"+s[4:])
Buggy python submission (verdict: Runtime Error):
N,A=map(int,input().split())
print((N*N)-A)

Fixed submission:
N=int(input())
A=int(input())
print((N*N)-A)
Buggy python submission (verdict: Runtime Error):
a,b,c=input()
print("Yes" if a==c else No)

Fixed submission:
a,b,c=input()
print("Yes" if a==c else "No")

Buggy python submission (verdict: Runtime Error):
a,b,c=input()
print("Yes" if a==2 else No)

Fixed submission:
a,b,c=input()
print("Yes" if a==c else "No")
Buggy python submission (verdict: Runtime Error):
A=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: Runtime Error):
A=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: Runtime Error):
a,b,c = int(input().split(" "))
if a + b + c == 22:
  print("bust")

Fixed submission:
A1, A2, A3 = map(int, input().split())

if sum([A1, A2, A3]) >= 22:
  print('bust')
else:
  print('win')

Buggy python submission (verdict: Runtime Error):
#D - Xor Sum 4

import math
n=int(input())
al=list(map(int,input().split()))
a=['{:060b}'.format(x) for x in al]
a=''.join(a)
 
m=math.ceil(math.log(max(1,max(al)),2))
 
ans=0
for i in range(m):
  sum1=a[59-i::60].count('1')
  sum0=n-sum1
  ans+=2**i*sum1*sum0
 
print(ans%(10**9+7))

Fixed submission:
#A-Blackjack
a1, a2, a3 = map(int, input().split())
total = a1 + a2 + a3

if total >=22:
    print('bust')
else:
    print('win')

Buggy python submission (verdict: Runtime Error):
x, a, b = input().split()
x = int(x)
a = int(a)
b = int(b)

if a + b + c <22:
  print("win")
else:
  print("bust")

Fixed submission:
a, b, c = input().split()
a = int(a)
b = int(b)
c = int(c)
if a + b + c < 22:
	print("win")
else:
	print("bust")
Buggy python submission (verdict: Runtime Error):
waitTime = []
_time = 0
for i in range(0,5):
    t, mod = divmod(int(input()), 10)
    _time += (t * 10)
    if mod != 0:
        waitTime.append(mod)
waitTime = sorted(waitTime, reverse= True)
_time += (len(waitTime) - 1) * 10
_time += min(waitTime)
print(_time)


Fixed submission:
waitTime = []
_time = 0
for i in range(0,5):
    t, mod = divmod(int(input()), 10)
    _time += (t * 10)
    if mod != 0:
        waitTime.append(mod)
if len(waitTime) > 0:
    waitTime = sorted(waitTime, reverse= True)
    _time += (len(waitTime) - 1) * 10
    _time += min(waitTime)
print(_time)
Buggy python submission (verdict: Runtime Error):
import datetime

base_date = datetime.date(2019, 4, 30)
y, m, d = map(int, input().split('/'))
if (base_date < datetime.date(y, m, d)):
    return ("TBD")
else:
    return ("Heisei")

Fixed submission:
print('Heisei' if input()<'2019/05/01' else 'TBD')

Buggy python submission (verdict: Runtime Error):
import datetime

y, m, d = map(int, input().split('/'))
y, m, d = map(int, dam.split('/'))
if (base_date < datetime.date(y, m, d)):
    return ("TBD")
else:
    return ("Heisei")

Fixed submission:
print('Heisei' if input()<'2019/05/01' else 'TBD')
Buggy python submission (verdict: Runtime Error):
num = int(input())
num_ls = sorted([x for x in map(int, input().split(' '))])
while True:
    dam = []
    searchMin = [ x for x in num_ls if x != 1 ]
    for x in num_ls:
        div = x % min(searchMin)
        if div == 0:
            dam.append(x)
        else:
            dam.append(div)

    if num_ls == dam:
        break
    else:
        num_ls = dam

print(min(num_ls))

Fixed submission:
x, y = map(int, input().split(' '))
if y % x == 0:
    print(x+y)
else:
    print(y-x)
Buggy python submission (verdict: Time Limit Exceeded):
numbers = input()
position = int(input())
roop = True
while roop:
    new_number = ""
    if len(numbers) > position:
        numbers = numbers[:position]
    while len(new_number) < position:
        for num in numbers:
                new_number += num * int(num)
    if (numbers != new_number[:position]):
        numbers = new_number[:position]
    else:
        roop = False
print(numbers[position - 1: position])

Fixed submission:
numbers = input()
position = int(input())
answer = "1"
for num in numbers[:position]:
    if num != "1":
        answer = num
        break
print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
numbers = input()
position = int(input())
roop = True
while roop:
    new_number = ""
    if len(numbers) > position:
        numbers = numbers[:position]
    while len(new_number) < position:
        for num in numbers:
            for i in range(1, 10):
                if num == str(i):
                    new_number += str(i) * i
        if (numbers != new_number[:position]):
            numbers = new_number[:position]
        else:
            roop = False
print(numbers[position - 1: position])

Fixed submission:
numbers = input()
position = int(input())
answer = "1"
for num in numbers[:position]:
    if num != "1":
        answer = num
        break
print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
numbers = input()
position = int(input())
roop = True
while roop:
    new_number = ""
    if len(numbers) > position:
        numbers = numbers[:position]
    for num in numbers:
        for i in range(1, 10):
            if num == str(i):
                new_number += str(i) * i
    if (numbers != new_number[:position]):
        numbers = new_number[:position]
    else:
        roop = False
print(numbers[position - 1: position])


Fixed submission:
numbers = input()
position = int(input())
answer = "1"
for num in numbers[:position]:
    if num != "1":
        answer = num
        break
print(answer)