Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
MOD = 1000000007
from collections import defaultdict as dd,Counter,deque

def si(): return input()
def ii(): return int(input())
def li(): return list(map(int,input().split()))
def mi(): return map(int,input().split())
def out(v): print(v)
def spout(): print(v,end=" ")
def d2b(n): return bin(n).replace("0b","")
def twod(n,m,num):return [[num for x in range(m)] for y in range(n)]
def vow(): return ['a','e','i','o','u']
def let(): return [chr(i) for i in range(97,123)]
def gcd(x, y):
    while y:
        x, y = y, x % y
    return x
def ispow2(x):
    return (x and (not(x & (x - 1))))
def prime_factors(n):
    i = 2
    factors = []
    while i * i <= n:
        if n % i: i+=1
        else:
            n //= i
            factors.append(i)
    if n > 1: factors.append(n)
    return (list(factors))
  
s=si()
for i in range(3):
  if s[i]=="S":
    c+=1
if c<2 or c==3: print(c)
else:
  if s[1]=="S": print(2)
  else: print(1)

Fixed submission:
s=input()
c=0
for i in range(3):
  if s[i]=="R":
    c+=1
if c<2 or c==3: print(c)
else:
  if s[1]=="R": print(2)
  else: print(1)
Buggy python submission (verdict: Runtime Error):
#! python3
# coding:utf-8
 
def main():
    n = int(input())
    for i in range(1,n+1):
        cnt=0
    
        for x in range(1,100):
            for y in range(1,100):
                for z in range(1,100):
                    
                    tmp2 = x*y + y*z + z*x
                    if (tmp2>i):
                        continue
                    tmp1 = x**2 + y**2 + z**2   
                    if (tmp1 + tmp2) == i:
                        cnt+=1
        print(cnt)

if __name__ == "__main__":
    main() 

Fixed submission:
#! python3
# coding:utf-8

l,r,d = map(int,input().split())
cnt = 0
for i in range(l,r+1):
    if i%d == 0:
        cnt+=1

print(cnt)

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

n = int(input())
for i in range(1,n+1):
    cnt=0

    for x in range(1,n+1):
        if x > 100:
            continue
        for y in range(1,n-x+1):
            for z in range(1,n-x-y+1):
                eq = x**2 + y**2 + z**2 + x*y + y*z + z*x
                   
                if eq == i:
                    cnt+=1
    print(cnt)

Fixed submission:
#! python3
# coding:utf-8

l,r,d = map(int,input().split())
cnt = 0
for i in range(l,r+1):
    if i%d == 0:
        cnt+=1

print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = map(int, input().split())

A = []
for i in range(Q):
    A.append(int(input()))

#print(N,K,Q)
#print(A)

P = [K for _ in range(N)]
#print(P)
for a in A:
    for n in range(N):
        if (n==(a-1)):
            P[n] += 1

#print(P)

for n in range(N):
    if(P[n]-Q>0):
        print('Yes')
    else:
        print('No')

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

A = []
for i in range(Q):
    A.append(int(input()))

#print(N,K,Q)
#print(A)

P = [K for _ in range(N)]
#print(P)
for a in A:
    P[a-1] += 1

#print(P)

for n in range(N):
    if(P[n]-Q>0):
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = map(int, input().split())

A = []
for i in range(Q):
    A.append(int(input()))

#print(N,K,Q)
#print(A)

P = [K for _ in range(N)]
#print(P)
for a in A:
    for n in range(N):
        if not(n==(a-1)):
            P[n] -= 1

#print(P)

for n in range(N):
    if(P[n]>0):
        print('Yes')
    else:
        print('No')

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

A = []
for i in range(Q):
    A.append(int(input()))

#print(N,K,Q)
#print(A)

P = [K for _ in range(N)]
#print(P)
for a in A:
    P[a-1] += 1

#print(P)

for n in range(N):
    if(P[n]-Q>0):
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!
from collections import Counter

S = input()
S = list(S)


c1 = Counter(S).most_common(2)[0][1]
c2 = Counter(S).most_common(2)[1][1]

if(c1==c2):
    if(c1==2):
        print("Yes")
    else:
        print("No")
else:
    print("No")

Fixed submission:
# coding: utf-8
# Your code here!
from collections import Counter

S = input()
S = list(S)


