Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N,W=map(int,input().split())
lwv=[]
for i in range(N):
    lwv.append(list(map(int,input().split())))
ldp=[[0 for j in range(W+1)] for i in range(N)]
for j in range(W+1):
    if lwv[0][0]<=j:
        ldp[0][j]=lwv[0][1]
for i in range(1,N):
    for j in range(W+1):
        if j-lwv[i][0]>=0:
            ldp[i][j]=max(ldp[i-1][j],ldp[i-1][j-lwv[i][0]]+lwv[i][1])
        else:
            ldp[i][j]=ldp[i-1][j]
print(ldp[N-1][W])


Fixed submission:
N,W=map(int,input().split())
lwv=[]
for i in range(N):
    lwv.append(list(map(int,input().split())))
ldp=[[0 for j in range(W+1)] for i in range(N)]
for j in range(W+1):
    if lwv[0][0]<=j:
        ldp[0][j]=lwv[0][1]
for i in range(1,N):
    for j in range(W+1):
        if j-lwv[i][0]>=0:
            ldp[i][j]=max(ldp[i-1][j],ldp[i-1][j-lwv[i][0]]+lwv[i][1])
        else:
            ldp[i][j]=ldp[i-1][j]
print(ldp[N-1][W])
Buggy python submission (verdict: Time Limit Exceeded):
N,W=map(int,input().split())
lwv=[]
for i in range(N):
    lwv.append(list(map(int,input().split())))
ldp=[[float("inf") for j in range(10**5)] for i in range(N)]
for j in range(10**5):
    if lwv[0][1]>=j+1:
        ldp[0][j]=lwv[0][0]
for i in range(1,N):
    for j in range(10**5):
        comp=ldp[i-1][j+1-lwv[i][1]-1]+lwv[i][0] if j+1-lwv[i][1]>0 else lwv[i][0]
        ldp[i][j]=min(ldp[i-1][j],comp)
for j in range(10**5-1,-1,-1):
    if ldp[N-1][j]<=W:
        print(j+1)
        break


Fixed submission:
N,W=map(int,input().split())
lw=[]
lv=[]
for i in range(N):
    w,v=map(int,input().split())
    lw.append(w)
    lv.append(v)
ldp=[[float("inf") for j in range(10**5)] for i in range(N)]
for j in range(10**5):
    if lv[0]>=j+1:
        ldp[0][j]=lw[0]
for i in range(1,N):
    for j in range(10**5):
        ldp[i][j]=min(ldp[i-1][j],ldp[i-1][j+1-lv[i]-1]+lw[i] if j+1-lv[i]>0 else lw[i])
for j in range(10**5-1,-1,-1):
    if ldp[N-1][j]<=W:
        print(j+1)
        break

Buggy python submission (verdict: Time Limit Exceeded):
N,W=map(int,input().split())
lwv=[]
for i in range(N):
    lwv.append(list(map(int,input().split())))
#ldp=[[float("inf") for j in range(10**5+1)] for i in range(N)]
ldp=[[float("inf") for j in range(10**5)] for i in range(N)]
#for j in range(10**5+1):
for j in range(10**5):
    #if lwv[0][1]>=j:
    if lwv[0][1]>=j+1:
        ldp[0][j]=lwv[0][0]
for i in range(1,N):
    #for j in range(10**5+1):
    for j in range(10**5):
        #if j-lwv[i][1]>=0:
            #comp=ldp[i-1][j-lwv[i][1]]+lwv[i][0]
            #ldp[i][j]=min(ldp[i-1][j],ldp[i-1][j-lwv[i][1]]+lwv[i][0])
        #else:
            #ldp[i][j]=ldp[i-1][j]
        #comp=ldp[i-1][j-lwv[i][1]]+lwv[i][0] if j-lwv[i][1]>=0 else lwv[i][0]
        comp=ldp[i-1][j+1-lwv[i][1]-1]+lwv[i][0] if j+1-lwv[i][1]>0 else lwv[i][0]
        ldp[i][j]=min(ldp[i-1][j],comp)
#print(ldp[N-1][90])
#print(ldp[N-1][:91])
#print(ldp[0][:91])
#print(ldp[1][:91])

