Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
m=map(str,input())
A=m[k-1]
for i in range(n):
    if m[i]!=A:
        m.replace(m[i],'*')
print(m)

Fixed submission:
n,s,k=int(input()),input(),int(input()) #入力を順番に一気に定義する
A=s[k-1]
for i in range(n):
    if s[i]!=A:
        s=s.replace(s[i],'*')
print(s)

Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
m=map(str,input())
A=m[k-1]
for i in range(n):
    if m[i]==A:
        continue
        if m[i]!=A:
            m.replace(m[i],'*')
print(m)

Fixed submission:
n,s,k=int(input()),input(),int(input()) #入力を順番に一気に定義する
A=s[k-1]
for i in range(n):
    if s[i]!=A:
        s=s.replace(s[i],'*')
print(s)

Buggy python submission (verdict: Runtime Error):
n,l=map(int,input().split())
m=map(str,input())
A=m[l-1]
for i in range(5):
    if m[i]==A:
        continue
        if m[i]!=A:
            m.replace(m[i],'*')
print(m)

Fixed submission:
n,s,k=int(input()),input(),int(input()) #入力を順番に一気に定義する
A=s[k-1]
for i in range(n):
    if s[i]!=A:
        s=s.replace(s[i],'*')
print(s)

Buggy python submission (verdict: Runtime Error):
n,l=map(int,input().split())
m=map(str,input())
A=m[l-1]
for i in range(5):
    if m[i]==A:
        continue
        if m[i]!=A:
            m[i]='*'
print(m)

Fixed submission:
n,s,k=int(input()),input(),int(input()) #入力を順番に一気に定義する
A=s[k-1]
for i in range(n):
    if s[i]!=A:
        s=s.replace(s[i],'*')
print(s)
Buggy python submission (verdict: Runtime Error):
n, k = map(int,input().split())
s = input()

ns = []
now_num = s[0]
cnt = 0
for i in range(n):
    if now_num == s[i]:
        cnt += 1
    else:
        ns.append((now_num, cnt))
        now_num = s[i]
        cnt = 1
ns.append((now_num, cnt))
#print(ns)
len_ns = len(ns)
pre = [0] * (len_ns + 1)
for i in range(len_ns):
    pre[i + 1] = pre[i] + ns[i][1]
#print(pre)

ans = 1
for i in range(len_ns - 2*k + 1):
    temp = pre[i + 2*k] - pre[i]
    if ns[i - 1][0] == '1':temp += ns[i - 1][1]
    elif i + 2*k != len_ns and ns[i + 2*k][0] == '0':temp += ns[i + 2*k + 1][1]
    if temp > ans:ans = temp
print(ans if len_ns - 2*k + 1 > 0 else len(s))

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

ns = []
now_num = s[0]
cnt = 0
for i in range(n):
    if now_num == s[i]:
        cnt += 1
    else:
        ns.append((now_num, cnt))
        now_num = s[i]
        cnt = 1
ns.append((now_num, cnt))
len_ns = len(ns)
pre = [0] * (len_ns + 1)
for i in range(len_ns):
    pre[i + 1] = pre[i] + ns[i][1]

ans = 1
for i in range(len_ns - 2*k + 1):
    temp = pre[i + 2*k] - pre[i]
    if i > 0 and ns[i - 1][0] == '1':temp += ns[i - 1][1]
    if i + 2*k < len_ns and ns[i + 2*k][0] == '1':temp += ns[i + 2*k][1]
    if temp > ans:ans = temp
print(ans if len_ns - 2*k + 1 > 0 else len(s))
Buggy python submission (verdict: Runtime Error):
l=[int(input()) for i in range(5)]
ans=[]
ans1=[]
for i in l:
    if i%10==0:
        ans+=[i]
    else:
        ans1+=[i]