if(Counter(S).most_common(2)[0][1]!=4):
    c1 = Counter(S).most_common(2)[0][1]
    c2 = Counter(S).most_common(2)[1][1]
    if(c1==c2):
        if(c1==2):
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!
from collections import Counter

S = input()
S = list(S)


c1 = Counter(S).most_common(2)[0][1]
c2 = Counter(S).most_common(2)[1][1]

if(c1==c2):
    if(c1==2):
        print("Yes")
    else:
        print("No")
else:
    print("No")

Fixed submission:
# coding: utf-8
# Your code here!
from collections import Counter

S = input()
S = list(S)


if(Counter(S).most_common(2)[0][1]!=4):
    c1 = Counter(S).most_common(2)[0][1]
    c2 = Counter(S).most_common(2)[1][1]
    if(c1==c2):
        if(c1==2):
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
from operator import itemgetter
              

N, M = map(int, input().split())
A = input().split()
A = list(map(int, A))
A.sort()


cng = []
for i in range(M):
    B, C = map(int, input().split())
    cng.append((B,C))
    
cng = sorted(cng, key=itemgetter(1),reverse=True)

f=1
i=0
crd_cnt=0
crd_idx=0
while(f==1):
    if(A[i]<=cng[crd_idx][1]):
        A[i] = cng[crd_idx][1]
        crd_cnt += 1
    else:
        f=0

    if(N==crd_cnt):
        f=0

    if(crd_cnt==cng[crd_idx][0]):
        crd_idx += 1
        crd_cnt = 0
    
    if(M==crd_idx):
        f=0
    
    i+=1

print(sum(A))

Fixed submission:
from operator import itemgetter
              

N, M = map(int, input().split())
A = input().split()
A = list(map(int, A))
A.sort()


cng = []
for i in range(M):
    B, C = map(int, input().split())
    cng.append((B,C))
    
cng = sorted(cng, key=itemgetter(1),reverse=True)

f=1
i=0
crd_cnt=0
crd_idx=0
while(f==1):
    if(A[i]<=cng[crd_idx][1]):
        A[i] = cng[crd_idx][1]
        crd_cnt += 1
    else:
        f=0

    if(N==crd_cnt):
        f=0

    if(crd_cnt==cng[crd_idx][0]):
        crd_idx += 1
        crd_cnt = 0
    
    if(M==crd_idx):
        f=0
    elif(i+1==N):
        f=0
    
    i+=1

print(sum(A))

Buggy python submission (verdict: Runtime Error):
from operator import itemgetter
              

N, M = map(int, input().split())
A = input().split()
A = list(map(int, A))
A.sort()

cng = []
for i in range(M):
    B, C = map(int, input().split())
    cng.append((B,C))
    
cng = sorted(cng, key=itemgetter(1),reverse=True)
f=1
i=0
crd_cnt=0
crd_idx=0
while(f==1):
    if(A[i]<=cng[crd_idx][1]):
        A[i] = cng[crd_idx][1]
        crd_cnt += 1
    else:
        f=0
        
    if(crd_cnt==cng[crd_idx][0]):
        crd_idx += 1
        crd_cnt = 0
    
    if(M==crd_idx):
        f=0
    
    i+=1

print(sum(A))

Fixed submission:
from operator import itemgetter
              

N, M = map(int, input().split())
A = input().split()
A = list(map(int, A))
A.sort()


cng = []
for i in range(M):
    B, C = map(int, input().split())
    cng.append((B,C))
    
cng = sorted(cng, key=itemgetter(1),reverse=True)

f=1
i=0
crd_cnt=0
crd_idx=0
while(f==1):
    if(A[i]<=cng[crd_idx][1]):
        A[i] = cng[crd_idx][1]
        crd_cnt += 1
    else:
        f=0

    if(N==crd_cnt):
        f=0

    if(crd_cnt==cng[crd_idx][0]):
        crd_idx += 1
        crd_cnt = 0
    
    if(M==crd_idx):
        f=0
    elif(i+1==N):
        f=0
    
    i+=1

print(sum(A))
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
h, w = map(int, input().split())

print((H-h)*(W-w))

Fixed submission:
import sys
 
 
H,W = sys.stdin.readline().strip().split()
H = int(H)
W = int(W)
 
