Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import numpy as np
x, y, z = map(int, input().split())
matrix1 = list()
matrix2 = list()
ans = list()
for i in range(x):
    matrix1.append(list(map(int, input().split())))
for i in range(y):
    matrix2.append(list(map(int, input().split())))
matrix1 = np.matrix(matrix1)
matrix2 = np.matrix(matrix2)
matrix3 = matrix1.dot(matrix2).tolist()
for i in range(x):
    print (' '.join(map(str, matrix3[i])))
        


Fixed submission:
x, y, z = map(int, input().split())
matrix1 = list()
matrix2 = list()
ans = list()
for i in range(x):
    matrix1.append(list(map(int, input().split())))
for j in range(y):
    matrix2.append(list(map(int, input().split())))
for i in range(x):
    row = list()
    for j in range(z):
        term = 0
        for k in range(y):
            term += matrix1[i][k]*matrix2[k][j] 
        row.append(term)
    ans.append(row)
for i in range(x):
    print (' '.join(map(str, ans[i])))

Buggy python submission (verdict: Runtime Error):
import numpy as np
x, y, z = map(int, input().split())
matrix1 = list()
matrix2 = list()
ans = list()
for i in range(x):
    matrix1.append(list(map(int, input().split())))
for i in range(y):
    matrix2.append(list(map(int, input().split())))
matrix1 = np.matrix(matrix1)
matrix2 = np.matrix(matrix2)
matrix3 = matrix1.dot(matrix2).tolist()
for i in range(x):
    print (' '.join(map(str, matrix3[i])))
        


Fixed submission:
x, y, z = map(int, input().split())
matrix1 = list()
matrix2 = list()
ans = list()
for i in range(x):
    matrix1.append(list(map(int, input().split())))
for j in range(y):
    matrix2.append(list(map(int, input().split())))
for i in range(x):
    row = list()
    for j in range(z):
        term = 0
        for k in range(y):
            term += matrix1[i][k]*matrix2[k][j] 
        row.append(term)
    ans.append(row)
for i in range(x):
    print (' '.join(map(str, ans[i])))
Buggy python submission (verdict: Runtime Error):
line=input().split()
x=int(line[0])
y=int(line[1])
r=x%y
while(r>0):
    x=y
    y=r
    r=x%y
return y

print(y)



Fixed submission:
line=input().split()
x=int(line[0])
y=int(line[1])
def gcd(x,y):
    r=x%y
    while(r>0):
        x=y
        y=r
        r=x%y
    return y
    
print (gcd(x,y))
Buggy python submission (verdict: Runtime Error):
x=input().split()
a=int(x[0])
b=int(x[1])

if 1<=a and a<=100 and 1<=b and b<=100:
  area=a*b
  cir=(a+b)*2
  print(area,cir)
else:
  print("error")


Fixed submission:
x=input().split()
a=int(x[0])
b=int(x[1])

if 1<=a and a<=100 and 1<=b and b<=100:
  area=a*b
  cir=(a+b)*2
  print(area,cir)
else:
  print("error")
Buggy python submission (verdict: Time Limit Exceeded):
def main() :
    n = int(input())
    nums = []
    for i in range(0, n) :
        x = int(input())
        nums.append(x)

    count = 0
    for i in nums :
        judge = 0
        for j in range(2, i) :
            if (i % j) != 0 :
                judge += 0
            else :
                judge += 1

        if judge == 0 :
            count += 1

    print(count)


if __name__ == '__main__' :
    main()

Fixed submission:
import math

def isPrime(x) :
    if x == 2 :
        return True

    if x < 2 or x % 2 == 0 :
        return False

    i = 3
    while i <= math.sqrt(x) :
        if x % i == 0 :
            return False
        i += 2

    return True


def main() :
    n = int(input())
    nums = []
    for i in range(n) :
        x = int(input())
        nums.append(x)

    print(sum(map(isPrime, nums)))


if __name__ == '__main__' :
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main() :
    n = int(input())
    nums = []
    for i in range(n) :
        x = int(input())
        nums.append(x)

    max = float("-inf")
    for i in range(n) :
        for j in range(i):
            if (nums[i] - nums[j]) > max :
                max = nums[i] - nums[j]

    print(max)



if __name__ == '__main__' :
    main()

Fixed submission:
def main() :
    n = int(input())
    nums = []
    for i in range(n) :
        x = int(input())
        nums.append(x)

    max = float("-inf")
    min = nums[0]
    for i in range(1,n) :
        if nums[i] - min > max :
            max = nums[i] - min

        if nums[i] < min :
            min = nums[i]

    print(max)