#for j in range(10**5,0,-1):
for j in range(10**5-1,-1,-1):
    if ldp[N-1][j]<=W:
        #print(j)
        print(j+1)
        break


Fixed submission:
N,W=map(int,input().split())
lw=[]
lv=[]
for i in range(N):
    w,v=map(int,input().split())
    lw.append(w)
    lv.append(v)
ldp=[[float("inf") for j in range(10**5)] for i in range(N)]
for j in range(10**5):
    if lv[0]>=j+1:
        ldp[0][j]=lw[0]
for i in range(1,N):
    for j in range(10**5):
        ldp[i][j]=min(ldp[i-1][j],ldp[i-1][j+1-lv[i]-1]+lw[i] if j+1-lv[i]>0 else lw[i])
for j in range(10**5-1,-1,-1):
    if ldp[N-1][j]<=W:
        print(j+1)
        break
Buggy python submission (verdict: Runtime Error):
nm=list(map(int,input().split()))
n=nm[0]
m=nm[1]
py=[]
y=[]
for i in range(m):
    py.append([])
for i in range (n):
    y.append([])
for i in range(m):
    py[i]=list(map(int,input().split()))
    y[py[i][0]-1].append(py[i][1])
for i in range(n):
    y[i].sort()
#print(py)
#print(y)
for i in range(m):
    if py[i][0]<10:
        print("00000"+str(py[i][0]*10**6+y[py[i][0]-1].index(py[i][1])+1))
    elif  py[i][0]<100:
        print("0000"+str(py[i][0]*10**6+y[py[i][0]-1].index(py[i][1])+1))
    elif py[i][0]<1000:
        print("000"+str(py[i][0]*10**6+y[py[i][0]-1].index(py[i][1])+1))
    elif py[i][0]<10000:
        print("00"+str(py[i][0]*10**6+y[py[i][0]-1].index(py[i][1])+1))
    elif py[i][0]<100000:
        print("0"+str(py[i][0]*10**6+y[py[i][0]-1].index(py[i][1])+1))
    else:
        print(str(py[i][0]*10**6+y[py[i][0]-1].index(py[i][1])+1))

Fixed submission:
l=list(map(int,input().split()))
x=l[0]
y=l[1]
print(int(x+y/2))
Buggy python submission (verdict: Runtime Error):
l=list(map(int,input().split()))
n=l[0]
m=l[1]
q=l[2]
lr=[]
pq=[]
for i in range(m):
    lr.append(input())
for i in range(q):
    pq.append(input())
w=0    
for i in range(q):
    ppqq=list(map(int,pq[i].split()))
    w=0
    for j in range(m):
        llrr=list(map(int,lr[j].split()))
        if llrr[0]>= ppqq[0] and llrr[1]<=ppqq[1]:
            w+=1
    print(w)


Fixed submission:
ss=input()
k=int(input())
s=[int(i) for i in ss ]
#ls=len(s)
j=0
q=0
w=0
while q==0:
    if s[j]==1:
        w+=1
        if k<=w:
            print(1)
            q=1
        j+=1
    else:
        print(s[j])
        q=1
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
for i in range(n):
    a[i]-=i+1
#print(a)

a.sort()
w=10**9
for j in range(a[0],a[n-1]+1):
    s=0

    for k in range(n):
        s+=abs(a[k]-j)
    if s<w :
        w=s
print(w)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
for i in range(n):
    a[i]-=i+1
#print(a)

a.sort()

#bはaの最小から最大まで
x=0
z=n-1
y=(x+z)//2
while z!=x:
    s1=0
    s2=0
    for k in range(n):
        s1+=abs(a[k]-a[y])
    for k in range(n):
        s2+=abs(a[k]-a[y+1])
    if s1<s2 :
        z=y
        y=(x+z)//2
    elif s1==s2:
        x=y
        z=y
    else:
        x=y+1
        y=(x+z)//2
#x=y=zとなっている
s=0
for k in range(n):
    s+=abs(a[k]-a[y])

print(s)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=input()
k=n
for i in range(n):
    a=s[:i]
    b=s[i+1:]
    l=0
    for j in range(i):
        if a[j]=="W":
            l+=1
    for j in range(n-i-1):
        if b[j]=="E":
            l+=1
    if l<k:
        k=l