h,w = sys.stdin.readline().strip().split()
h = int(h)
w = int(w)

ans = (H-h)*(W-w)
ans = int(ans)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
 
 
N,M = sys.stdin.readline().strip().split()
N = int(N)
M = int(M)

A = []
B = []
for i in range(N):
    a,b = sys.stdin.readline().strip().split()
    A.append(int(a))
    B.append(int(b))
    
#print(A,B)

#print(A.index(min(A)))

num=0
money=0
num_tmp=0
while(num<M):
#    print("A!",A)
#    print("B!",B)
    if(len(A)>1):
        cheap_index = A.index(min(A))
        if(M-num<B[cheap_index]):
            num_tmp = M - num
            num += num_tmp
        else:
#            print("else num_tmp",B[cheap_index])
            num_tmp = B[cheap_index]
            num += num_tmp
        money += min(A) * num_tmp
        A.pop(cheap_index)
        B.pop(cheap_index)
#        print("num_tmp",num_tmp)
#        print("m,num", money,num)
    else:
        num_tmp = M - num
        num += num_tmp
        money += A[0] * num_tmp
#        print(money,num)
        
print(money)

Fixed submission:

import sys
 
 
N,M = sys.stdin.readline().strip().split()
N = int(N)
M = int(M)

A = []
B = []
for i in range(N):
    a,b = sys.stdin.readline().strip().split()
    A.append(int(a))
    B.append(int(b))

#print(A)
#print(B)
comb = zip(A,B)
comb = sorted(comb)
#print(comb)
#print(comb[0][1])


num=0
money=0
num_tmp=0
while(num<M):
    if(len(comb)>1):
        if(M-num<comb[0][1]):
            num_tmp = M - num
            num += num_tmp
        else:
#            print("else num_tmp",B[cheap_index])
            num_tmp = comb[0][1]
            num += num_tmp
        money += comb[0][0] * num_tmp
        comb.pop(0)
#        print("num_tmp",num_tmp)
#        print("m,num", money,num)
    else:
        num_tmp = M - num
        num += num_tmp
        money += comb[0][0] * num_tmp
#        print(money,num)
        
print(money)
Buggy python submission (verdict: Runtime Error):
import sys
import numba


S_raw = sys.stdin.readline().strip()

@numba.jit
def check_next(S):
    S = list(S)
    before_num=S[0]
    for i in range(len(S)):
        if S[i]!=before_num:
            S.pop(i-1)
            #S = list(S)
            S.pop(i-1)
            new_S = S
            return S,1
            break
    return S,0


cnt=0
N=0

while cnt<50000:
    S_raw, check_cnt = check_next(S_raw)
    N += check_cnt
    if check_cnt==0:
        break
    cnt+=1
    
print(N*2)

Fixed submission:
S = input()

num0 = S.count("0")
num1 = len(S)-num0

print(min(num0,num1)*2)

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


S_raw = sys.stdin.readline().strip()

def check_next(S):
    S = list(S)
    before_num=S[0]
    for i in range(len(S)):
        if S[i]!=before_num:
            S.pop(i-1)
            #S = list(S)
            S.pop(i-1)
            new_S = S
            return S,1
            break
    return S,0


cnt=0
N=0

while cnt<50000:
    S_raw, check_cnt = check_next(S_raw)
    N += check_cnt
    if check_cnt==0:
        break
    cnt+=1
    
print(N*2)

Fixed submission:
S = input()

num0 = S.count("0")
num1 = len(S)-num0

print(min(num0,num1)*2)

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


S_raw = sys.stdin.readline().strip()

def check_next(S):
    S = list(S)
    before_num=S[0]
    for i in range(len(S)):
        if S[i]!=before_num:
            S.pop(i-1)
            #S = list(S)
            S.pop(i-1)
            new_S = S
            return S,1
            break
    return S,0


cnt=0
N=0

while cnt<10**5:
    S_raw, check_cnt = check_next(S_raw)
    N += check_cnt
    if check_cnt==0:
        break
    cnt+=1
    
print(N*2)

Fixed submission:
S = input()

num0 = S.count("0")
num1 = len(S)-num0

print(min(num0,num1)*2)

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


S_raw = sys.stdin.readline().strip()

