Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
ans=[]
ans_i=[]
num=""
for i in range(n):
    a,b=map(int,input().split())
    ans.append(str(a)*b)
for j in ans:
    num+=j
ans_i=list(num)
print(ans_i[k-1])


Fixed submission:
n,k=map(int,input().split())
num=[list(map(int,input().split()))for _ in range(n)]
p=0
num.sort()
for i in range(n):
    p+=num[i][1]
    if k<=p:
        ans=num[i][0]
        break
print(ans)
Buggy python submission (verdict: Runtime Error):
n,t=map(int,input().split())
a=list(map(int,input().split()))
ans=int(0)
for i in range(0,n):
    if n==i-1:
        ans+=t
        break
    ans+=min(t,a[i+1]-a[i])
print(ans)


Fixed submission:
n,t=map(int,input().split())
a=list(map(int,input().split()))
ans=0
for i in range(1,n):
    ans+=min(t,a[i]-a[i-1])
ans+=t
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
import math
ans=[]
ans_i=[]
for i in range(1,int(math.sqrt(n))):
    if n%i==0:
        ans.append(i)
        ans_i.append(n//i)
v=list(str(max(max(ans,ans_i))))
print(len(v))

Fixed submission:
import math
n=int(input())
ans=[]
for i in range(1,int(math.sqrt(n))+1):
    if n%i==0:
        ans.append(n//i)
v=min(ans)
data=int(math.log10(v)+1)
print(data)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a==1:
    print("Alice")
elif b==1:
    print("Bob")
elif a<b:
    print("Bob")
elif:b<a
    print("Alice")
else:
    print("Draw")


Fixed submission:
a,b=map(int,input().split())
if a==b:
    print("Draw")
elif a==1:
    print("Alice")
elif b==1:
    print("Bob")
elif a<b:
    print("Bob")
else:
    print("Alice")
Buggy python submission (verdict: Runtime Error):
import numpy as np
n,m=map(int,input().split())
if m==0:
    print(0)
    exit()
ans=[[] for i in range(n)]
for i in range(m):
    a,b=map(int,input().split())
    ans[a-1].append((b-1))
    ans[b-1].append((a-1))
v=[]
def dfs(now,visited=[]):
    global v
    if len(visited)==n:
        v.append([visited])
        return
    for j in ans[now]:
        for j not in visited:
            dfs(j,visited+[j])
dfs(0,[0])
print(len(v))

Fixed submission:
import itertools
n,m=map(int,input().split())
e=[set() for _ in range(n+1)]
for _ in range(m):
    a,b=map(int,input().split())
    e[a].add(b)
    e[b].add(a)
count=0
for i in itertools.permutations(range(2,n+1)):
    if i[0] not in e[1]:
        continue
    f=True
    for j in range(n-2):
        if i[j+1] not in e[i[j]]:
            f=False
            break
    if f:
        count+=1
print(count)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
even_cnt=0
odd_cnt=0
for i in a:
    if i%2==0:
        even_cnt+=1
    else:
        odd_cnt+=1
if 1<=odd_cnt:
    even_cnt+=odd_cnt//2　#奇数から偶数になったもの数
    odd_cnt=odd_cnt%2 
    even_cnt=even_cnt%2
    if even_cnt==1 and odd_cnt==1:
        print("NO")
    else:
        print("YES")
else:
    print("YES")

#考察
#奇数の和も偶数の和も偶数なので、奇数の数を減らせばよい。


Fixed submission:
n=int(input())
a=list(map(int,input().split()))
even_cnt=0
odd_cnt=0
for i in a:
    if i%2==0:
        even_cnt+=1
    else:
        odd_cnt+=1
if 1<=odd_cnt:
    even_cnt+=odd_cnt//2
    odd_cnt=odd_cnt%2
    even_cnt=even_cnt%2
    if even_cnt==1 and odd_cnt==1:
        print("NO")
    else:
        print("YES")
else:
    print("YES")
Buggy python submission (verdict: Runtime Error):
x=int(input())
ans=0
ans+=(x//)*2
if x%11==0:
    print(ans)
elif x%11<=6:
    print(ans+1)
else:
    print(ans+2)
    

Fixed submission:
x=int(input())
ans=0
ans+=(x//11)*2
if x%11==0:
    print(ans)
elif x%11<=6:
    print(ans+1)
else:
    print(ans+2)
Buggy python submission (verdict: Runtime Error):
n=int(input())
mod=10**9+7
import math
import sympy
v=math.factorial(n)
print(sympy.divisor_count(v)%mod)

Fixed submission:
n=int(input())
import math
fac=math.factorial(n)
mod=10**9+7
ans=[0]*(n+1)
ans[0]=ans[1]=1
i=2
while i*i<=n:
    j=2
    while i*j<=n and ans[i]==0:
        ans[i*j]=1
        j+=1
    i+=1
v=[]
for i in range(n+1):
    if ans[i]==0:
        v.append(i)
total=1
count=0
for i in v:
    while fac%i==0:
        count+=1
        fac//=i
    total*=count+1
    count=0
print(total%mod)

Buggy python submission (verdict: Time Limit Exceeded):
import math
n=int(input())
mod=10**9+7
v=math.factorial(n)
ans=[i for i in range(1,v+1) if v%i==0]
print(len(ans)%mod)


Fixed submission:
n=int(input())
import math
fac=math.factorial(n)
mod=10**9+7
ans=[0]*(n+1)
ans[0]=ans[1]=1
i=2
while i*i<=n:
    j=2
    while i*j<=n and ans[i]==0:
        ans[i*j]=1
        j+=1
    i+=1
v=[]
for i in range(n+1):
    if ans[i]==0:
        v.append(i)
total=1
count=0
for i in v:
    while fac%i==0:
        count+=1
        fac//=i
    total*=count+1
    count=0
print(total%mod)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
mod=10**9+7
import math
v=math.factorial(n)
ans=[]
for i in range(1,v+1):
    if v%i==0:
        ans.append(i)
print(len(ans)%mod)

Fixed submission:
n=int(input())
import math
fac=math.factorial(n)
mod=10**9+7
ans=[0]*(n+1)
ans[0]=ans[1]=1
i=2
while i*i<=n:
    j=2
    while i*j<=n and ans[i]==0:
        ans[i*j]=1
        j+=1
    i+=1
v=[]
for i in range(n+1):
    if ans[i]==0:
        v.append(i)
total=1
count=0
for i in v:
    while fac%i==0:
        count+=1
        fac//=i
    total*=count+1
    count=0
print(total%mod)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
mod=10**9+7
import math
v=math.factorial(n)
ans=[]
for i in range(1,v+1):
    if v%i==0:
        ans.append(i)
print(len(ans))


Fixed submission:
n=int(input())
import math
fac=math.factorial(n)
mod=10**9+7
ans=[0]*(n+1)
ans[0]=ans[1]=1
i=2
while i*i<=n:
    j=2
    while i*j<=n and ans[i]==0:
        ans[i*j]=1
        j+=1
    i+=1
v=[]
for i in range(n+1):
    if ans[i]==0:
        v.append(i)
total=1
count=0
for i in v:
    while fac%i==0:
        count+=1
        fac//=i
    total*=count+1
    count=0
print(total%mod)
Buggy python submission (verdict: Runtime Error):
k,s=map(int,input().split())
count=0
for i in range(k+1):
    for j in range(k+1):
        if 0<=s-x-y<=k:
            count+=1
print(count)



Fixed submission:
k,s=map(int,input().split())
count=0
for x in range(k+1):
    for y in range(k+1):
        if 0<=s-x-y<=k:
            count+=1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,x=map(int,input().split())
count=0
for i in range(a,b+1):
    if i%x==0:
        count+=1
print(count)
        

Fixed submission:
a,b,x=map(int,input().split())
print(b//x-(a-1)//x)

Buggy python submission (verdict: Time Limit Exceeded):
a,b,x=map(int,input().split())
count=0
for i in range(a,b+1):
    if i%x==0:
        count+=1
print(count)

Fixed submission:
a,b,x=map(int,input().split())
print(b//x-(a-1)//x)

Buggy python submission (verdict: Time Limit Exceeded):
a,b,x=map(int,input().split())
count=0
for i in range(a,b+1):
    if i%x==0:
        count+=1
print(count)


Fixed submission:
a,b,x=map(int,input().split())
print(b//x-(a-1)//x)

Buggy python submission (verdict: Time Limit Exceeded):
a,b,x=map(int,input().split())
array=[]
for i in range(a,b+1):
    if i%x==0:
        array.append(i)
print(len(array))


Fixed submission:
a,b,x=map(int,input().split())
print(b//x-(a-1)//x)
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
a=list(map(int,input().split()))
v=sum(a)
for i in range(n-1):
    if k<a[i]+a[i+1]:
        while k<a[i]+a[i+1]:
            a[i+1]-=1
print(v-sum(a))

Fixed submission:
N, X = map(int, input().split())
A = list(map(int, input().split()))
ans = 0
 
if A[0] > X:
    ans += A[0] - X
    A[0] = X
    
for i in range(N-1):
    if A[i] + A[i+1] > X:
        ans -= X - (A[i] + A[i + 1])
        A[i+1] += X - (A[i] + A[i+1])
 
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
a=list(map(int,input().split()))
v=sum(a)
for i in range(n-1):
    if k<a[i]+a[i+1]:
        while k<a[i]+a[i+1]:
            a[i+1]=a[i+1]-1
print(v-sum(a))

Fixed submission:
N, X = map(int, input().split())
A = list(map(int, input().split()))
ans = 0
 
if A[0] > X:
    ans += A[0] - X
    A[0] = X
    
for i in range(N-1):
    if A[i] + A[i+1] > X:
        ans -= X - (A[i] + A[i + 1])
        A[i+1] += X - (A[i] + A[i+1])
 
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
x=input()
if "ST" in x:
    x=x.replace("ST","")
for i in range(len(x)//2):
    x=x.replace("ST","")
print(len(x))


Fixed submission:
x=list(input())
stack=[]
for i in range(len(x)):
    if x[i]=="S":
        stack.append(x[i])
    elif x[i]=="T" and len(stack)==0:
        stack.append(x[i])
    elif x[i]=="T" and stack[-1]=="T":
        stack.append(x[i])
    elif x[i]=="T" and stack[-1]=="S":
        stack.pop()
print(len(stack))

Buggy python submission (verdict: Time Limit Exceeded):
x=input().replace("ST","")
for _ in range(100000):
    if "ST" in x:
        x=x.replace("ST","")
print(len(x))

Fixed submission:
x=list(input())
stack=[]
for i in range(len(x)):
    if x[i]=="S":
        stack.append(x[i])
    elif x[i]=="T" and len(stack)==0:
        stack.append(x[i])
    elif x[i]=="T" and stack[-1]=="T":
        stack.append(x[i])
    elif x[i]=="T" and stack[-1]=="S":
        stack.pop()
print(len(stack))

Buggy python submission (verdict: Time Limit Exceeded):
x=input().replace("ST","")
while "ST" in x:
    x=x.replace("ST","")
print(len(x))

Fixed submission:
x=list(input())
stack=[]
for i in range(len(x)):
    if x[i]=="S":
        stack.append(x[i])
    elif x[i]=="T" and len(stack)==0:
        stack.append(x[i])
    elif x[i]=="T" and stack[-1]=="T":
        stack.append(x[i])
    elif x[i]=="T" and stack[-1]=="S":
        stack.pop()
print(len(stack))
Buggy python submission (verdict: Runtime Error):
s=input()
count=0
for i in range(1<<len(s)-1):
    t=""
    for j s:
        if i%2==1:
            t+="+"
        i//=2
    count+=eval(t)
print(count)


Fixed submission:
s=input()
count=0
for i in range(2**(len(s)-1)):
    t=""
    for j in s:
        t+=j
        if i%2==1:
            t+="+"
        i//=2
    count+=eval(t)
print(count)

Buggy python submission (verdict: Runtime Error):
def main():
    s=input()
    n=len(s)
    sum=0
    for i in range(1<<(n-1)):
        ans=0
        t=""
        for j in range(n-1):
            if 1&j<<i:
                t+=s[ans:j+1]
                ans+=j+1
                t+="+"
        t+=s[ans:]
        sum+=eval(t)
    print(sum)
if __name__ =="__main__":
    main()
    

Fixed submission:
s=input()
count=0
for i in range(2**(len(s)-1)):
    t=""
    for j in s:
        t+=j
        if i%2==1:
            t+="+"
        i//=2
    count+=eval(t)
print(count)

Buggy python submission (verdict: Runtime Error):
from itertools import combinations
s=input()
ans=0
for i in range(len(s)):
    for j in combinations(range(1,len(s)),i):
        c=0
        s_i=s
        for k in j:
            s_i=s_i[:k+c]+"+"+s_i[j+c:]
            c+=1
        ans+=eval(s_i)
print(ans)


Fixed submission:
s=input()
count=0
for i in range(2**(len(s)-1)):
    t=""
    for j in s:
        t+=j
        if i%2==1:
            t+="+"
        i//=2
    count+=eval(t)
print(count)

Buggy python submission (verdict: Runtime Error):
from itertools import product
s=input()
ans=0
t=["","+"]
for i in product(range(2),repeat=len(s)-1):
    v=s[0]
    for j in range(1,len(s)):
        v+=t[i[j-1]+s[j]]
    ans+=eval(v)
print(ans)

Fixed submission:
s=input()
count=0
for i in range(2**(len(s)-1)):
    t=""
    for j in s:
        t+=j
        if i%2==1:
            t+="+"
        i//=2
    count+=eval(t)
print(count)
Buggy python submission (verdict: Runtime Error):
s=input()
n=len(s)
ans=0
for i in range(1<<n-1):#+を入れるかどうか
    num=s[0]
    for j in range(n-1):#+を入れるかどうか
        if i&(1<<j):#bitで考える,iと1<<jが同じ数字であれば実行
            num+="+"+s[j+1]
        else:
            num+=s[j+1]
    ans+=eval(ins)
print(ans)


Fixed submission:
s=input()
n=len(s)
ans=0
for i in range(1<<n-1):
    ins=s[0]
    for j in range(n-1):
        if i&(1<<j):
            ins+="+"+s[j+1]
        else:
            ins+=s[j+1]
    ans+=eval(ins)
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[int(input()) for i in range(n)]
s=sum(a)
ans=round(s/n)
count=0
for i in range(n):
    count+=(a[i]-ans)**2
print(count)


Fixed submission:
n=int(input())
a=list(map(int,input().split()))
ave=round(sum(a)/n)
a=[(x-ave)**2 for x in a]
print(sum(a))
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
d=list(input().split())
for i in range(n,100001):
    set_i=set(list(str(i)))
    for j in set_i:
        if s in d:
            break
    else:
        print(i)
        break


Fixed submission:
n,k=map(int,input().split())
d=list(input().split())
ans=n
p=0
for i in range(10*n+1):
    s=str(ans)
    for j in range(len(str(s))):
        if s[j] in d:
            break
    else:
        break
    ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
import fractions
import numpy as np
import os
import sys
from pandas import DataFrame

n=int(input())
d=[]
for i in range(n):
    a,b=input().split()
    t=[a,int(b),int(i)]
    d.append(t)

df=DataFrame(d)
df=df.sort_values(by=1,ascending=False)
df=df.sort_values(by=0)


df=df.iloc[:,2]
for i in df:
    print(i+1)

Fixed submission:
import fractions
import numpy as np
import os
import sys

n=int(input())
tt=[]
for i in range(n):
    a,b=input().split()
    tt.append([a,int(b)])
t=tt.copy()
t=sorted(t,key=lambda x: x[1],reverse=True)
t=sorted(t,key=lambda x: x[0])

for i in t:
    print(tt.index(i)+1)
Buggy python submission (verdict: Time Limit Exceeded):
s=input()
t=input()

ans=True
for i in range(len(s)):
    if(t.count(t[i])!=s.count(s[i])):
        ans=False
        break
if(ans):
    print('Yes')
else:
    print('No')

Fixed submission:
import collections

s=input()
t=input()

ans=True
sa=collections.Counter(s)
ta=collections.Counter(t)
for i in range(len(s)):
    if(ta.get(t[i])!=sa.get(s[i])):
        ans=False
        break
if(ans):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
import numpy as np
import fraction
from functools import reduce
import sys

def gcd_list(numbers):
    return reduce(fraction.gcd, numbers)

n,z=map(int,input().split())
y=list(map(int,input().split()))

if(n==1):
    print(abs(y[0]-z))
    sys.exit()
y=np.array(y)
y=y-z
t=[]
for i in range(1,n):
    t.append(abs(y[i]-y[i-1]))

print(gcd_list(t))

Fixed submission:
import numpy as np
import fractions
from functools import reduce
import sys

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

n,z=map(int,input().split())
y=list(map(int,input().split()))

if(n==1):
    print(abs(y[0]-z))
    sys.exit()
y=np.array(y)
y=y-z
a=np.min(abs(y))
t=[]
for i in range(1,n):
    t.append(abs(y[i]-y[i-1]))

print(fractions.gcd(a,gcd_list(t)))
Buggy python submission (verdict: Runtime Error):
import math

def lcm(a,b):
    return (a*b)//math.gcd(a,b)

n=int(input())
a=list(map(int,input().split()))
for i in range(n-1):    
    if(i==0):
        m=lcm(a[0],a[1])
    else:
        m=lcm(m,a[i+1])
m-=1
f=0
for i in range(n):
    f+=m%a[i]
print(f)

Fixed submission:
import fractions

def lcm(a,b):
    return (a*b)//fractions.gcd(a,b)

n=int(input())
a=list(map(int,input().split()))
for i in range(n-1):    
    if(i==0):
        m=lcm(a[0],a[1])
    else:
        m=lcm(m,a[i+1])
m-=1
f=0
for i in range(n):
    f+=m%a[i]
print(f)
Buggy python submission (verdict: Runtime Error):
import math
n=int(input())
h=[]
for i in range(n):
    w=list(map(int,input().split()))
    h.append(w)
for i in range(n):
    a,b,c,d=h[i][0],h[i][1],h[i][2],h[i][3]
    if(b>a or b>d):
        print("No")
        continue
    if(b<=c):
        print("Yes")
        continue
    if(b-math.gcd(b,d)+a%math.gcd(b,d)<=c):print("Yes")
    else:print("No")

Fixed submission:
from fractions import gcd
n=int(input())
h=[]
for i in range(n):
    w=list(map(int,input().split()))
    h.append(w)
for i in range(n):
    a,b,c,d=h[i][0],h[i][1],h[i][2],h[i][3]
    if(b>a or b>d):
        print("No")
        continue
    if(b<=c):
        print("Yes")
        continue
    if(b-gcd(b,d)+a%gcd(b,d)<=c):print("Yes")
    else:print("No")
    continue

Buggy python submission (verdict: Runtime Error):
import math
n=int(input())
for i in range(n):
    a,b,c,d=map(int,input().split())
    if(b>a or b>d):
        print("No")
        continue
    if(b<=c):
        print("Yes")
        continue
    if(b-math.gcd(b,d)+a%math.gcd(b,d)<=c):print("Yes")
    else:print("No")



Fixed submission:
from fractions import gcd
n=int(input())
h=[]
for i in range(n):
    w=list(map(int,input().split()))
    h.append(w)
for i in range(n):
    a,b,c,d=h[i][0],h[i][1],h[i][2],h[i][3]
    if(b>a or b>d):
        print("No")
        continue
    if(b<=c):
        print("Yes")
        continue
    if(b-gcd(b,d)+a%gcd(b,d)<=c):print("Yes")
    else:print("No")
    continue

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
from copy import deepcopy

ans=("")
t=int(input())
h=[]
for i in range(t):
    w=list(map(int,input().split()))
    h.append(w)
for i in range(t):
    a=h[i][0]
    b=h[i][1]
    c=h[i][2]
    d=h[i][3]
    f=a-b
    if(f<0):
        print("No")
        continue
    if(b==d):
        if(f>c):print("No")
        else:print("Yes")
        continue
    if(d-b==c):
        print("Yes")
        continue
    if(d-b>c):
        if(a-d<=c):
            print("Yes")
            continue
        else:
            print("No")
            continue   
    while(1):
        f+=d-b
        if(d-b<0):
            print("No")
            break
        if(f>=b):
            f-=d-b
            if(f<=c):ans=("Yes")
            else:ans=("No")
            print(ans)
            break

Fixed submission:
from fractions import gcd
n=int(input())
h=[]
for i in range(n):
    w=list(map(int,input().split()))
    h.append(w)
for i in range(n):
    a,b,c,d=h[i][0],h[i][1],h[i][2],h[i][3]
    if(b>a or b>d):
        print("No")
        continue
    if(b<=c):
        print("Yes")
        continue
    if(b-gcd(b,d)+a%gcd(b,d)<=c):print("Yes")
    else:print("No")
    continue
Buggy python submission (verdict: Time Limit Exceeded):
import copy
n=int(input())
a=list(map(int,input().split()))
b=copy.copy(a)
for i in range(n):
    del a[i]
    ans=abs(a[0])
    for j in range(n-2):
        ans+=abs(a[j]-a[j+1])
    ans+=abs(a[n-2])
    print(ans)
    a=copy.copy(b)

Fixed submission:
import copy
n=int(input())
a=list(map(int,input().split()))
a.insert(0,0)
a.append(0)
s=0
for i in range(n+1):
    s+=abs(a[i]-a[i+1])

for i in range(1,n+1):
    print(s+abs(a[i-1]-a[i+1])-abs(a[i-1]-a[i])-abs(a[i]-a[i+1]))
Buggy python submission (verdict: Runtime Error):
X = int(input())
 
ans = (X//500)*1000
ans += ((X % 500)//5) * 5
 
print(ans)

Fixed submission:
S=input()
if (S[2]==S[3]) and (S[4]==S[5]):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
S = input()
SS = S/500
SSS = (S%500)/5
print(1000*SS + 5*SSS)

Fixed submission:
S=input()
if (S[2]==S[3]) and (S[4]==S[5]):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
S = int(input())
SS = S//500
SSS = (S%500)//5
print(1000*SS + 5*SSS)

Fixed submission:
S=input()
if (S[2]==S[3]) and (S[4]==S[5]):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
S = int(input())
S500 = S/500
S5 = (S%500)/5
print(1000*S500 + 5*S5)

Fixed submission:
S=input()
if (S[2]==S[3]) and (S[4]==S[5]):
    print('Yes')
else:
    print('No')

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

S500 = S/500

S_nokori = S%500

S5 = S_nokori/5

print(1000*S500 + 5*S5)

Fixed submission:
S=input()
if (S[2]==S[3]) and (S[4]==S[5]):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input()) 
ans = (N-1)*N/2
ans =ans + (M-1)*M/2
print(ans)

Fixed submission:
N,M = map(int,input().split()) 
ans = (N-1)*N//2
ans =ans + (M-1)*M//2
print(ans)

Buggy python submission (verdict: Runtime Error):
N,M = int(input().split())  ##Nが偶数　Mが奇数
all = N+M
ans = (N-1)*N/2
ans =ans + (M-1)*M/2
print(ans)


Fixed submission:
N,M = map(int,input().split()) 
ans = (N-1)*N//2
ans =ans + (M-1)*M//2
print(ans)
Buggy python submission (verdict: Runtime Error):
A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))
A3 = list(map(int, input().split()))
N = input()
b = [(int(input())) for _ in range(N)]

print(A1)

Fixed submission:

A = [list(map(int, input().split())) for i in range(3)]
N = int(input())
b = [(int(input())) for _ in range(N)]

bingo1 = [0, 0, 0]
bingo2 = [0, 0, 0]
bingo3 = [0, 0, 0]

# 穴を開ける工程
for i in range(3):
  for j in range(N):
    if A[i][0] == b[j]:
      bingo1[i] = 1
    if A[i][1] == b[j]:
      bingo2[i] = 1
    if A[i][2] == b[j]:
      bingo3[i] = 1
      

# ビンゴ判定
if bingo1[0] == bingo1[1] == bingo1[2] == 1:
    print("Yes")
elif bingo2[0] == bingo2[1] == bingo2[2] == 1:
    print("Yes")
elif bingo3[0] == bingo3[1] == bingo3[2] == 1:
    print("Yes")
elif bingo1[0] == bingo2[0] == bingo3[0] == 1:
    print("Yes")
elif bingo1[1] == bingo2[1] == bingo3[1] == 1:
    print("Yes")
elif bingo1[2] == bingo2[2] == bingo3[2] == 1:
    print("Yes")
elif bingo1[0] == bingo2[1] == bingo3[2] == 1:
    print("Yes")
elif bingo1[2] == bingo2[1] == bingo3[0] == 1:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
N, K = map(int,input().split())
b = input().split()

print(N)
print(K)
print(b)

passengers = 0

for i in b:
  if int(i) >= K:
    passengers += 1

print(passengers)

Fixed submission:
n = int(input())
ans = 0

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

Fixed submission:
a, b, c = map(int, input().split())
if (b >= c):
  print(b+c)
else:
  tot = 0
  tot += 2*b
  c -= b
  tot += c if a >= c-1 else a+1
  print(tot)
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = list(map(int, input().split(' ')))
if max(l) < sum(l) - max(l):
  print('Yes')
else
  print('No')


Fixed submission:
n = int(input())
l = list(map(int, input().split(' ')))
if max(l) < sum(l) - max(l):
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
n = int(input())
l = list(map(input().split(' '), int))
if max(l) < sum(l) - max(l):
  print('Yes')
else
  print('No')

Fixed submission:
n = int(input())
l = list(map(int, input().split(' ')))
if max(l) < sum(l) - max(l):
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
x = map(int, input().split(' '))
print(int(x[0]+x[1]/2))

Fixed submission:
x = list(map(int, input().split(' ')))
print(int(x[0]+x[1]/2))
Buggy python submission (verdict: Runtime Error):
s = input()
if s[0] == '1':
  s[0] = '9'
else:
  s[0] = '1'
if s[1] == '1':
  s[1] = '9'
else:
  s[1] = '1'
if s[2] == '1':
  s[2] = '9'
else:
  s[2] = '1'
print(s)

Fixed submission:
s = input()
s = list(s)
if s[0] == '1':
  s[0] = '9'
else:
  s[0] = '1'
if s[1] == '1':
  s[1] = '9'
else:
  s[1] = '1'
if s[2] == '1':
  s[2] = '9'
else:
  s[2] = '1'

print(''.join(s))