print(k)


Fixed submission:
n=int(input())
s=input()
k=0
l=[]
for i in range(n):
    if s[i]=="W":
        k+=1
    l.append(k)
#print(l)
#既に追加されたものまで変更されはしなかった
w=n
for i in range(n):
    if i==0:
        #if s[i]=="W":
        #    v=n-l[n-1]+1
        #else:
        #    v=n-l[n-1]
        #下のようにすれば分ける必要はない
        v=n-1-l[n-1]+l[0]
    else:
        v=l[i-1]+n-1-i-(l[n-1]-l[i])


    if v<w:
        w=v
print(w)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=input()
k=n
for i in range(n):
    a=s[:i]
    b=s[i+1:]
    l=a.count("W")+b.count("E")
    if l<k:
        k=l
print(k)

Fixed submission:
n=int(input())
s=input()
k=0
l=[]
for i in range(n):
    if s[i]=="W":
        k+=1
    l.append(k)
#print(l)
#既に追加されたものまで変更されはしなかった
w=n
for i in range(n):
    if i==0:
        #if s[i]=="W":
        #    v=n-l[n-1]+1
        #else:
        #    v=n-l[n-1]
        #下のようにすれば分ける必要はない
        v=n-1-l[n-1]+l[0]
    else:
        v=l[i-1]+n-1-i-(l[n-1]-l[i])


    if v<w:
        w=v
print(w)

Buggy python submission (verdict: Runtime Error):
n=int(input())
s=input()
k=n
for i in range(n):
    a=s[:i]
    b=s[i+1:]
    l=a.count("W")+b.count("E")
    if l<k:
        k=l
