Buggy python submission (verdict: Runtime Error):
N,W=map(int,input().split())

items=[]

for i in range(N):
    items.append(list(map(int,input().split())))
    
dp = [[0 for i in range(100)] for j in range(100)]

for i in range(N):
    dp[i][0]=0
    
for i in range(N):
    for w in range(W+1):
        if w>=items[i][1]:
            dp[i+1][w]=max(dp[i][w-items[i][1]]+items[i][0],dp[i][w])
        else:
            dp[i+1][w]=dp[i][w]
        


print(dp[N][W])



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

items=[]

for i in range(N):
    items.append(list(map(int,input().split())))
    
dp = [[0 for i in range(10001)] for j in range(110)]

for i in range(N):
    dp[i][0]=0
    
for i in range(N):
    for w in range(W+1):
        if w>=items[i][1]:
            dp[i+1][w]=max(dp[i][w-items[i][1]]+items[i][0],dp[i][w])
        else:
            dp[i+1][w]=dp[i][w]
        


print(dp[N][W])

Buggy python submission (verdict: Runtime Error):
N,W=map(int,input().split())

items=[]

for i in range(N):
    items.append(list(map(int,input().split())))
    
dp = [[0 for i in range(10000)] for j in range(100)]

for i in range(N):
    dp[i][0]=0
    
for i in range(N):
    for w in range(W+1):
        if w>=items[i][1]:
            dp[i+1][w]=max(dp[i][w-items[i][1]]+items[i][0],dp[i][w])
        else:
            dp[i+1][w]=dp[i][w]
        


print(dp[N][W])


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

items=[]

for i in range(N):
    items.append(list(map(int,input().split())))
    
dp = [[0 for i in range(10001)] for j in range(110)]

for i in range(N):
    dp[i][0]=0
    
for i in range(N):
    for w in range(W+1):
        if w>=items[i][1]:
            dp[i+1][w]=max(dp[i][w-items[i][1]]+items[i][0],dp[i][w])
        else:
            dp[i+1][w]=dp[i][w]
        


print(dp[N][W])

Buggy python submission (verdict: Runtime Error):
N,W=map(int,input().split())

items=[]

for i in range(N):
    items.append(list(map(int,input().split())))
    
dp = [[0 for i in range(10000)] for j in range(100)]

for i in range(N):
    dp[i][0]=0
    
for i in range(N):
    for w in range(W+1):
        if w>=items[i][1]:
            dp[i+1][w]=max(dp[i][w-items[i][1]]+items[i][0],dp[i][w])
        else:
            dp[i+1][w]=dp[i][w]
        


print(dp[N][W])


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

items=[]

for i in range(N):
    items.append(list(map(int,input().split())))
    
dp = [[0 for i in range(10001)] for j in range(110)]

for i in range(N):
    dp[i][0]=0
    
for i in range(N):
    for w in range(W+1):
        if w>=items[i][1]:
            dp[i+1][w]=max(dp[i][w-items[i][1]]+items[i][0],dp[i][w])
        else:
            dp[i+1][w]=dp[i][w]
        


print(dp[N][W])

Buggy python submission (verdict: Runtime Error):
N,W=map(int,input().split())

items=[]

for i in range(N):
    items.append(list(map(int,input().split())))
    
dp = [[0 for i in range(10001)] for j in range(100)]

for i in range(N):
    dp[i][0]=0
    
for i in range(N):
    for w in range(W+1):
        if w>=items[i][1]:
            dp[i+1][w]=max(dp[i][w-items[i][1]]+items[i][0],dp[i][w])
        else:
            dp[i+1][w]=dp[i][w]
        


print(dp[N][W])


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

items=[]

for i in range(N):
    items.append(list(map(int,input().split())))
    
dp = [[0 for i in range(10001)] for j in range(110)]

for i in range(N):
    dp[i][0]=0
    
for i in range(N):
    for w in range(W+1):
        if w>=items[i][1]:
            dp[i+1][w]=max(dp[i][w-items[i][1]]+items[i][0],dp[i][w])
        else:
            dp[i+1][w]=dp[i][w]
        


print(dp[N][W])