Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N,W=map(int,input().split())
A = [list(map(int, input().split())) for i in range(N)]



max_sum = sum([i[1] for i in A])

max_value=1000001
dp = [[max_value for i in range(max_sum+1) ] for j in range(N+1)]
dp[0][0]=0

for i in range(N):
    for v in range(max_sum+1):
        if v>=A[i][1]:
            dp[i+1][v] = min([dp[i][v-A[i][1]]+A[i][0], dp[i][v]])

        else:
            dp[i+1][v] = dp[i][v]

#ここでindexは価値と同値、複数あることを考慮して反転後indexで最も価値のある個所を取得
print(max_sum-dp[N][::-1].index(W))
#     print(int(dp[N][W]))

Fixed submission:
N,W=map(int,input().split())
A = [list(map(int, input().split())) for i in range(N)]



max_sum = sum([i[1] for i in A])

max_value=10**10
dp = [[max_value for i in range(max_sum+1) ] for j in range(N+1)]
dp[0][0]=0

for i in range(N):
    for v in range(max_sum+1):
        if v>=A[i][1]:
            dp[i+1][v] = min([dp[i][v-A[i][1]]+A[i][0], dp[i][v]])

        else:
            dp[i+1][v] = dp[i][v]

#ここでindexは価値と同値、複数あることを考慮して反転後indexで最も価値のある個所を取得
# try:
#     print(max_sum-dp[N][::-1].index(W))
# except:
#     print(max_sum-dp[N][::-1].index(W))
for i,w in enumerate(dp[N][::-1]):
    if w <=W:
        print(max_sum-i)
        break
#     print(int(dp[N][W]))

Buggy python submission (verdict: Time Limit Exceeded):
N,W=map(int,input().split())
A = [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 w in range(W+1):
        if w>=A[i][0]:
            dp[i+1][w] = max([dp[i][w-A[i][0]]+A[i][1], dp[i][w]])
        else:
            dp[i+1][w] = dp[i][w]
        
print(int(dp[N][W]))

Fixed submission:
N,W=map(int,input().split())
A = [list(map(int, input().split())) for i in range(N)]



max_sum = sum([i[1] for i in A])

max_value=10**10
dp = [[max_value for i in range(max_sum+1) ] for j in range(N+1)]
dp[0][0]=0

for i in range(N):
    for v in range(max_sum+1):
        if v>=A[i][1]:
            dp[i+1][v] = min([dp[i][v-A[i][1]]+A[i][0], dp[i][v]])

        else:
            dp[i+1][v] = dp[i][v]

#ここでindexは価値と同値、複数あることを考慮して反転後indexで最も価値のある個所を取得
# try:
#     print(max_sum-dp[N][::-1].index(W))
# except:
#     print(max_sum-dp[N][::-1].index(W))
for i,w in enumerate(dp[N][::-1]):
    if w <=W:
        print(max_sum-i)
        break
#     print(int(dp[N][W]))
Buggy python submission (verdict: Runtime Error):
def two_int():
    N, K = map(int, input().split())
    return N,K

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))

H,W = two_int()

maps = [list(input()) for i in range(H)]

import copy 
temp_maps = copy.deepcopy(maps)

#start調査
def solve(W,H,maps):
    start_X=0
    start_Y=0
    for x in range(W):
        for y in range(H):
            count=0

            if maps[y][x]=="#":
                count += 1

                if x+1 < W:
                    if maps[y][x+1]=="#":
                        count += 1     

                if y+1 < H:
                    if maps[y+1][x]=="#":
                        count += 1     

                if now_x-1 >= 0:
                    if maps[y][x-1]=="#":
                        count += 1     


                if y-1 >= 0:
                    if maps[y-1][x]=="#":
                        count += 1     

                if count==1:
                    return "No"
    return "Yes"

ans = solve(W,H,maps)
print(ans)

Fixed submission:
def two_int():
    N, K = map(int, input().split())
    return N,K

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))

H,W = two_int()

maps = [list(input()) for i in range(H)]

import copy 
temp_maps = copy.deepcopy(maps)