if __name__ == '__main__' :
    main()
Buggy python submission (verdict: Runtime Error):
# AOJ Circle in a Rctangle

def main() :
    W = input().split()[0]
    H = input().split()[1]
    x = input().split()[2]
    y = input().split()[3]
    r = input().split()[4]

    if ((x-r)>0) and ((x+r)<W) and ((y-r)>0) and ((y+r)<H) :
        print("Yes")
    else :
        print("No")

if __name__ == '__main__' :
    main()

Fixed submission:
def main() :
    W, H, x, y, r = [int(i) for i in input().split()]

    if (r <= x <= W-r) and (r <= y <= H-r) :
        print("Yes")
    else :
        print("No")

if __name__ == '__main__' :
    main()

Buggy python submission (verdict: Runtime Error):
def main() :
    W, H, x, y, r = [int(i) for i in input().split()]

    if ((x-r)>=0) and ((x+r)=<W) and ((y-r)>=0) and ((y+r)<=H) :
        print("Yes")
    else :
        print("No")

if __name__ == '__main__' :
    main()

Fixed submission:
def main() :
    W, H, x, y, r = [int(i) for i in input().split()]

    if (r <= x <= W-r) and (r <= y <= H-r) :
        print("Yes")
    else :
        print("No")

if __name__ == '__main__' :
    main()

Buggy python submission (verdict: Runtime Error):
def main() :
    W, H, x, y, r = [int(i) for i in input().split()]

   if ((x-r)>=0) and ((x+r)<=W) and ((y-r)>=0) and ((y+r)<=H) :
        print("Yes")
    else :
        print("No")

if __name__ == '__main__' :
    main()

Fixed submission:
def main() :
    W, H, x, y, r = [int(i) for i in input().split()]

    if (r <= x <= W-r) and (r <= y <= H-r) :
        print("Yes")
    else :
        print("No")

if __name__ == '__main__' :
    main()
Buggy python submission (verdict: Runtime Error):
def main() :
    lst = list(map(int, input().split()))
    count = 1
    for n in lst :
        if n == 0 :
            break
        else :
            print(f"case {count}: {n}")
            count += 1



if __name__ == '__main__' :
    main()

Fixed submission:
def main() :
    count = 1
    while True :
        n = input()
        if n == '0' :
            break
        else :
            print("Case {}: {}".format(count, n))
            count += 1


if __name__ == '__main__' :
    main()

Buggy python submission (verdict: Runtime Error):
def main() :
    lst = list(map(int, input().split()))
    count = 1
    for n in lst :
        if n == 0 :
            break
        else :
            print(f"case {count}: {n}")
            count += 1



if __name__ == '__main__' :
    main()

Fixed submission:
def main() :
    count = 1
    while True :
        n = input()
        if n == '0' :
            break
        else :
            print("Case {}: {}".format(count, n))
            count += 1


if __name__ == '__main__' :
    main()
Buggy python submission (verdict: Runtime Error):
def ask(X,Y):
 cost=[0]
 for j in Y:
  for i in range(len(cost)-1,-1,-1):
   a=X.find(c,cost[i])+1
   if a:
    if i+1<len(cost):
     cost[i+1]=min(cost[i+1],a)
    else:
     cost.append(a)
 return len(cost)-1
 


q=int(input())
Z=[]
for p in range(q):
 X=input()
 Y=input()
 z=ask(X,Y)
 Z.append(z)

for p in range(q):
 print(Z[p])



Fixed submission:
def ask(X,Y):
 cost=[0]
 for j in Y:
  for i in range(len(cost)-1,-1,-1):
   a=X.find(j,cost[i])+1
   if a:
    if i+1<len(cost):
     cost[i+1]=min(cost[i+1],a)
    else:
     cost.append(a)
 return len(cost)-1
 


q=int(input())
Z=[]
for p in range(q):
 X=input()
 Y=input()
 z=ask(X,Y)
 Z.append(z)

for p in range(q):
 print(Z[p])
Buggy python submission (verdict: Time Limit Exceeded):
#16D8101023J 久保田凌弥 kubotarouxxx python3

a=int(input())
A=[0]*a
x=0
for i in range(a):
 A[i]=int(input())
 for j in range(1,A[i]):
  if A[i]==2:
    x+=1
    continue
  if j==1:
   continue
  elif (A[i]%j)==0:
   break
  elif j==(A[i]-1):
   x+=1
   