def check_next(S):
    S = list(S)
    before_num=S[0]
    for i in range(len(S)):
        if S[i]!=before_num:
            S.pop(i-1)
            #S = list(S)
            S.pop(i-1)
            new_S = S
            return S,1
            break
    return S,0


cnt=0
N=0

while cnt<20:
    S_raw, check_cnt = check_next(S_raw)
    N += check_cnt
    if check_cnt==0:
        break
    cnt+=1
    
print(N*2)

Fixed submission:
S = input()

num0 = S.count("0")
num1 = len(S)-num0

print(min(num0,num1)*2)

Buggy python submission (verdict: Time Limit Exceeded):
import sys


S_raw = sys.stdin.readline().strip()

def check_next(S):
    S = list(S)
    before_num=S[0]
    for i in range(len(S)):
        if S[i]!=before_num:
            S.pop(i-1)
            #S = list(S)
            S.pop(i-1)
            new_S = S
            return S,1
            break
    return S,0


cnt=0
N=0

while cnt<10**5:
    S_raw, check_cnt = check_next(S_raw)
    N += check_cnt
    if not S_raw:
        break
    cnt+=1
    
print(N*2)

Fixed submission:
S = input()

num0 = S.count("0")
num1 = len(S)-num0

print(min(num0,num1)*2)
Buggy python submission (verdict: Runtime Error):
import sys
input_lines = sys.stdin.readline()
y,m,d = input_lines.split("/")

if(m>4):
    print(Heisei)
else:
    print(TBD)

Fixed submission:
import sys
input_lines = sys.stdin.readline()
y,m,d = input_lines.split("/")


if(int(m)<=4):
    print("Heisei")
else:
    print("TBD")
Buggy python submission (verdict: Runtime Error):
import sys
input_lines = sys.stdin.readlines()
a,b = input_lines.split( )

a = int(a)
b = int(b)

if(b%a==0):
  print(a+b)
else:
  print(b-a)
 


Fixed submission:
import sys
input_lines = sys.stdin.readline()
a,b = input_lines.split( )

a = int(a)
b = int(b)

if(b%a==0):
  print(a+b)
else:
  print(b-a)

Buggy python submission (verdict: Runtime Error):
import sys
input_lines = sys.stdin.readlines()
a,b = input_lines.split( )

if(b%a==0):
  print(a+b)
else:
  print(b-a)

Fixed submission:
import sys
input_lines = sys.stdin.readline()
a,b = input_lines.split( )

a = int(a)
b = int(b)

if(b%a==0):
  print(a+b)
else:
  print(b-a)

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

if(b%a==0):
  print(a+b)
else:
  print(b-a)

Fixed submission:
import sys
input_lines = sys.stdin.readline()
a,b = input_lines.split( )

a = int(a)
b = int(b)

if(b%a==0):
  print(a+b)
else:
  print(b-a)
Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
import sys
import collections

N = int(sys.stdin.readline())

monster = [int(a) for a in sys.stdin.readline().strip().split()]
monster.sort()

while len(monster)>1:
    monster[1] %= monster[0]
    if monster[1] == 0:
        monster.pop(1)
    monster.sort()


print(monster[0])

Fixed submission:
# coding: utf-8
import sys
import collections

N = int(sys.stdin.readline())

monster = [int(a) for a in sys.stdin.readline().strip().split()]
monster.sort()

while len(monster)>1:
    for i in range(1,len(monster)):
        monster[i] %= monster[0]
    monster.sort()
    while monster[0]==0:
        monster.pop(0)
    


print(monster[0])
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = sorted(list(map(int,input().split())))
ans = A[0]
if ans == 0:
    print(ans)
    exit()
else:
    for i in range(1,N):
        ans = ans * A[i]
    	if ans > 10**18:
        	ans = -1
            break
    print(ans)

Fixed submission:
N = int(input())
A = sorted(list(map(int,input().split())))
ans = A[0]
if ans == 0:
    print(ans)
    exit()
else:
    for i in range(1,N):
        ans = ans * A[i]
        if ans > 10**18:
            ans = -1
            break
    print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = sorted(list(map(int,input().split())))
ans = A[0]
if ans == 0:
    print(ans)
    exit()
else:
    for i in range(1,N):
        ans = ans * A[i]
    	if ans > 10**18:
        	ans = -1
            break
    print(ans)