#start調査
def solve(W,H,maps):
    start_X=0
    start_Y=0
    for x in range(W):
        for y in range(H):
            count=0

            if maps[y][x]=="#":
                count += 1

                if x+1 < W:
                    if maps[y][x+1]=="#":
                        count += 1     

                if y+1 < H:
                    if maps[y+1][x]=="#":
                        count += 1     

                if x-1 >= 0:
                    if maps[y][x-1]=="#":
                        count += 1     


                if y-1 >= 0:
                    if maps[y-1][x]=="#":
                        count += 1     

                if count==1:
                    return "No"
    return "Yes"

ans = solve(W,H,maps)
print(ans)
Buggy python submission (verdict: Runtime Error):
s=input()
s=s.split(' ')
maisuu = int(s[0])
maney  = int(s[1])

minn_man = int(maney/10000)+1
minn_sen = int(maney / 1000 )+1
minn_go  = int(maney / 5000) +1
flg=True
for man in range(0,minn_man):
	for go in range(0,minn_go):
		for sen in range(0,minn_sen):
			if man+go+sen == maisuu:
				if man*10000+ go*5000 + sen*1000 == maney:
					print(str(man)+","+str(go)+","+str(sen))
					flg=False
		if flg!=True:
			break
	if flg!=True:
		break
if flg:
	print('-1,-1,-1')


Fixed submission:
s=input()

data = s.split('/')
out = '2018/01/'+data[2]

print(out)

Buggy python submission (verdict: Runtime Error):
s=raw_input()
s=s.split(' ')
maisuu = int(s[0])
maney  = int(s[1])

minn_man = int(maney/10000)+1
minn_sen = int(maney / 1000 )+1
minn_go  = int(maney / 5000) +1
flg=True
for man in range(0,minn_man):
	for go in range(0,minn_go):
		for sen in range(0,minn_sen):
			if man+go+sen == maisuu:
				if man*10000+ go*5000 + sen*1000 == maney:
					print(str(man)+","+str(go)+","+str(sen))
					flg=False
		if flg!=True:
			break
	if flg!=True:
		break
if flg:
	print('-1,-1,-1')


Fixed submission:
s=input()

data = s.split('/')
out = '2018/01/'+data[2]

print(out)

Buggy python submission (verdict: Runtime Error):
s=input()
s=s.split(' ')
maisuu = int(s[0])
maney  = int(s[1])

minn_man = int(maney/10000)
minn_go  = int((maney%10000)/5000)
minn_sen = int((maney%5000)/1000)
flg = True
min_maisuu = minn_man+minn_go+minn_sen
if min_maisuu <= maisuu <= maney/1000:
	minn_go  = maney / 5000 +1
	minn_sen = maney / 1000 +1
	minn_man += 1

	for man in range(0,minn_man):
		for go in range(0,minn_go):
			for sen in range(0,minn_sen):
				if man+go+sen == maisuu:
					if man*10000+ go*5000 + sen*1000 == maney:
						print(str(man)+","+str(go)+","+str(sen))
						flg=False
if flg:
	print('-1,-1,-1')


Fixed submission:
s=input()

data = s.split('/')
out = '2018/01/'+data[2]

print(out)

Buggy python submission (verdict: Runtime Error):
s=input_raw()
print(s)

Fixed submission:
s=input()

data = s.split('/')
out = '2018/01/'+data[2]

print(out)

Buggy python submission (verdict: Runtime Error):
s=raw_input()

data = s.split('/')
out = '2018/01/'+data[2]

print(out)

Fixed submission:
s=input()

data = s.split('/')
out = '2018/01/'+data[2]

print(out)

Buggy python submission (verdict: Runtime Error):
s=raw_input()

data = s.split('/')

length = len(data)

out = '2018'
for i in range(1,length):
	out += '/'+data[i]

print(out)

Fixed submission:
s=input()

data = s.split('/')
out = '2018/01/'+data[2]

print(out)
Buggy python submission (verdict: Runtime Error):
def input_int():
    return map(int, input().split())

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))

X,Y=input_int()

import math

print(int(math.log2(Y) - math.log2(X))+1)

Fixed submission:
def input_int():
    return map(int, input().split())

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))

X,Y=input_int()
count=0
while X<=Y:
    count+=1
    X*=2
print(count)
Buggy python submission (verdict: Runtime Error):
S=input()
T=input()

s_len =len(S)
t_len =len(T)

for head in range(len(S)-t_len,0,-1):
    flg=True
    for s,t in zip(S[head:head+t_len],T):
        if not(s==t or "?"==s):
            flg=False
    if flg:
        break