print(k

Fixed submission:
n=int(input())
s=input()
k=0
l=[]
for i in range(n):
    if s[i]=="W":
        k+=1
    l.append(k)
#print(l)
#既に追加されたものまで変更されはしなかった
w=n
for i in range(n):
    if i==0:
        #if s[i]=="W":
        #    v=n-l[n-1]+1
        #else:
        #    v=n-l[n-1]
        #下のようにすれば分ける必要はない
        v=n-1-l[n-1]+l[0]
    else:
        v=l[i-1]+n-1-i-(l[n-1]-l[i])


    if v<w:
        w=v
print(w)
Buggy python submission (verdict: Runtime Error):
lst=list(map(int,input().split()))


if abs(lst[0]-lst[2])<=lst[3] or (abs(lst[0]-lst[1])<=lst[3] and abs(lst[2]-lst[1])<=lst[3]:
    print("Yes")
else:
    print("No")

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


if abs(lst[0]-lst[2])<=lst[3] or (abs(lst[0]-lst[1])<=lst[3] and abs(lst[2]-lst[1])<=lst[3]):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
lst=list(map(int,input().split()))
lst[1]/=1000

i=0
for a in range(lst[0]+1):
    if i !=0:
        break
    for b in range(lst[0]+1):
        if i !=0:
            break
        for c in range(lst[0]+1):
            if a+b+c==lst[0]:
                if 10*a+5*b+c==lst[1]:
                    print(a,b,c)
                    i=1
                    break
if i==0:
    print(-1,-1,-1)


Fixed submission:
lst=list(map(int,input().split()))
lst[1]/=1000
i=0
for a in range(lst[0]+1):
    if i !=0:
        break
    for b in range(lst[0]+1):
     	if lst[0]-a-b>=0:
            if 10*a+5*b+(lst[0]-a-b)==lst[1]:
                print(a,b,lst[0]-a-b)
                i=1
                break
        
if i==0:
    print(-1,-1,-1)
Buggy python submission (verdict: Runtime Error):
import sys
input=sys.stdin.readline
from bisect import bisect_left, bisect_right

Q=int(input())
llr=[]
maxr=1
for i in range(Q):
    l,r=map(int,input().split())
    if r>maxr:
        maxr=r
    llr.append([l,r])
def isprime(n):
    if n==1:
        return 0
    m=int(n**(1/2))
    for i in range(2,m+1):
        if n%i==0:
            return 0
            break
    return 1
l2017=[]
for i in range(1,maxr+1,2):
    if isprime(i) and isprime((i+1)/2):
        l2017.append(i)
for i in range(Q):
    il=bisect_left(l2017,llr[i][0])
    ir=bisect_right(l2017,llr[i][1])
    print(ir-il

Fixed submission:
import sys
input=sys.stdin.readline
from bisect import bisect_left, bisect_right

Q=int(input())
llr=[]
maxr=1
for i in range(Q):
    l,r=map(int,input().split())
    if r>maxr:
        maxr=r
    llr.append([l,r])
def isprime(n):
    if n==1:
        return 0
    m=int(n**(1/2))
    for i in range(2,m+1):
        if n%i==0:
            return 0
            break
    return 1
l2017=[]
for i in range(1,maxr+1,2):
    if isprime(i) and isprime((i+1)/2):
        l2017.append(i)
for i in range(Q):
    il=bisect_left(l2017,llr[i][0])
    ir=bisect_right(l2017,llr[i][1])
    print(ir-il)

Buggy python submission (verdict: Runtime Error):
import sys
input=sys.stdin.readline
from bisect import bisect_left, bisect_right

Q=int(input())
llr=[]
maxr=1
for i in range(Q):
    l,r=map(int,input().split())
    if r>maxr:
        maxr=r
    llr.append([l,r])
def isprime(n):
    m=int(n**(1/2))
    for i in range(2,m+1):
        if n%i==0:
            return 0
            break
    return 1
l2017=[]
for i in range(3,maxr+1,2):
    if isprime(i) and isprime((i+1)/2):
        l2017.append(i)
for i in range(Q):
    il=bisect_left(l2017,llr[i][0])
    ir=bisect_right(l2017,llr[i][1])
    print(ir-il

Fixed submission:
import sys
input=sys.stdin.readline
from bisect import bisect_left, bisect_right

Q=int(input())
llr=[]
maxr=1
for i in range(Q):
    l,r=map(int,input().split())
    if r>maxr:
        maxr=r
    llr.append([l,r])
def isprime(n):
    if n==1:
        return 0
    m=int(n**(1/2))
    for i in range(2,m+1):
        if n%i==0:
            return 0
            break
    return 1
l2017=[]
for i in range(1,maxr+1,2):
    if isprime(i) and isprime((i+1)/2):
        l2017.append(i)
for i in range(Q):
    il=bisect_left(l2017,llr[i][0])
    ir=bisect_right(l2017,llr[i][1])
    print(ir-il)
Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
lab=[]
for i in range(N):
    lab.append(list(map(int,input().split())))
lcd=[]
for i in range(N):
    lcd.append(list(map(int,input().split())))
for i in range(N):
    dmin=10**9
    ans=1
    for j in range(M):

        if abs(lab[i][0]-lcd[j][0])+abs(lab[i][1]-lcd[j][1])<dmin:
            #print(abs(lab[i][0]-lcd[j][0])+abs(lab[i][1]-lcd[j][1]))
            dmin=abs(lab[i][0]-lcd[j][0])+abs(lab[i][1]-lcd[j][1])
            ans=j+1
    #print(dmin)
    print(ans)


Fixed submission:
N,M=map(int,input().split())
lab=[]
for i in range(N):
    lab.append(list(map(int,input().split())))
lcd=[]
#for i in range(N):
for i in range(M):#間違えた(は？)
    lcd.append(list(map(int,input().split())))
for i in range(N):
    dmin=10**9
    ans=1
    for j in range(M):

        if abs(lab[i][0]-lcd[j][0])+abs(lab[i][1]-lcd[j][1])<dmin:
            #print(abs(lab[i][0]-lcd[j][0])+abs(lab[i][1]-lcd[j][1]))
            dmin=abs(lab[i][0]-lcd[j][0])+abs(lab[i][1]-lcd[j][1])
            ans=j+1
    #print(dmin)
    #答えるものを間違えていた(は？)
    print(ans)

Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
lab=[]
for i in range(N):
    lab.append(list(map(int,input().split())))
lcd=[]
for i in range(N):
    lcd.append(list(map(int,input().split())))
for i in range(N):
    dmin=10**9
    for j in range(M):

        if abs(lab[i][0]-lcd[j][0])+abs(lab[i][1]-lcd[j][1])<dmin:
            dmin=abs(lab[i][0]-lcd[j][0])+abs(lab[i][1]-lcd[j][1])
    print(dmin)


Fixed submission:
N,M=map(int,input().split())
lab=[]
for i in range(N):
    lab.append(list(map(int,input().split())))
lcd=[]
#for i in range(N):
for i in range(M):#間違えた(は？)
    lcd.append(list(map(int,input().split())))
for i in range(N):
    dmin=10**9
    ans=1
    for j in range(M):

        if abs(lab[i][0]-lcd[j][0])+abs(lab[i][1]-lcd[j][1])<dmin:
            #print(abs(lab[i][0]-lcd[j][0])+abs(lab[i][1]-lcd[j][1]))
            dmin=abs(lab[i][0]-lcd[j][0])+abs(lab[i][1]-lcd[j][1])
            ans=j+1
    #print(dmin)
    #答えるものを間違えていた(は？)
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
ldp=[[[False,[]] for j in range(N+1)] for i in range(N)]
ldp[0][0][0]=True
ldp[0][1][0]=True
ldp[0][1][1].append(0)
if N==1:
    print(1)
for i in range(N-1):
    for j in range(N+1):
        #if N<i+2:
        if j<i+2:
            ldp[i+1][j][0]=ldp[i][j][0]
            ldp[i+1][j][1]=ldp[i][j][1]
        else:
            #ldp[i+1][j]=(ldp[i][j] or ldp[i][N-(i+2)])
            if ldp[i][j][0]==True:
                ldp[i+1][j][0]=True
                ldp[i+1][j][1]=ldp[i][j][1]
            #elif ldp[i][N-(i+2)][0]==True:
            elif ldp[i][j-(i+2)][0]==True:
                ldp[i+1][j][0]=True
                #ldp[i+1][j][1]=ldp[i][N-(i+2)][1]+[i+1]
                ldp[i+1][j][1]=ldp[i][j-(i+2)][1]+[i+1]
            else:
                ldp[i+1][j][0]=False
    if ldp[i+1][N][0]==True:
        for k in ldp[i+1][N][1]:
            print(k+1)
        break
#for i in range(N):
#    print(ldp[i])


Fixed submission:
N=int(input())
sum=0
for i in range(N):
    sum+=i+1
    if sum>=N:
        break
for j in range(1,i+2):
    if j!=sum-N:
        print(j)
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=a**2
print b

Fixed submission:
a=int(input())
b=a**2
print (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())
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):
n,l=(int,input().split())
if(n>2*l):
    print(n-2*l)
else:
    print(0)

Fixed submission:
n,p=map(int,input().split())
if(n>2*p):
    print(n-2*p)
else:
    print(0)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
L = [0] * M
R = [0] * M
for i in range(M):
    L[i], R[i] = map(int, input().split())

sum = 0
for id in range(1, N+1):
    for li, ri in zip(L, R):
        if id < li or ri < id:
            break
    else:
        sum += 1

print(sum)


Fixed submission:
N, M = map(int, input().split())
L = [0] * M
R = [0] * M
for i in range(M):
    L[i], R[i] = map(lambda x: int(x)-1, input().split())

sum = 0
maxl = max(L)
minr = min(R)
for id in range(N):
    if maxl <= id and id <= minr:
        sum += 1

print(sum)

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

N, M = map(int, input().split())
L = [0] * M
R = [0] * M
for i in range(M):
    t = list(map(int, input().split()))
    L[i], R[i] = t[0]-1, t[1]-1

a = np.ones(N)
for gate in range(M):
    mask = np.zeros(N)
    mask[L[gate]:R[gate]+1] += 1
    a *= mask

print(int(a.sum()))


Fixed submission:
N, M = map(int, input().split())
L = [0] * M
R = [0] * M
for i in range(M):
    L[i], R[i] = map(lambda x: int(x)-1, input().split())

sum = 0
maxl = max(L)
minr = min(R)
for id in range(N):
    if maxl <= id and id <= minr:
        sum += 1

print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
L = [0] * M
R = [0] * M
for i in range(M):
    L[i], R[i] = map(int, input().split())

a = [1] * N
for gate in range(M):
    for id in range(1, N+1):
        if id < L[gate] or R[gate] < id:
            a[id-1] = 0

print(sum(a))


Fixed submission:
N, M = map(int, input().split())
L = [0] * M
R = [0] * M
for i in range(M):
    L[i], R[i] = map(lambda x: int(x)-1, input().split())

sum = 0
maxl = max(L)
minr = min(R)
for id in range(N):
    if maxl <= id and id <= minr:
        sum += 1

print(sum)
Buggy python submission (verdict: Time Limit Exceeded):
S = list(input())

cnt = 0
t = -1
while cnt != t:
    t = cnt
    for i in range(len(S)-1):
        if S[i] == 'B' and S[i+1] == 'W':
            S[i] = 'W'
            S[i+1] = 'B'
            cnt += 1

print(cnt)

Fixed submission:
S = list(input())

cnt = 0
t = 0
for i in range(len(S)):
    if S[i] == 'W':
        cnt += t
    else:
        t += 1

print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
S = list(input())

cnt = 0
e = len(S)-1
i = 0
while i < e:
    if S[i] == 'B' and S[i+1] == 'W':
        S[i] = 'W'
        S[i+1] = 'B'
        cnt += 1
        i = max(i-2, -1)
    i += 1

print(cnt)

Fixed submission:
S = list(input())

cnt = 0
t = 0
for i in range(len(S)):
    if S[i] == 'W':
        cnt += t
    else:
        t += 1

print(cnt)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
 
s = 16
for i in range(16):
	if i%2 == 0:
		if a > 0:
			s -= 1
			a -= 1
	else:
		if b > 0:
			s -= 1
			b -= 1
	if s < 0:
		break
 
if a > 0 or b > 0:
	print(':(')
else:
	print('Yay!')

Fixed submission:
a, b = list(map(int, input().split()))
 
s = 16
for i in range(16):
	if i%2 == 0:
		if a > 0:
			s -= 1
			a -= 1
	else:
		if b > 0:
			s -= 1
			b -= 1
	if s < 0:
		break
 
if a > 0 or b > 0:
	print(':(')
else:
	print('Yay!')

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

s = 16
for i in range(16):
	if i%2 == 0:
		if a > 0:
			s -= 1
			a -= 1
	else:
		if b > 0:
			s -= 1
			b -= 1
	if s < 0:
		break

if a > 0 or b > 0:
	print(':(')
else:
	print('Yay!')

Fixed submission:
a, b = list(map(int, input().split()))
 
s = 16
for i in range(16):
	if i%2 == 0:
		if a > 0:
			s -= 1
			a -= 1
	else:
		if b > 0:
			s -= 1
			b -= 1
	if s < 0:
		break
 
if a > 0 or b > 0:
	print(':(')
else:
	print('Yay!')
Buggy python submission (verdict: Runtime Error):
d, n = map(int, input().split())

print([i for i in range(1, n+1) if i % (100**(d)) != 0][-1] * (100**(d)))

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

c = 0
i = 1
while True:
	if i % 100 != 0:
		c += 1
	if c == n:
		break
	i += 1

print(i * (100**(d)))
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):
n = int(input())
s = input()*n

ms = n
for i in range(n):
	c = s[0:i].count('W')
	c += s[i+1:n].count('E')
	print(s[0:i], s[i+1:n], c)
	if(ms >= c):
		ms = c
	else:
		break

print(ms)

Fixed submission:
n = int(input())
s = input()

ms = n
a = 0
b = s.count('E')
for i in range(n):
	if(i != 0 and s[i-1] == 'W'):
		a += 1
	if(s[i] == 'E'):
		b -= 1
	# print(s[0:i], s[i+1:n], s[0:i].count('W'), s[i+1:n].count('E'), a, b)
	# c = s[0:i].count('W')
	# c += s[i+1:n].count('E')
	c = a + b
	if(ms > c):
		ms = c

print(ms)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()

ms = n
for i in range(n):
	c = s[0:i].count('W')
	c += s[i+1:n].count('E')
	if(ms > c):
		ms = c

print(ms)

Fixed submission:
n = int(input())
s = input()

ms = n
a = 0
b = s.count('E')
for i in range(n):
	if(i != 0 and s[i-1] == 'W'):
		a += 1
	if(s[i] == 'E'):
		b -= 1
	# print(s[0:i], s[i+1:n], s[0:i].count('W'), s[i+1:n].count('E'), a, b)
	# c = s[0:i].count('W')
	# c += s[i+1:n].count('E')
	c = a + b
	if(ms > c):
		ms = c

print(ms)
Buggy python submission (verdict: Time Limit Exceeded):
import re

str = input()
k = int(input())

strl = list(set([c for c in str]))
strl.sort()

substring = []
for h in strl:
	compiled = re.compile(h)
	st = 0
	m = compiled.search(str, st)
	while m:
		sub = m.start()
		for i in range(sub, len(str)):
			t = str[sub:i+1]
			if(not (t in substring)):
				substring.append(t)
		st = sub + 1
		m = compiled.search(str, st)
	
	if(len(substring)-len(strl) >= k-1):
		break


substring.sort()
print(substring[k-1])

Fixed submission:
import re

str = input()
k = int(input())

strl = list(set([c for c in str]))
strl.sort()

substring = []
for h in strl:
	compiled = re.compile(h)
	st = 0
	m = compiled.search(str, st)
	while m:
		sub = m.start()
		for i in range(sub, min(len(str), sub+5)):
			t = str[sub:i+1]
			if(not (t in substring)):
				substring.append(t)
		st = sub + 1
		m = compiled.search(str, st)
	
	if(len(substring)-len(strl) >= k-1):
		break


substring.sort()
print(substring[k-1])

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

str = input()
k = int(input())

strl = list(set([c for c in str]))
strl.sort()

substring = []
for h in strl:
	compiled = re.compile(h)

	i = 0
	while i >= 0:
		m = compiled.search(str, i)
		if m:
			sub = m.start()
			for i in range(sub, len(str)):
				t = str[sub:i+1]
				if(not (t in substring)):
					substring.append(t)
			substring.sort()
			if(len(substring)-len(strl) >= k-1):
				break
			i = sub + 1
		else:
			break
	else:
		continue
	break


substring.sort()
print(substring[k-1])

Fixed submission:
import re

str = input()
k = int(input())

strl = list(set([c for c in str]))
strl.sort()

substring = []
for h in strl:
	compiled = re.compile(h)
	st = 0
	m = compiled.search(str, st)
	while m:
		sub = m.start()
		for i in range(sub, min(len(str), sub+5)):
			t = str[sub:i+1]
			if(not (t in substring)):
				substring.append(t)
		st = sub + 1
		m = compiled.search(str, st)
	
	if(len(substring)-len(strl) >= k-1):
		break


substring.sort()
print(substring[k-1])

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

strl = []
for c in str:
    if(not (c in strl)):
        strl.append(c)
strl.sort()

substring = []
for h in strl:
	sub = str.find(h)
	for i in range(sub, len(str)-1):
		t = str[sub:i+1]
		if(not (t in substring)):
			substring.append(t)
		# substring.sort()
		# if(substring[k-1] is str[sub:i+1]):
			# break
	# else:
		# continue
	# break


substring.sort()
print(substring[k-1])

Fixed submission:
import re

str = input()
k = int(input())

strl = list(set([c for c in str]))
strl.sort()

substring = []
for h in strl:
	compiled = re.compile(h)
	st = 0
	m = compiled.search(str, st)
	while m:
		sub = m.start()
		for i in range(sub, min(len(str), sub+5)):
			t = str[sub:i+1]
			if(not (t in substring)):
				substring.append(t)
		st = sub + 1
		m = compiled.search(str, st)
	
	if(len(substring)-len(strl) >= k-1):
		break


substring.sort()
print(substring[k-1])
Buggy python submission (verdict: Runtime Error):
import numpy as np

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

r = np.zeros(10**5+2)
for i in range(N):
    r[a[i]] += 1
    r[a[i]+1] += 1
    r[a[i]+2] += 1

print(int(r.max()))

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

r = [0] * (10**5+2)
for i in range(N):
    r[a[i]] += 1
    r[a[i]+1] += 1
    r[a[i]+2] += 1

print(max(r))