print(x)


Fixed submission:
#16D8101023J 久保田凌弥 kubotarouxxx python3
import math as mh
a=int(input())
A=[0]*a
x=0
for i in range(a):
 A[i]=int(input())
 for j in range(1,A[i]):
  if A[i]==2:
    x+=1
    continue
  if j==1:
   continue
  elif (A[i]%j)==0:
   break
  elif j>=mh.sqrt(A[i]):
   x+=1
   break
print(x)

Buggy python submission (verdict: Time Limit Exceeded):
#16D8101023J 久保田凌弥 kubotarouxxx python3

a=int(input())
A=[0]*a
x=0
for i in range(a):
 A[i]=int(input())
 for j in range(1,A[i]):
  if A[i]==2:
    x+=1
    continue
  if j==1:
   continue
  elif (A[i]%j)==0:
   break
  elif j==(A[i]-1):
   x+=1
   
print(x)


Fixed submission:
#16D8101023J 久保田凌弥 kubotarouxxx python3
import math as mh
a=int(input())
A=[0]*a
x=0
for i in range(a):
 A[i]=int(input())
 for j in range(1,A[i]):
  if A[i]==2:
    x+=1
    continue
  if j==1:
   continue
  elif (A[i]%j)==0:
   break
  elif j>=mh.sqrt(A[i]):
   x+=1
   break
print(x)

Buggy python submission (verdict: Time Limit Exceeded):
#16D8101023J 久保田凌弥 kubotarouxxx python3

a=int(input())
A=[0]*a
x=0
for i in range(a):
 A[i]=int(input())
 for j in range(1,A[i]):
  if A[i]==2:
    x+=1
    continue
  if j==1:
   continue
  elif (A[i]%j)==0:
   break
  elif j==(A[i]-1):
   x+=1
   
print(x)


Fixed submission:
#16D8101023J 久保田凌弥 kubotarouxxx python3
import math as mh
a=int(input())
A=[0]*a
x=0
for i in range(a):
 A[i]=int(input())
 for j in range(1,A[i]):
  if A[i]==2:
    x+=1
    continue
  if j==1:
   continue
  elif (A[i]%j)==0:
   break
  elif j>=mh.sqrt(A[i]):
   x+=1
   break
print(x)
Buggy python submission (verdict: Runtime Error):
#16D8101023J 久保田凌弥 kubotarouxxx python3


stak = []
for i in input().split():
    if i in "+-*":
       a = stak.pop()
       b = stak.pop()
        stak.append(str(eval(b + i + a)))
    else:
        stak.append(i)
print(stak.pop())


Fixed submission:
stak = []
for i in input().split():
    if i in "+-*":
        x = stak.pop()
        y = stak.pop()
        stak.append(str(eval(y + i + x)))
    else:
        stak.append(i)
print(stak.pop())

Buggy python submission (verdict: Runtime Error):
stk = []
for c in input().split():
    if c in "+-*":
        a = stk.pop()
        b = stk.pop()
        stk.append(str(eval(b + c + a)))
    else:
        stk.append(c)