if flg:
    S=list(S)
    S[head:head+t_len] = T
    S="".join(S)
    S=S.replace("?","a")
    print(S)
else:
    print("UNRESTORABLE")

Fixed submission:
S=input()
T=input()

s_len =len(S)
t_len =len(T)

flg=False

if s_len >= t_len:
    for head in range(len(S)-t_len,-1,-1):
        flg=True
        for s,t in zip(S[head:head+t_len],T):
            if not(s==t or "?"==s):
                flg=False
        if flg:
            break


if flg:
    S=list(S)
    S[head:head+t_len] = T
    S="".join(S)
    S=S.replace("?","a")
    print(S)
else:
    print("UNRESTORABLE")
Buggy python submission (verdict: Runtime Error):
def two_int():
    N, K = map(int, input().split())
    return N,K

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))
# import sys
# input = sys.stdin.readline

N=one_int()
S=one_str()

first_start_index=S.index("(")

count=0
for i in range(first_start_index, N):
    if S[i]=="(":
        count += 1
    else:
        count -= 1

#count　がプラス   => その分閉じカッコが後ろにつく
#count  がマイナス => その分開始カッコが銭湯に付く
ans=S
if count >0:
    ans+= ")"*count
else:
    ans = "("*int(abs(count)) +ans

ans = first_start_index*"(" + ans

print(ans)

Fixed submission:
def two_int():
    N, K = map(int, input().split())
    return N,K

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))
# import sys
# input = sys.stdin.readline

N=one_int()
S=one_str()

head = 0
tail = 0

point=0
for a in S:
    if a =="(":
        point+=1
    else:
        point -=1
    if point<0:
        head += 1
        
        #ここで先頭にカッコをつけるのでその分のポイントは差し引き０
        point += 1


print("("*head + S + abs(point)*")")
Buggy python submission (verdict: Runtime Error):
def two_int():
    N, K = map(int, input().split())
    return N,K

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))
# import sys
# input = sys.stdin.readline

N=one_int()

A=many_int()

A=sorted(A)
sums_A=list(it.accumulate(A))

for i in range(N-1):
    if 2*sums_A[i] < A[i+1]: 
        break

if len(set(A))==1:
    print(N)
else:
    print(N-i-1)



Fixed submission:
def two_int():
    N, K = map(int, input().split())
    return N,K

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))
# import sys
# input = sys.stdin.readline

import itertools as it

N=one_int()

A=many_int()

A=sorted(A)
sums_A=list(it.accumulate(A))

for i in range(N-1, -1, -1):
    if 2*sums_A[i-1] < A[i]: 
        break

print(N-i)
Buggy python submission (verdict: Runtime Error):
import numpy as np

N,M = map(int, input().split())

A=[]
for i in range(N):
    A.append(list(input()))

B=[]
for j in range(M):
    B.append(list(input()))

A=np.asarray(A)
B=np.asarray(B)
flg=False

  
for x in range(N-M):
    for y in range(N-M):
        if (A[x:x+M,y:y+M] == B).all():
            flg=True
if flg:
    print("Yes")
else:
    if (A == B).all():
        print("Yes")
    else:
        print("No")

Fixed submission:
import numpy as np

N,M = map(int, input().split())

A=[]
for i in range(N):
    A.append(list(input()))

B=[]
for j in range(M):
    B.append(list(input()))

A=np.asarray(A)
B=np.asarray(B)
flg=False

  
for x in range(N-M):
    for y in range(N-M):
        if (A[x:x+M,y:y+M] == B).all():
            flg=True
if flg:
    print("Yes")
else:
    try:
        if (A == B).all():
            print("Yes")
        else:
            print("No")
    except:
        print("No")

Buggy python submission (verdict: Runtime Error):
import numpy as np

N,M = map(int, input().split())

A=[]
for i in range(N):
    A.append(list(input()))

B=[]
for j in range(M):
    B.append(list(input()))

A=np.asarray(A)
B=np.asarray(B)
flg=False
if (A == B).all():
    flg=True
  
for x in range(N-M):
    for y in range(N-M):
        if (A[x:x+M,y:y+M] == B).all():
            flg=True
if flg:
    print("Yes")
else:
    print("No")

Fixed submission:
import numpy as np

N,M = map(int, input().split())

A=[]
for i in range(N):
    A.append(list(input()))