Fixed submission:
N = int(input())
A = sorted(list(map(int,input().split())))
ans = A[0]
if ans == 0:
    print(ans)
    exit()
else:
    for i in range(1,N):
        ans = ans * A[i]
        if ans > 10**18:
            ans = -1
            break
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = sorted(list(map(int,input().split())))
ans = A[0]
if ans == 0:
    print(ans)
    exit()
else:
    for i in range(1,N):
        ans = ans * A[i]
    if ans > 10**18:
        ans = -1
    print(ans)

Fixed submission:
N = int(input())
A = sorted(list(map(int,input().split())))
ans = A[0]
if ans == 0:
    print(ans)
    exit()
else:
    for i in range(1,N):
        ans = ans * A[i]
        if ans > 10**18:
            ans = -1
            break
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
ans = A[0]
for i in range(1,N):
    ans = ans * A[i]
if ans > 10**18:
    ans = -1
print(ans)

Fixed submission:
N = int(input())
A = sorted(list(map(int,input().split())))
ans = A[0]
if ans == 0:
    print(ans)
    exit()
else:
    for i in range(1,N):
        ans = ans * A[i]
        if ans > 10**18:
            ans = -1
            break
    print(ans)
Buggy python submission (verdict: Runtime Error):
K,N=map(int,input())
A=list(map(int,input().split())
L_max=0
for i in range(A):
    if i<len(A)-1:
        l=A[i+1]-A[i]
    else:
        l=K-A[-1]+A[0]
    if L_max<l:
        L_max=l
ans=sum(A)-L_max
print(ans)

Fixed submission:
K,N=map(int,input().split())
A=list(map(int,input().split()))
max_ans=0
for i in range(N):
    if i==N-1:
        ans=K-A[N-1]+A[0]
    else:
        ans=A[i+1]-A[i]
    if max_ans<ans:
        max_ans=ans
ans=K-max_ans
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N,A,B=map(int,input().split())
L=[]
i=0
while i < N:
    for j in range(A-1):
        L.append("b")
        i=i+1
        if i>N:
            break
    for k in range(B-1):
        L.append("r")
        i=i+1
        if i>N:
            break
print(L.count("b"))

Fixed submission:
N,A,B=map(int,input().split())
C=A+B
D=N//C
count=D*A
N=N-C*D
while N>0:
    N=N-A
    if N>0:
        count=count+A
    elif N<=0:
        count=count+(A+N)
        break
    N=N-B
    if N<=0:
        break
    else:
        pass
print(count)
Buggy python submission (verdict: Runtime Error):
A=[list(map(int,input().split())) for _ in range(3)]
N=int(input())
bn=[int(input()) for _ in range(N)]
ans=False
for ver in zip(*A):
    if all(item in bn for item in ver):
        ans=True
for wide in A:
    if all(item in bn for item in wide):
        ans=True
if all(A[i][i] in bn for i in range(3)):
    ans=True
if all(A[i][3-i] in bn for i in range(3)):
    ans=True
if ans==True:
    print("Yes")
else:
    print("No")

Fixed submission:
A=[list(map(int,input().split())) for _ in range(3)]
N=int(input())
bn=[int(input()) for _ in range(N)]
ans=False
for ver in zip(*A):
    if all(item in bn for item in ver):
        ans=True
for wide in A:
    if all(item in bn for item in wide):
        ans=True
if all(A[i][i] in bn for i in range(3)):
    ans=True
if all(A[i][3-i-1] in bn for i in range(3)):
    ans=True
if ans==True:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
N=int(input())

X=list(map(int, input().split()))

X.sort()
i=X[0]

min=100000000000000000
while i < X[-1]:
    power=0
    for j in range(len(X)):
        power=power+(X[j]-i)**2

    if power<=min:
        min=power

    i=i+1


print(min)

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

if 0<N<10:
  T=100*(10-N)
  print((R+T))
 
elif N<0:
  print("error")
  
else:
  print(R)

Buggy python submission (verdict: Runtime Error):
N=int(input())
R=int(input())
 
if 0<N<10:
  T=100*(10-N)
  print((R+T))

elif N<0:
  print("error")
  
else:
  print(R)

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

if 0<N<10:
  T=100*(10-N)
  print((R+T))
 
elif N<0:
  print("error")
  
else:
  print(R)

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

if N<10:
  T=100*(10-N)
  print((R+T))
  
else:
  print(R)


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

if 0<N<10:
  T=100*(10-N)
  print((R+T))
 
elif N<0:
  print("error")
  
else:
  print(R)
Buggy python submission (verdict: Runtime Error):
    N=int(input())
     
    X=list(map(int, input().split()))
     
    X.sort()
    i=X[0]
    min=10000000000
    while i <= X[-1]:
        power=0
        for j in range(len(X)):
            power=power+(X[j]-i)**2
     
        if power<=min:
            min=power
     
        i=i+1
     
     
    print(min)

Fixed submission:
N=int(input())

X=list(map(int, input().split()))

X.sort()

min=10000000000
for P in range(100):

    power=0
    for j in range(len(X)):
        power=power+(X[j]-P)**2

    if power<=min:
        min=power

    P=P+1


print(min)
Buggy python submission (verdict: Runtime Error):
S,T=input().split()

A,B=int(input().split())

U=input()

if S==U:
    A=A-1

elif T==U:
    B=B-1
else:
    pass

print(A,B)




Fixed submission:
S,T=input().split()
A,B=map(int,input().split())
U=input()
if S==U:
    print(A-1,B)
elif T==U:
    print(A,B-1)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
H=list(map(int,input().split()))
max_ans=0
for i in range(len(H)):
    A=i
    ans=0
    for j in range(i+1,len(H)):
        if H[A]>=H[j]:
            ans=ans+1
        elif H[A]<H[j]:
            break
        A=A+1
    max_ans=max(ans,max_ans)
print(max_ans)

Fixed submission:
N=int(input())
H=list(map(int,input().split()))
max_ans=0
ans=0
for i in range(N-1):
    if H[i]>=H[i+1]:
        ans=ans+1
    else:
        max_ans=max(ans,max_ans)
        ans=0
max_ans=max(ans,max_ans)
print(max_ans)
Buggy python submission (verdict: Runtime Error):
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=0
count=0
i=0
while D<=X:
    count=count+1
    D=D+L[i]
    i=i+1
print(count)

Fixed submission:
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[0]
count=1
for i in range(N):
    D.append(D[i]+L[i])
    if D[i+1]<=X:
        count=count+1
print(count)
Buggy python submission (verdict: Runtime Error):
S=input()
a=int(S[0]+S[1])
b=int(S[2]+S[3])
if (a==0 a>12) and 0<b<=12:
    print("YYMM")
elif 0<a<=12 and 0<b<=12:
    print("AMBIGUOUS")
elif 0<a<=12 and b>12:
    print("MMYY")
else:
    print("NA")

Fixed submission:
S=input()
a=int(S[0]+S[1])
b=int(S[2]+S[3])
if (a==0 or a>12) and 0<b<=12:
    print("YYMM")
elif 0<a<=12 and 0<b<=12:
    print("AMBIGUOUS")
elif 0<a<=12 and (b==0 or b>12):
    print("MMYY")
else:
    print("NA")
Buggy python submission (verdict: Runtime Error):
A=[]
for i in range(5):
    B=int(input())
    A.append(B)
min=1000
for j in range(5):
    if A[j]%10!=0 and A[j]%10<min:
        min=A[j]%10
        index=j
time=0
for k in range(len(A)):
    if k!=index:
        time=time+A[k]
        if A[k]%10!=0:
            time=time+(10-A[k]%10)
    else:
        time=time+A[k]
print(time)


Fixed submission:
A=[]
for i in range(5):
    B=int(input())
    A.append(B)
min=1000
count=0
for j in range(5):
    if A[j]%10!=0 and A[j]%10<min:
        min=A[j]%10
        index=j
    if A[j]%10==0:
        count+=1
if count==5:
    index=0
time=0
for k in range(len(A)):
    if k!=index:
        time=time+A[k]
        if A[k]%10!=0:
            time=time+(10-A[k]%10)
    else:
        time=time+A[k]
print(time)
Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
N=int(input())
T=[]
for i in range(N):
    Ti=int(input())
    T.append(Ti)
print(lcm_list(T))

Fixed submission:
import fractions
from functools import reduce
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
N=int(input())
T=[]
for i in range(N):
    Ti=int(input())
    T.append(Ti)
print(lcm_list(T))