print(stk.pop(


Fixed submission:
stak = []
for i in input().split():
    if i in "+-*":
        x = stak.pop()
        y = stak.pop()
        stak.append(str(eval(y + i + x)))
    else:
        stak.append(i)
print(stak.pop())
Buggy python submission (verdict: Runtime Error):
A=[]
B=[]
a=0
x=0
for c in input():
 if"\\"==c:A+=[x]
 elif"/"==c and A:
  j=A.pop()
  t=x-j
  a+=t
  while B and B[-1][0]>j:t+=B[-1][1];B.pop()
  B+=[(j,t)]
 x+=1
print(a)
if p:print(len(B),*list(zip(*B))[1])
else:print(0)


Fixed submission:
A=[]
B=[]
a=0
i=0
for c in input():
 if"\\"==c:
  A+=[i]
 elif"/"==c and A:
  j=A.pop()
  t=i-j
  a+=t
  while B and B[-1][0]>j:
   t+=B[-1][1];B.pop()
  B+=[(j,t)]
 i+=1
print(a)
if B:
 print(len(B),*list(zip(*B))[1])
else:
 print(0)

Buggy python submission (verdict: Runtime Error):
A=[]
B=[]
a=i=0
for c in input():
 if"\\"==c:A+=[i]
 elif"/"==c and A:
  j=A.pop()
  t=i-j
  a+=t
  while B and B[-1][0]>j:t+=B[-1][1];B.pop()
  B+=[(j,t)]
 i+=1
print(a)
if p:print(len(B),*list(zip(*B))[1])
else:print(0)


Fixed submission:
A=[]
B=[]
a=0
i=0
for c in input():
 if"\\"==c:
  A+=[i]
 elif"/"==c and A:
  j=A.pop()
  t=i-j
  a+=t
  while B and B[-1][0]>j:
   t+=B[-1][1];B.pop()
  B+=[(j,t)]
 i+=1
print(a)
if B:
 print(len(B),*list(zip(*B))[1])
else:
 print(0)

Buggy python submission (verdict: Runtime Error):
x=[]
y=[]
a=i=0
for c in input():
 if"\\"==c:x+=[i]
 elif"/"==c and x:
  j=x.pop()
  t=i-j
  a+=t
  while y and y[-1][0]>j:t+=y[-1][1];y.pop()
  y+=[(j,t)]
 i+=1
print(a)
if p:print(len(y),*list(zip(*y))[1])
else:print(0)


Fixed submission:
A=[]
B=[]
a=0
i=0
for c in input():
 if"\\"==c:
  A+=[i]
 elif"/"==c and A:
  j=A.pop()
  t=i-j
  a+=t
  while B and B[-1][0]>j:
   t+=B[-1][1];B.pop()
  B+=[(j,t)]
 i+=1
print(a)
if B:
 print(len(B),*list(zip(*B))[1])
else:
 print(0)
Buggy python submission (verdict: Runtime Error):
n=input()
A={}
for i in range(n):
     x,y=input().split()
     if x=='insert':
         d.add(y)
     else:
         if b in d:
            print('yes')
         else:
            print('no')


Fixed submission:
n=int(input())
A=set()
for i in range(n):
     x,y=input().split()
     if x == 'insert':
         A.add(y)
     else:
         print('yes'*(y in A)or'no')

Buggy python submission (verdict: Runtime Error):
n=input()
A={}
for i in range(n):
     x,y=input().split()
     if x=='insert':
         A.add(y)
     else:
         if A in y:
            print('yes')
         else:
            print('no')


Fixed submission:
n=int(input())
A=set()
for i in range(n):
     x,y=input().split()
     if x == 'insert':
         A.add(y)
     else:
         print('yes'*(y in A)or'no')

Buggy python submission (verdict: Runtime Error):
n=input()
A=set()
for i in range(n):
     x,y=input().split()
     if x=='insert':
         A.add(y)
     else:
         if A in y:
            print('yes')
         else:
            print('no')


Fixed submission:
n=int(input())
A=set()
for i in range(n):
     x,y=input().split()
     if x == 'insert':
         A.add(y)
     else:
         print('yes'*(y in A)or'no')

Buggy python submission (verdict: Runtime Error):
n=int(input())
A=set()
for i in range(n):
     x,y=input().split()
     if x=='insert':
         A.add(y)
     else:
         if A in y:
            print('yes')
         else:
            print('no')


Fixed submission:
n=int(input())
A=set()
for i in range(n):
     x,y=input().split()
     if x == 'insert':
         A.add(y)
     else:
         print('yes'*(y in A)or'no')
Buggy python submission (verdict: Runtime Error):
def search(X,Y):

 n=len(X)
 m=len(Y)
 p=[i for i in range(m+1)]
 for i in range(n):
  q=list(range(m+1))
  q[0] = i+1
  for j in range(m):
   if X[i]==Y[j]:
    cost=0
   else:
    cost=1
   q[j+1]=min(p[j+1]+1,q[j]+1,p[j]+cost)
  p,q=q,p
 
 return pre[m]


X=input()
Y=input()

print(search(X,Y))



Fixed submission:
def search(X,Y):

 n=len(X)
 m=len(Y)
 p=[i for i in range(m+1)]
 for i in range(n):
  q=list(range(m+1))
  q[0] = i+1
  for j in range(m):
   if X[i]==Y[j]:
    cost=0
   else:
    cost=1
   q[j+1]=min(p[j+1]+1,q[j]+1,p[j]+cost)
  p,q=q,p
 
 return p[m]


X=input()
Y=input()

print(search(X,Y))
Buggy python submission (verdict: Runtime Error):
#16D8101023J 久保田凌弥 kubotarouxxx python

x=int(input())

y=x**3

print("y")


Fixed submission:
# 16D8101023J 久保田凌弥 kubotarouxxx python

x=int(input(""))

y=x**3

print(y)

Buggy python submission (verdict: Runtime Error):
#16D8101023J 久保田凌弥 kubotarouxxx python

x=int(input())

y=x**3

print(y)


Fixed submission:
# 16D8101023J 久保田凌弥 kubotarouxxx python

x=int(input(""))

y=x**3

print(y)

Buggy python submission (verdict: Runtime Error):
#16D8101023J 久保田凌弥 kubotarouxxx python

x=int(input(""))

y=x**3

print(y)


Fixed submission:
# 16D8101023J 久保田凌弥 kubotarouxxx python

x=int(input(""))

y=x**3

print(y)

Buggy python submission (verdict: Runtime Error):
# 16D8101023J 久保田凌弥 kubotarouxxx python

x=int(input(""))

y=x**3

print(y)


Fixed submission:
# 16D8101023J 久保田凌弥 kubotarouxxx python

x=int(input(""))

y=x**3

print(y)
Buggy python submission (verdict: Runtime Error):
#16D8101023J 久保田凌弥 kubotarouxxx python3

x=int(input())
y=int(input())

w=x*y
z=2*x+2*y

print(w)
print(z)


Fixed submission:
#16D8101023J 久保田凌弥 kubotarouxxx python3

x,y=map(int, input().split())
w=x*y
z=2*x+2*y

print(w,z)

#

Buggy python submission (verdict: Runtime Error):
#16D8101023J 久保田凌弥 kubotarouxxx python3

x=int(input())
y=int(input())

w=x*y
z=2*x+2*y

print(w)
print(z)


Fixed submission:
#16D8101023J 久保田凌弥 kubotarouxxx python3

x,y=map(int, input().split())
w=x*y
z=2*x+2*y

print(w,z)

#

Buggy python submission (verdict: Runtime Error):
#16D8101023J 久保田凌弥 kubotarouxxx python3

x=int(input())
y=int(input())

w=x*y
z=2*x+2*y

print(w,z)



Fixed submission:
#16D8101023J 久保田凌弥 kubotarouxxx python3

x,y=map(int, input().split())
w=x*y
z=2*x+2*y

print(w,z)

#

Buggy python submission (verdict: Runtime Error):
#16D8101023J 久保田凌弥 kubotarouxxx python3

x=int(input())
y=int(input())

w=x*y
z=x*2+y*2

print(w,z)



Fixed submission:
#16D8101023J 久保田凌弥 kubotarouxxx python3

x,y=map(int, input().split())
w=x*y
z=2*x+2*y

print(w,z)

#

Buggy python submission (verdict: Runtime Error):
#16D8101023J 久保田凌弥 kubotarouxxx python3

x=int(input())
y=int(input())

w=x*y
z=2*(x+y)

print(w,z)



Fixed submission:
#16D8101023J 久保田凌弥 kubotarouxxx python3

x,y=map(int, input().split())
w=x*y
z=2*x+2*y

print(w,z)

#

Buggy python submission (verdict: Runtime Error):
#16D8101023J 久保田凌弥 kubotarouxxx python3

x=int(input())
y=int(input())

w=x*y
z=2*(x+y)

print(w,z)



Fixed submission:
#16D8101023J 久保田凌弥 kubotarouxxx python3

x,y=map(int, input().split())
w=x*y
z=2*x+2*y

print(w,z)

#

Buggy python submission (verdict: Runtime Error):
#16D8101023J 久保田凌弥 kubotarouxxx python3

(x,y)=int(input())

w=x*y
z=2*x+2*y

print(w,z)



Fixed submission:
#16D8101023J 久保田凌弥 kubotarouxxx python3

x,y=map(int, input().split())
w=x*y
z=2*x+2*y

print(w,z)

#

Buggy python submission (verdict: Runtime Error):
#16D8101023J 久保田凌弥 kubotarouxxx python3

x,y=map(int, raw_input().split())
w=x*y
z=2*x+2*y

print(w,z)



Fixed submission:
#16D8101023J 久保田凌弥 kubotarouxxx python3

x,y=map(int, input().split())
w=x*y
z=2*x+2*y

print(w,z)

#

Buggy python submission (verdict: Runtime Error):
#16D8101023J 久保田凌弥 kubotarouxxx python3

x,y=map(int, raw_input().split())
w=x*y
z=2*x+2*y

print(w,z)



Fixed submission:
#16D8101023J 久保田凌弥 kubotarouxxx python3

x,y=map(int, input().split())
w=x*y
z=2*x+2*y

print(w,z)

#
Buggy python submission (verdict: Runtime Error):
n, m =map(int,input().split())
c = list(map(int,input().split()))

INF = 10**10
dp = [INF]*50000
dp[0] = 0

for i in range (n+1):
    for j in c:
        dp[i+j] = min(dp[i+j],dp[i]+1)
print(dp[n])


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

INF = 10**100
dp = [INF]*500000
dp[0] = 0

for i in range (n+1):
    for j in c:
        dp[i+j] = min(dp[i+j],dp[i]+1)
print(dp[n])

Buggy python submission (verdict: Runtime Error):
n, m =map(int,input().split())
c = list(map(int,input().split()))

INF = 10**10
dp = [INF]*50000
dp[0] = 0

for i in range (n+1):
    for j in c:
        dp[i+j] = min(dp[i+j],dp[i]+1)
print(dp[n])


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

INF = 10**100
dp = [INF]*500000
dp[0] = 0

for i in range (n+1):
    for j in c:
        dp[i+j] = min(dp[i+j],dp[i]+1)
print(dp[n])

Buggy python submission (verdict: Runtime Error):
n, m =map(int,input().split())
c = list(map(int,input().split()))

INF = 10**10
dp = [INF]*500
dp[0] = 0

for i in range (n+1):
    for j in c:
        dp[i+j] = min(dp[i+j],dp[i]+1)
print(dp[n])


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

INF = 10**100
dp = [INF]*500000
dp[0] = 0

for i in range (n+1):
    for j in c:
        dp[i+j] = min(dp[i+j],dp[i]+1)
print(dp[n])

Buggy python submission (verdict: Runtime Error):
n, m =map(int,input().split())
c = list(map(int,input().split()))

INF = 10**10
dp = [INF]*(n+max(c))
dp[0] = 0

for i in range (n+1):
    for j in c:
        dp[i+j] = min(dp[i+j],dp[i]+1)
print(dp[n])


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

INF = 10**100
dp = [INF]*500000
dp[0] = 0

for i in range (n+1):
    for j in c:
        dp[i+j] = min(dp[i+j],dp[i]+1)
print(dp[n])

Buggy python submission (verdict: Runtime Error):
n, m =map(int,input().split())
c = list(map(int,input().split()))

INF = 10**10
dp = [INF]*(n**2)
dp[0] = 0

for i in range (n+1):
    for j in c:
        dp[i+j] = min(dp[i+j],dp[i]+1)
print(dp[n])


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

INF = 10**100
dp = [INF]*500000
dp[0] = 0

for i in range (n+1):
    for j in c:
        dp[i+j] = min(dp[i+j],dp[i]+1)
print(dp[n])
Buggy python submission (verdict: Runtime Error):
import numpy as np
N,W = map(int,input().split())

weight = [0]*N
value = [0]*N
dp = np.zeros((N+1,W+1))

for i in range(N):
    value[i], weight[i] = map(int, input().split())

for i in range(N):
    for j in range(W+1):
        if j >= weight[i]: 
            dp[i+1][j] = max(dp[i][j-weight[i]]+value[i], dp[i][j]) 
        else: 
            dp[i+1][j] = dp[i][j]
print(int(dp[N][W]))


Fixed submission:
N, W =map(int,input().split())
 
INF = 10**10
#dp = [[INF]*100000]*(N*100)#余分に
dp = [[0 for i in range(W+1)] for j in range(N+1)]

for i in range (N):
    dp[i][0] =0
for j in range (W+1):
    dp[0][j] =0
    

for i in range (N):
    v, w = map(int,input().split())
    for j in range (W+1):
        if j-w>=0:
            dp[i+1][j] = max(dp[i][j],dp[i][j-w]+v)
        else:
            dp[i+1][j] = dp[i][j]


print(dp[N][W])

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


Fixed submission:
N, W =map(int,input().split())
 
INF = 10**10
#dp = [[INF]*100000]*(N*100)#余分に
dp = [[0 for i in range(W+1)] for j in range(N+1)]

for i in range (N):
    dp[i][0] =0
for j in range (W+1):
    dp[0][j] =0
    

for i in range (N):
    v, w = map(int,input().split())
    for j in range (W+1):
        if j-w>=0:
            dp[i+1][j] = max(dp[i][j],dp[i][j-w]+v)
        else:
            dp[i+1][j] = dp[i][j]


print(dp[N][W])