B=[]
for j in range(M):
    B.append(list(input()))

A=np.asarray(A)
B=np.asarray(B)
flg=False

  
for x in range(N-M):
    for y in range(N-M):
        if (A[x:x+M,y:y+M] == B).all():
            flg=True
if flg:
    print("Yes")
else:
    try:
        if (A == B).all():
            print("Yes")
        else:
            print("No")
    except:
        print("No")
Buggy python submission (verdict: Runtime Error):
N=int(input())

A=list(map(int, input().split()))

#重複した値だけを集めて消す

sets={}
for i in A:
    if i in sets:
        sets[i]+=1
    else:
        sets[i]=1

sets

duplicate=0
for k,v in sets.items():
    if v>1:
        duplicate+=(v-1)

duplicate %=2

print(set(A))-duplicate

Fixed submission:
N=int(input())

A=list(map(int, input().split()))

#重複した値だけを集めて消す

sets={}
for i in A:
    if i in sets:
        sets[i]+=1
    else:
        sets[i]=1

duplicate=0
for k,v in sets.items():
    if v>1:
        duplicate+=(v-1)

duplicate %=2

print(len(set(A))-duplicate)
Buggy python submission (verdict: Runtime Error):
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

N=one_int()

dicts={}
for i in range(2,N+1):
    lists = factorization(i)
    for item in lists:
        if item[0] != 1:
            if item[0] in dicts:
                dicts[item[0]] += item[1]
            else:
                dicts[item[0]] = item[1]

div=10**9 + 7
ans=1

for k,v in dicts.items():
    ans *= (v+1)%div

print(ans%div)

Fixed submission:
def two_int():
    N, K = map(int, input().split())
    return N,K

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))
# import sys
# input = sys.stdin.readline

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

N=one_int()

dicts={}
for i in range(2,N+1):
    lists = factorization(i)
    for item in lists:
        if item[0] != 1:
            if item[0] in dicts:
                dicts[item[0]] += item[1]
            else:
                dicts[item[0]] = item[1]

div=10**9 + 7
ans=1

for k,v in dicts.items():
    ans *= (v+1)%div

print(ans%div)
Buggy python submission (verdict: Runtime Error):
def two_int():
    N, K = map(int, input().split())
    return N,K

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))

N=one_int()
X=many_int()

sort_X=sorted(X)
min_X = sort_X[0]
max_X = sort_X[1]

min_num = 0
min_sum = 99999999999
for i in range(min_X, max_X+1):
    temp_sum = 0
    for j in X:
        temp_sum += (j-i)**2
    
    if temp_sum < min_sum:
        min_sum = temp_sum
        min_num = i

print(min_num)

Fixed submission:
def two_int():
    N, K = map(int, input().split())
    return N,K

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))

N=one_int()
X=many_int()

sort_X=sorted(X)
min_X = sort_X[0]
max_X = sort_X[-1]

min_num = 0
min_sum = 99999999999
for i in range(min_X, max_X+1):
    temp_sum = 0
    for j in X:
        temp_sum += (j-i)**2
    
    if temp_sum < min_sum:
        min_sum = temp_sum
        min_num = i

print(min_sum)
Buggy python submission (verdict: Runtime Error):
A,B,C=map(int,input().split())

hoge=set([A,B,C])
if hoge==set([5,7]):
    if A+B+C=17:
        print("YES")
    else:
        print("NO")

Fixed submission:
A,B,C=map(int,input().split())

hoge=set([A,B,C])
if hoge==set([5,7]):
    if A+B+C==17:
        print("YES")
    else:
        print("NO")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
s = int(input())
w = int(input())
if s < w :
    print("unsafe")
else :
    print("safe")

Fixed submission:
s, w = map(int, (input().split()))

if s > w :
    print("safe")
else :
    print("unsafe")
Buggy python submission (verdict: Runtime Error):
import math
inputs = input().split()
A, B, H, M = int(inputs[0]), int(inputs[1]), int(inputs[2]), int(inputs[3])
num_diff = H*5+M/12 - M