ans2=[]
amari=[]
for i in ans1:
    amari+=[i%10]
    i=((i//10)+1)*10
    ans2+=[i]

amari.sort()
print(sum(ans+ans2)-(10-amari[0]))

Fixed submission:
l=[int(input()) for i in range(5)]
ans=[]
ans1=[]
for i in l:
    if i%10==0:
        ans+=[i]
    else:
        ans1+=[i]
ans2=[]
amari=[]
for i in ans1:
    amari+=[i%10]
    i=((i//10)+1)*10
    ans2+=[i]

amari.sort()
print(sum(ans+ans2)-(10-amari[0]) if len(amari)!=0 else sum(ans+ans2) )
Buggy python submission (verdict: Runtime Error):
s=input()
l=['A','C','G','T']
index_s=[]
count=0
for i in range(len(s)):
    if s[i] not in l:
        index_s+=[i]
    
    else:
        count+=1
        if count==len(s):
            print(len(s))
            exsit()
    
ans=[index_s[0]]
for i in range(len(index_s)-1):
    ans+=[index_s[i+1]-index_s[i]-1]

ans.sort()    
print(ans[-1])

Fixed submission:
s=input()
l=['A','C','G','T']
len_s=[]
count=0
for i in range(len(s)):
    if s[i] in l and i!=len(s)-1:
        count+=1
    elif s[i] not in l:
        len_s+=[count]
        count=0
    else:
        count+=1
        len_s+=[count]
print(max(len_s))

Buggy python submission (verdict: Runtime Error):
s=input()
l=['A','C','G','T']
index_s=[]
for i in range(len(s)):
    if s[i] not in l:
        index_s+=[i]
        
ans=[index_s[0]]
for i in range(len(index_s)-1):
    ans+=[index_s[i+1]-index_s[i]-1]

ans.sort()    
print(ans[-1])

Fixed submission:
s=input()
l=['A','C','G','T']
len_s=[]
count=0
for i in range(len(s)):
    if s[i] in l and i!=len(s)-1:
        count+=1
    elif s[i] not in l:
        len_s+=[count]
        count=0
    else:
        count+=1
        len_s+=[count]
print(max(len_s))
Buggy python submission (verdict: Runtime Error):
s=[int(input()) for i in range(4)]

ans=s[1]*s[2]-s[2]*s[3]-s[1]*s[4]+s[3]*s[4]
print(ans)

Fixed submission:
H,W=map(int,input().split())
h,w=map(int,input().split())
lw=H*W-(h*W+H*w-h*w)
print(lw)
Buggy python submission (verdict: Runtime Error):
n=int(input().split())
if n[1]%n[0]==0:
    print(n[0]+n[1])
else:
    print(n[1]-n[0])

Fixed submission:
n=list(map(int,input().split()))
if n[1]%n[0]==0:
    print(n[0]+n[1])
else:
    print(n[1]-n[0])

Buggy python submission (verdict: Runtime Error):
A,B=int(input())
if B%A==0:
    print(A+B)
else:
    print(B-A)

Fixed submission:
n=list(map(int,input().split()))
if n[1]%n[0]==0:
    print(n[0]+n[1])
else:
    print(n[1]-n[0])

Buggy python submission (verdict: Runtime Error):
#-*-coding:utf-8-*-

A,B=input()
if B%A==0:
    print(A+B)
else:
	print(B-A)

Fixed submission:
n=list(map(int,input().split()))
if n[1]%n[0]==0:
    print(n[0]+n[1])
else:
    print(n[1]-n[0])

Buggy python submission (verdict: Runtime Error):
a,b=input()
if b%a==0:
    print(a+b)
else:
	print(b-a)

Fixed submission:
n=list(map(int,input().split()))
if n[1]%n[0]==0:
    print(n[0]+n[1])
else:
    print(n[1]-n[0])

Buggy python submission (verdict: Runtime Error):
if B%A==0:
    print(A+B)
else:
	print(B-A)

Fixed submission:
n=list(map(int,input().split()))
if n[1]%n[0]==0:
    print(n[0]+n[1])
else:
    print(n[1]-n[0])

Buggy python submission (verdict: Runtime Error):
a=int(input('A'))
b=int(input('B'))
if b%a==0:
    print(a+b)
else:
  print(b-a)


Fixed submission:
n=list(map(int,input().split()))
if n[1]%n[0]==0:
    print(n[0]+n[1])
else:
    print(n[1]-n[0])
Buggy python submission (verdict: Time Limit Exceeded):
N,W=map(int,input().split())
w,v=[],[]
for i in range(N):
    x,y=map(int,input().split())
    w.append(x)
    v.append(y)

dp=[[-1]*(W+1) for i in range(N+1)]
dp[0][0]=0
for i in range(N):
    for w_sum in range(W+1):
        #品物を入れる場合
        if 0<=w_sum-w[i]<=W and dp[i][w_sum-w[i]]!=-1:
            dp[i+1][w_sum]=max(dp[i+1][w_sum],dp[i][w_sum-w[i]]+v[i])
        #入れない場合
        dp[i+1][w_sum]=max(dp[i+1][w_sum],dp[i][w_sum])
print(max(dp[-1]))
#print(dp)

Fixed submission:
n,w=map(int,input().split())
l=[list(map(int,input().split())) for i in range(n)]
#[w,v]
#重さに対応するインデックスに価値を保存する
dp=[[0]*(w+1) for i in range(n+1)]
 
for i in range(n):
    for sum_w in range(1,w+1):
        if sum_w-l[i][0]>=0:
            dp[i+1][sum_w]=max(dp[i+1][sum_w],dp[i][sum_w-l[i][0]]+l[i][1])
        #i番目の品を入れる場合
    
        dp[i+1][sum_w]=max(dp[i][sum_w],dp[i+1][sum_w])
        #i番目の品を入れない場合
print(dp[-1][-1])

Buggy python submission (verdict: Time Limit Exceeded):
n,w=map(int,input().split())
l=[list(map(int,input().split())) for i in range(n)]
#重さ、価値の順
dp=[[0]*(w+1) for i in range(n+1)]
#配列のインデックスを重さに対応させる

for i in range(n):
    for sum_w in range(w+1):
        
        if sum_w-l[i][0]>=0:
            dp[i+1][sum_w]=max(dp[i+1][sum_w],dp[i][sum_w-l[i][0]]+l[i][1])
        #l[i]を入れるとき
        dp[i+1][sum_w]=max(dp[i+1][sum_w],dp[i][sum_w])
        #入れない時
print(dp[-1][-1])

Fixed submission:
n,w=map(int,input().split())
l=[list(map(int,input().split())) for i in range(n)]
#[w,v]
#重さに対応するインデックスに価値を保存する
dp=[[0]*(w+1) for i in range(n+1)]
 
for i in range(n):
    for sum_w in range(1,w+1):
        if sum_w-l[i][0]>=0:
            dp[i+1][sum_w]=max(dp[i+1][sum_w],dp[i][sum_w-l[i][0]]+l[i][1])
        #i番目の品を入れる場合
    
        dp[i+1][sum_w]=max(dp[i][sum_w],dp[i+1][sum_w])
        #i番目の品を入れない場合
print(dp[-1][-1])

Buggy python submission (verdict: Time Limit Exceeded):
n,w=map(int,input().split())
l=[list(map(int,input().split())) for i in range(n)]
#[w,v]
#重さに対応するインデックスに価値を保存する
dp=[[0]*(w+1) for i in range(n+1)]

for i in range(n):
    for sum_w in range(1,w+1):
        if sum_w-l[i][0]>=0:
            dp[i+1][sum_w]=max(dp[i+1][sum_w],dp[i][sum_w-l[i][0]]+l[i][1])
        #i番目の品を入れる場合
    
        dp[i+1][sum_w]=max(dp[i][sum_w],dp[i+1][sum_w])
        #i番目の品を入れない場合
print(dp[-1][-1])

Fixed submission:
n,w=map(int,input().split())
l=[list(map(int,input().split())) for i in range(n)]
#[w,v]
#重さに対応するインデックスに価値を保存する
dp=[[0]*(w+1) for i in range(n+1)]
 
for i in range(n):
    for sum_w in range(1,w+1):
        if sum_w-l[i][0]>=0:
            dp[i+1][sum_w]=max(dp[i+1][sum_w],dp[i][sum_w-l[i][0]]+l[i][1])
        #i番目の品を入れる場合
    
        dp[i+1][sum_w]=max(dp[i][sum_w],dp[i+1][sum_w])
        #i番目の品を入れない場合
print(dp[-1][-1])
Buggy python submission (verdict: Runtime Error):
n, W = map(int,input().split())
wv = [list(map(int,input().split())) for i in range(n)]

dp = [[-1] * (W + 1) for i in range(n + 1)]
dp[0][0] = 0
for i in range(n):
    for j in range(W + 1):
        if dp[i][j] == -1:continue
        w, v = wv[i]
        if w + j <= W:
            dp[i + 1][w + j] = max(dp[i + 1][w + j], dp[i][j] + v)

        dp[i + 1][j] = max(dp[i + 1][j], dp[i][j])
print(max(dp[-1]))

Fixed submission:
N,W=map(int,input().split())
w=[]
v=[]
for i in range(N):
    x,y=map(int,input().split())
    w+=[x]
    v+=[y]

V_sum=sum(v)+1
dp=[[float('inf')]*(V_sum) for i in range(N+1)]
dp[0][0]=0
for i in range(1,N+1):
    for sum_v in range(V_sum):
        #同価値の場合より軽いほうを入れる
        if sum_v-v[i-1]>=0:
            dp[i][sum_v]=min(dp[i][sum_v],dp[i-1][sum_v-v[i-1]]+w[i-1])

        dp[i][sum_v]=min(dp[i-1][sum_v],dp[i][sum_v])

ans=0
for i in range(V_sum):
    if dp[-1][i]<=W and ans<i:
        ans=i
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,x=map(int,input().split())

lv1='BPPPB'
temp='BPPPB'
cnt=1
while cnt<n:
    temp='B'+lv1+'P'+lv1+'B'
    cnt+=1
    lv1=temp

count=0
for i in temp:
    x-=1
    if i=='P':
        count+=1

    if x==0:
        print(count)

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

#レベルNの層とパティの数を求める
a,p=[1],[1]
for i in range(n):
    a.append(2*a[i]+3)
    p.append(2*p[i]+1)

def cnt(n,x):
    #レベルNのバーガーのX層までに含まれるパティを数える
    if n==0:
        return 1 if x>=1 else 0

    elif x<=1+a[n-1]:
        return cnt(n-1,x-1)

    elif 2+a[n-1]<=x:
        return cnt(n-1,x-(a[n-1]+2))+p[n-1]+1

print(cnt(n,x))
Buggy python submission (verdict: Runtime Error):
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
TA=10**5+1
num=0
for i in range(n):
    if TA>abs(a-(t-h[i]*0.006))>0:
        num=i+1
        TA=abs(a-(t-h[i]*0.006))
 
print(num)

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

Buggy python submission (verdict: Runtime Error):
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
TA=10**10
num=0
for i in range(n):
    if TA>abs(a-(t-h[i]*0.006))>0:
        num=i+1
        TA=abs(a-(t-h[i]*0.006))
 
print(num)

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

Buggy python submission (verdict: Runtime Error):
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
TA=10**5+1
for i in range(n):
    if TA>abs(a-t+h[i]*0.006):
        ans=i+1
        TA=abs(a-t+h[i]*0.006)

print(ans)

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

Buggy python submission (verdict: Runtime Error):
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
TA=10**5+1
num=0
for i in range(n):
    if TA>abs(a-(t-h[i]*0.006)):
        num=i+1
        TA=abs(a-(t-h[i]*0.006))

print(num)

Fixed submission:
x,y=map(int,input().split())
print(int(x+y/2))
Buggy python submission (verdict: Runtime Error):
n=int(input())
xyh=[list(map(int,input().split())) for i in range(n)]
xyh=sorted(xyh,reverse=True,key=lambda x:x[2])
p#rint(xyh)
for cx in range(0,101):
    for cy in range(0,101):
        H = 0
        for x,y,h in xyh:
            if H == 0:
                H = h + abs(x - cx) + abs(y - cy)
            else:
                temp_H = h + abs(x - cx) + abs(y - cy)
                if temp_H != H:break
        else:
            if H>=1:
                print(cx,cy,H)
                exit()


Fixed submission:
n=int(input())
xyh=[list(map(int,input().split())) for i in range(n)]
xyh=sorted(xyh,reverse=True,key=lambda x:x[2])
#print(xyh)
for cx in range(0,101):
    for cy in range(0,101):
        H = xyh[0][2] + abs(xyh[0][0] - cx) + abs(xyh[0][1]-cy)
        for x,y,h in xyh:
            if h!= max(H - abs(x - cx) - abs(y - cy),0):
                break

        else:
            if H>=1:
                print(cx,cy,H)
                exit()
Buggy python submission (verdict: Runtime Error):
import math
n,m=map(int,input().split())

if m%n==0:
    print(m//n)
    exit()
temp=m//n
left=m-temp*n
gcd=math.gcd(temp,temp+left)
print(gcd)

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

num=m//n
ans=1
for i in range(1,int(m**0.5)+1):
    if m%i==0:
        Num=m//i
        if Num <= num and ans < Num:
            ans = Num

        if i<=num and ans<i:
            ans=i
print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np
h,w=map(int,input().split())
a=[np.array(input().split()) for i in range(h)]
a=np.array(a)

h_score=[0]*h
w_score=[0]*w
for i in range(h):
    for j in range(w):
        if a[i][j]=='.':
            h_score[j]+=1
            w_score[i]+=1

for i in range(h):
    if h_score[i]==h:
        a=np.delete(a,i,1)
for i in range(w):
    if w_score[i]==w:
        a=np.delete(a,i,0)

for i in a:#行列を入力と同じ形式で出力
    print(*i)

Fixed submission:
h,w=map(int,input().split())
l=[list(input()) for i in range(h)]
#h+w回確認する
import numpy as np
change_h=0
change_w=w
ans=[]
for i in range(h):
    if l[i].count('.')!=w:
        ans+=[l[i][:]]
        change_h+=1
l_count=[]
for i in range(w):
    count=0
    for j in range(h):
        if l[j][i]=='.':
            count+=1
    
    if count==h:
        l_count+=[i]
    
l_count=sorted(l_count,reverse=True)#削除したい列番号を後ろから削除する
for i in l_count:
    ans=np.delete(ans,i,axis=1)
    #np.delete(a,b,c):a:配列,b:削除したい行・列番号,c:列か行か

#最後の出力
for i in range(change_h):
    print(*ans[i],sep='')
Buggy python submission (verdict: Runtime Error):
s=input()
k=int(input())
count=0
for i in s:
    count+=int(i)**(5*(10**10))
    if count>=k:
        print(i)
        exit()

Fixed submission:
s=input()
k=int(input())
count=0
ans=''
for i in range(k):
    if s[i]=='1':
        count+=1
    else:
        ans=s[i]
        break
print(1 if count==k else ans)

Buggy python submission (verdict: Time Limit Exceeded):
s=input()
k=int(input())
count=0
for i in s:
    count+=int(i)**(5*(10**10))
    if count>=k:
        print(i)
        break

Fixed submission:
s=input()
k=int(input())
count=0
ans=''
for i in range(k):
    if s[i]=='1':
        count+=1
    else:
        ans=s[i]
        break
print(1 if count==k else ans)
Buggy python submission (verdict: Runtime Error):
import sys
s=list(input())
if s[0]!='A':
    break
count=0
for i in range(2,len(s)-2):
    if s[i]=='C':
        count+=1

if count==1:
    s.remove('A')
    s.remove('C')    
    res=''.join(s)
    print('AC' if res.islower()==True else 'WA') #str.islower():全部小文字ならTrue

else:
    print('WA')

Fixed submission:
r=int(input())
if r>=2800:
    print('AGC')
elif r<1200:
    print('ABC')
else:
    print('ARC')
Buggy python submission (verdict: Runtime Error):
import sys
s=list(input())
if s[0]!='A':
    break
count=0
for i in range(2,len(s)-2):
    if s[i]=='C':
        count+=1

if count==1:
    s.remove('A')
    s.remove('C')    
    res=''.join(s)
    print('AC' if res.islower()==True else 'WA') #str.islower():全部小文字ならTrue

else:
    print('WA')

Fixed submission:
s=list(input())
count=0
if s[0]!='A':
    count+=2
for i in range(2,len(s)-1):
    if s[i]=='C':
        count+=1

if count==1:
    s.remove('A')
    s.remove('C')    
    res=''.join(s)
    print('AC' if res.islower()==True else 'WA') #str.islower():全部小文字ならTrue

else:
    print('WA')
Buggy python submission (verdict: Runtime Error):
s,t=list(input()),list(input())
n=len(s)
num=0
for j in range(n):
        if s[0]==t[j] and (s[1]==t[j+1] or s[-1]==t[j-1]):
            num=j
ans_t=[]
for i in range(num):
    ans_t.append(s[n-num+i])
for i in range(n-num):
    ans_t.append(s[i])
print('Yes' if t==ans_t or s==t else 'No')


Fixed submission:
s,t=list(input()),list(input())
n=len(s)
num=0
ans_t=[]
if s[0]==t[-1] and s[1]==t[0]:
    ans_t=s[1:]+[s[0]]
else:
    for j in range(n-1):
        if s[0]==t[j] and s[1]==t[j+1]:
            num=j
            for i in range(num):
                ans_t.append(s[n-num+i])
            for i in range(n-num):
                ans_t.append(s[i])
print('Yes' if t==ans_t or s==t else 'No')
Buggy python submission (verdict: Runtime Error):
s=input()
s=[*s]
sum1=0
for i in range(4):
    if s[i]=='+':
        sum1+=1
    else:
        sum1+=-1
print(sum1)

Fixed submission:
s=input()
s=list(s)
sum1=0
for i in range(4):
    if s[i]=='+':
        sum1+=1
    else:
        sum1+=-1
print(sum1)
Buggy python submission (verdict: Runtime Error):
d,n=map(int,input().split())
w=list(range(1,100))
if d==0:
    print(w[n-1])
elif d==1:
    print(n*100)
else:
    print(n*10000)

Fixed submission:
d,n=map(int,input().split())
print(100**d*n if n!=100 else 100**d*(n+1))
Buggy python submission (verdict: Runtime Error):
from collections import deque
H,W=map(int,input().split())
s=[list(input()) for i in range(H)]
def dfs(h,w):
    q=deque()
    q.append((h,w))
    s[h][w]='.'

    dx=[0,1,0,-1]
    dy=[1,0,-1,0]
    cnt=0
    while q:
        task=q[-1]
        for i in range(4):
            nx=task[0]+dx[i]
            ny=task[1]+dy[i]
            if not(0<=nx<W and 0<=ny<H):continue
            if s[nx][ny]!='#':continue
            q.append((nx,ny))
            s[nx][ny]='.'
            cnt+=1
            break
        else:
            if cnt==0:
                print('No')
                exit()
            q.pop()

for i in range(H):
    for j in range(W):
        if s[i][j]=='#':
            dfs(i,j)
"""
for i in s:
    for j in i:
        if j=='#':
            print('No')
            exit()
"""
print('Yes')

Fixed submission:
h,w=map(int,input().split())
s=[input() for i in range(h)]

dx=[0,1,0,-1]
dy=[1,0,-1,0]
for i in range(h):
    for j in range(w):
        if s[i][j]=='#':
            cnt=0
            for k in range(4):
                nx=i+dx[k]
                ny=j+dy[k]

                if 0<=nx<=h-1 and 0<=ny<=w-1:
                    if s[nx][ny]=='#':
                        cnt=1
            if cnt!=1:
                print('No')
                exit()

print('Yes')
Buggy python submission (verdict: Runtime Error):
def check_prime(k):
    '''
    素数の時1、合成数の時0を返す
    '''
    if k == 1:return 0
    num = int(k ** 0.5 // 1)
    for i in range(2, num + 1):
        if k % i == 0:return 0
    return 1

n = int(input())
prime = []
for i in range(1, 55556):
    if check_prime(i):
        prime.append(i)

rec = [2]
cnt = 0
for i in range(n - 1):

    while True:
        if prime[cnt] < 2 * rec[-1]:
            cnt += 1
        else:
            rec.append(prime[cnt])
            cnt += 1
            break
print(*rec)

Fixed submission:
def check_prime(k):
    '''
    素数の時1、合成数の時0を返す
    '''
    if k == 1:return 0
    num = int(k ** 0.5 // 1)
    for i in range(2, num + 1):
        if k % i == 0:return 0
    return 1

n = int(input())
prime = []

for i in range(2, 55556):
    if check_prime(i):
        prime.append(i)

rec = [2]
ind = 1
for i in range(n - 1):
    while True:
        if prime[ind] % 5 == 1:
            rec.append(prime[ind])
            ind += 1
            break
        ind += 1

print(*rec)

Buggy python submission (verdict: Runtime Error):
def check_prime(k):
    '''
    素数の時1、合成数の時0を返す
    '''
    if k == 1:return 0
    num = int(k ** 0.5 // 1)
    for i in range(2, num + 1):
        if k % i == 0:return 0
    return 1

n = int(input())
prime = []
for i in range(1, 55556):
    if check_prime(i):
        prime.append(i)

rec = [2]
cnt = 0
for i in range(n - 1):

    while True:
        if prime[cnt] < 2 * rec[-1]:
            cnt += 1
        else:
            rec.append(prime[cnt])
            cnt += 1
            break
print(rec)

Fixed submission:
def check_prime(k):
    '''
    素数の時1、合成数の時0を返す
    '''
    if k == 1:return 0
    num = int(k ** 0.5 // 1)
    for i in range(2, num + 1):
        if k % i == 0:return 0
    return 1

n = int(input())
prime = []

for i in range(2, 55556):
    if check_prime(i):
        prime.append(i)

rec = [2]
ind = 1
for i in range(n - 1):
    while True:
        if prime[ind] % 5 == 1:
            rec.append(prime[ind])
            ind += 1
            break
        ind += 1

print(*rec)
Buggy python submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
l=list(range(a,b+1))
l=l[:k]+l[-k:]
l=sorted(set(l))
print(*l,sep='\n')

Fixed submission:
A, B, K = map(int, input().split())
num_range = range(A, B + 1)
for i in sorted(set(num_range[:K]) | set(num_range[-K:])):
    print(i)

Buggy python submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
l=list(range(a,b+1))
if b+1-a>=2*k:
    l=l[:k]+l[-k:]
print(*l,sep='\n')

Fixed submission:
A, B, K = map(int, input().split())
num_range = range(A, B + 1)
for i in sorted(set(num_range[:K]) | set(num_range[-K:])):
    print(i)

Buggy python submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
l=list(range(a,b+1))
l=l[:k]+l[-k:]
l=sorted(set(l))
print(*l,sep='\n')

Fixed submission:
A, B, K = map(int, input().split())
num_range = range(A, B + 1)
for i in sorted(set(num_range[:K]) | set(num_range[-K:])):
    print(i)

Buggy python submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
l=list(range(a,b+1))
l=l[:k]+l[-k:]
l=sorted(set(l))
print(*l,sep='\n')

Fixed submission:
A, B, K = map(int, input().split())
num_range = range(A, B + 1)
for i in sorted(set(num_range[:K]) | set(num_range[-K:])):
    print(i)

Buggy python submission (verdict: Runtime Error):

a,b,k=map(int,input().split())
l=list(range(a,b+1))
l=l[:k]+l[-k:]
l=set(l)
l=sorted(list(l))
print(*l,sep='\n')

Fixed submission:
A, B, K = map(int, input().split())
num_range = range(A, B + 1)
for i in sorted(set(num_range[:K]) | set(num_range[-K:])):
    print(i)

Buggy python submission (verdict: Runtime Error):

a,b,k=map(int,input().split())
l=list(range(a,b+1))
l=l[:k]+l[-k:]
print(*set(l),sep='\n')

Fixed submission:
A, B, K = map(int, input().split())
num_range = range(A, B + 1)
for i in sorted(set(num_range[:K]) | set(num_range[-K:])):
    print(i)

Buggy python submission (verdict: Runtime Error):
#93B
a,b,k=map(int,input().split())
l=list(range(a,b+1))
l=l[:k]+l[-k:]
print(*l,sep='\n')

Fixed submission:
A, B, K = map(int, input().split())
num_range = range(A, B + 1)
for i in sorted(set(num_range[:K]) | set(num_range[-K:])):
    print(i)
Buggy python submission (verdict: Runtime Error):
num=list(map(int,input().split()))
odd_num=[]
even_num=[]
count=0
for i in num:
    if i%2!=0:
        count+=1
        odd_num+=[i]
    else:
        even_num+=[i]

if count==1:
    if max(odd_num)>max(even_num):
        ans=abs(even_num[0]-even_num[1])//2+ood_num[0]-max(even_num)
        print(ans)
    else:
        ans=abs(even_num[0]-even_num[1])//2+1+(max(even_num)+1-odd_num[0])//2
        print(ans)
elif count==2:
    if max(odd_num)>max(even_num):
        ans=even_num[0]-max(odd_num)+abs(odd_num[0]-odd_num[1])//2
        print(ans)
    else:
        ans=abs(odd_num[0]-odd_num[1])//2+even_num-max(odd_num)
        print(ans)
else:
    if count==3:
        ans=(3*max(odd_num)-sum(odd_num))//2
        print(ans)
    else:
        ans=(3*max(even_num)-sum(even_num))//2
        print(ans)

Fixed submission:
a=list(map(int,input().split()))
a=sorted(a)
maxim=a[-1]
for i in range(3):
    a[i]=a[-1]-a[i]

ans=a[1]+(a[0]-a[1])//2 if (a[0]-a[1])%2==0 else a[1]+(a[0]-a[1])//2+2
print(ans)