ans = math.sqrt(A**2 + B**2 - 2 * A * B * math.cos(2 * math.pi( num_diff / 60 ))

print(ans)

Fixed submission:
import math
inputs = input().split()
A, B, H, M = int(inputs[0]), int(inputs[1]), int(inputs[2]), int(inputs[3])
num_diff = H*5+M/12 - M

ans = math.sqrt(A**2 + B**2 - 2 * A * B * math.cos(2 * math.pi * ( num_diff / 60 )))
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
inputs = input().split()
A, B, H, M = int(inputs[0]), int(inputs[1]), int(inputs[2]), int(inputs[3])
num_diff = H*5 - M
ans1=ans2=ans3=0
if num_diff > 30:
    ans = math.sqrt(A**2 + B**2 - 2 * A * B * math.cos(( (30 -(num_diff)) * 6 )/180 * math.pi) )
#    print('case 1')
#elif num_diff < 0:
#	ans = math.sqrt(A**2 + B**2 - 2 * A * B * math.cos(( (30 +(num_diff)) * 6 )/180 * math.pi) )
#	print('case 2')
else:
	if H <=6 and M <=30:
	    ans = math.sqrt(A**2 + B**2 - 2 * A * B * math.cos(( (num_diff) * 6 )/ 135 * math.pi) )
#	    print('case 3')
	elif H >=6 and M >= 30:
	    ans = math.sqrt(A**2 + B**2 - 2 * A * B * math.cos(( (num_diff) * 6 )/ 135 * math.pi) )
#	    print('case 4')

print(ans)

Fixed submission:
import math
inputs = input().split()
A, B, H, M = int(inputs[0]), int(inputs[1]), int(inputs[2]), int(inputs[3])
num_diff = H*5+M/12 - M

ans = math.sqrt(A**2 + B**2 - 2 * A * B * math.cos(2 * math.pi * ( num_diff / 60 )))
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
inputs = input().split()
A, B, H, M = int(inputs[0]), int(inputs[1]), int(inputs[2]), int(inputs[3])
num_diff = H*5 - M
ans1=ans2=ans3=0
if num_diff > 30:
    ans = math.sqrt(A**2 + B**2 - 2 * A * B * math.cos(( (30 -(num_diff)) * 6 )/180 * math.pi) )
    print('case 1')
#elif num_diff < 0:
#	ans = math.sqrt(A**2 + B**2 - 2 * A * B * math.cos(( (30 +(num_diff)) * 6 )/180 * math.pi) )
#	print('case 2')
else:
	if H <=6 and M <=30:
	    ans = math.sqrt(A**2 + B**2 - 2 * A * B * math.cos(( (num_diff) * 6 )/ 135 * math.pi) )
	    print('case 3')
	elif H >=6 and M >= 30:
	    ans = math.sqrt(A**2 + B**2 - 2 * A * B * math.cos(( (num_diff) * 6 )/ 135 * math.pi) )
	    print('case 4')

print(ans)

Fixed submission:
import math
inputs = input().split()
A, B, H, M = int(inputs[0]), int(inputs[1]), int(inputs[2]), int(inputs[3])
num_diff = H*5+M/12 - M

ans = math.sqrt(A**2 + B**2 - 2 * A * B * math.cos(2 * math.pi * ( num_diff / 60 )))
print(ans)
Buggy python submission (verdict: Runtime Error):
def B():
    N = input()
    H = [int(i) for i in input().split()]
    max_high = max(H)
    max_index = H.index(max_high)

    count = 0
    count += H.count(max_high)

    pmax = H[0]
    for i in range(max_index):
        if pmax <= H[i]:
            pmax = H[i]
            count += 1
        
    print(count)
    
   
  if __name__ == '__main__':
    B()
  

Fixed submission:
def B():
    N = int(input())
    H = [int(i) for i in input().split()]
    if  not len(H) == N:
        exit()
    max_high = max(H)
    max_index = H.index(max_high)

    count = 0
    count += H.count(max_high)

    pmax = H[0]
    for i in range(max_index):
        if pmax <= H[i]:
            pmax = H[i]
            count += 1
        
    print(count)

if __name__ == '__main__':
    B()
Buggy python submission (verdict: Runtime Error):
def B():
    n = int(input())
    mul4 = n % 4
    mul8 = n % 8
    mul7 = n % 7
    mul6 = n % 6
    mul11 = n % 11

    YES='Yes'
    NO='No'

    if mul4==0 or mul7==0 or mul11==0:
        print(YES)
    elif mul7 % 4==0:
        print(YES)
    elif mul8 % 7==0:
        print(YES)
    elif n==30 or n==60 or n==90:
        print(YES)
    else:
        print(NO)
        

if __name__ =='__main__':
    B()

Fixed submission:
def A():
    a = input().split()
    if len(a) ==2:            
        n = int(a[0])
        k = int(a[1])
        if n % k != 0:
            print(1)
        else:
            print(0)


if __name__ =='__main__':
    A()
Buggy python submission (verdict: Runtime Error):

def B():
    s1 = input()
    s2 = input()
    
    YES = 'Yes'
    NO = 'No'
    
    result = NO
    for i in range(len(s1)):
        p = s1[i:] + s1[:i]
        if(p in s2):
            result = YES
    
    print(result)

if __name__ =='__main__':
    B()

Fixed submission:

def A():
    s = input().split()
    a = [int(n) for n in s]
    a.sort()
    a.reverse()
    
    a_i = a[0]
    sum = 0
    for x in a[1:]:
        sum += abs(a_i - x)
        a_i = x 
    
    print(sum)

if __name__ =='__main__':
    A()

Buggy python submission (verdict: Runtime Error):
def A():
    a = input().split()
    try:
        for x in a:
            x = int(x)
    except:
        exit(1)
    a.sort()
    a.inverse()
    
    a_i = a[0]
    sum = 0
    for x in a[1:]:
        sum += abs(a_i - x)
        a_i = x 
    
    print(sum)


if __name__ =='__main__':
    A()

Fixed submission:

def A():
    s = input().split()
    a = [int(n) for n in s]
    a.sort()
    a.reverse()
    
    a_i = a[0]
    sum = 0
    for x in a[1:]:
        sum += abs(a_i - x)
        a_i = x 
    
    print(sum)

if __name__ =='__main__':
    A()
Buggy python submission (verdict: Runtime Error):
def B():
    n = int(input())
    a = input().split()
    
    if(len(a) != n):
        exit(1)

    i_max = 0
    i_min = 1000000001
    for i in a:
        k = int(i)
        if (i_max < k):
                i_max = k
        if (i_min > k):
                i_min = k
    print(i_max,i_min)
    print(abs( i_max - i_min))

if __name__ =='__main__':
    B()

Fixed submission:

if __name__ =='__main__':
    a = input()
    try:
        x = int(a)
    except:
        exit(1)

    if(x % 2 != 0):
         x = x*2
    
    print(x)
Buggy python submission (verdict: Runtime Error):
S = input()
T = in@ut()

if(S==T[:-1]):
  print("Yes")
else:
  print("No")

Fixed submission:
S = input()
T = input()
 
if(S==T[:-1]):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
A, B, C, D = [int(n) for n in input().split(' ')]

while True:
  C -= B
  if C <=0:
    print("Yes")
    break
  A-=D
  if A<=:
    print("No")
    break

Fixed submission:
A, B, C, D = [int(n) for n in input().split(' ')]
 
while True:
  C -= B
  if C <=0:
    print("Yes")
    break
  A-=D
  if A<=0:
    print("No")
    break
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

keihin = []

for i in range(N):
  S = input()
  if S in keihin:
    continue
  keihin.append(S)

print(len(keihin))

Fixed submission:
N = int(input())
 
keihin = {}
 
for i in range(N):
  S = input()
  try:
    keihin[S] += 1
  except:
    keihin[S] = 1
 
print(len(keihin))
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce
 
def gcd(*numbers):
    return reduce(math.gcd, numbers)
 
K = int(input())
sum = 0
for i in range(1, K+1):
  for j in range(1, K+1):
    for k in range(1, K+1):
      sum += gcd(i,j,k)
print(sum)

Fixed submission:
import math
K=int(input())
ans=0
for i in range(1,K+1):
    for j in range(1,K+1):
        tmp=math.gcd(i,j)
        for k in range(1,K+1):
            ans+=math.gcd(tmp,k)         
print(ans)

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

def gcd(*numbers):
    return reduce(math.gcd, numbers)

K = int(input())
sum = 0
for i in range(1, K+1):
  for j in range(1, K+1):
    for k in range(1, K+1):
      sum += gcd(i,j,k)
print(sum)

Fixed submission:
import math
K=int(input())
ans=0
for i in range(1,K+1):
    for j in range(1,K+1):
        tmp=math.gcd(i,j)
        for k in range(1,K+1):
            ans+=math.gcd(tmp,k)         
print(ans)