Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
N = int(input())
A = list(map(int, input().split()))
A.reverse()
B = [0 for i in range(N)]
for i in range(N):
    tmp = 0
    for j in range(i):
        tmp += B[j]
    if A[i] % 2 != tmp % 2:
        B[i] = 1
B.reverse()
ans = []
M = sum(B)
for i in range(N):
    if B[i] == 1:
        ans.append(i+1)
print(M)
print(*ans)

Fixed submission:
#coding: utf-8
N = int(input())
A = [0] + list(map(int, input().split()))
B = [0 for _ in range(N+1)]
ans = []
for i in range(N, 0, -1):
    v = 0
    j = i
    while j <= N:
        v += B[j]
        j += i
    if A[i] != v % 2:
        ans.append(i)
        B[i] = 1

ans.sort()
print(len(ans))
if len(ans) != 0:
    print(*ans)
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
N = int(input())
A = list(map(int, input().split()))
A.sort()
d = {}
for i in range(N):
    a = A[i]
    if a not in d.keys():
        d[a] = 1
    else:
        d[a] += 1
if len(d.keys()) == 1:
    if d.keys()[0] == 0:
        print("Yes")
    else:
        print("No")
elif len(d.keys()) == 2:
    keys = list(sorted(list(d.keys())))
    if d[keys[0]] == N // 3:
        print("Yes")
    else:
        print("No")
elif len(d.keys()) == 3:
    keys = list(d.keys())
    if keys[0] ^ keys[1] ^ keys[2] == 0:
        if d[keys[0]] == d[keys[1]] == d[keys[2]]:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")

Fixed submission:
# coding: utf-8
N = int(input())
A = list(map(int, input().split()))
A.sort()
d = {}
for i in range(N):
    a = A[i]
    if a not in d.keys():
        d[a] = 1
    else:
        d[a] += 1
if len(d.keys()) == 1:
    if list(d.keys())[0] == 0:
        print("Yes")
    else:
        print("No")
elif len(d.keys()) == 2:
    keys = list(sorted(list(d.keys())))
    if d[keys[0]] == N // 3:
        print("Yes")
    else:
        print("No")
elif len(d.keys()) == 3:
    keys = list(d.keys())
    if keys[0] ^ keys[1] ^ keys[2] == 0:
        if d[keys[0]] == d[keys[1]] == d[keys[2]]:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
from math import factorial
N, K = map(int, input().split())
mod = 10**9 + 7
def combination(n, r):
    if n >= r:
        return int(factorial(n) // (factorial(r) * factorial(n - r)))
    else:
        return 0

for i in range(1, K+1):
    print(combination(N-K+1, i) * combination(K-1, i-1)%mod)


Fixed submission:
# coding: utf-8
S = list(input())
if len(set(S)) == 2:
    cnt = 0
    for s in set(S):
        if S.count(s) == 2:
            cnt += 1
    if cnt == 2:
        print("Yes")
        exit()
print("No")
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
from math import factorial
N, K = map(int, input().split())
mod = 10**9 + 7
def combination(n, r):
    if n > r:
        return int(factorial(n) / (factorial(r) * factorial(n - r)))
    else:
        return 1

for i in range(1, K+1):
    if N == i:
        print(1)
    elif i%2 == 0:
        print(combination(N-K+1, i)*2%mod)
    else:
        print(combination(N-K+1, i)%mod)

Fixed submission:
# coding: utf-8
from math import factorial
def combination(n, r):
    if n >= r and n >= 0 and r >= 0:
        return int(factorial(n) // (factorial(r) * factorial(n - r)))
    else:
        return 0
N, K = map(int, input().split())
mod = 10**9 + 7

for i in range(1, K+1):
    print(combination(N-K+1, i) * combination(K-1, i-1)%mod)

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
from math import factorial
N, K = map(int, input().split())
mod = 10**9 + 7
def combination(n, r):
    if n > r:
        return int(factorial(n) / (factorial(r) * factorial(n - r)))
    else:
        return 1
for i in range(1, K+1):
    if i%2 == 0:
        print(combination(N-K+1, i)*2%mod)
    else:
        print(combination(N-K+1, i)%mod)

Fixed submission:
# coding: utf-8
from math import factorial
def combination(n, r):
    if n >= r and n >= 0 and r >= 0:
        return int(factorial(n) // (factorial(r) * factorial(n - r)))
    else:
        return 0
N, K = map(int, input().split())
mod = 10**9 + 7

for i in range(1, K+1):
    print(combination(N-K+1, i) * combination(K-1, i-1)%mod)

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
from math import factorial
N, K = map(int, input().split())
mod = 10**9 + 7
def combination(n, r):
    return int(factorial(n) / (factorial(r) * factorial(n - r)))

for i in range(1, K+1):
    if i%2 == 0:
        print(combination(N-K+1, i)*2%mod)
    else:
        print(combination(N-K+1, i)%mod)

Fixed submission:
# coding: utf-8
from math import factorial
def combination(n, r):
    if n >= r and n >= 0 and r >= 0:
        return int(factorial(n) // (factorial(r) * factorial(n - r)))
    else:
        return 0
N, K = map(int, input().split())
mod = 10**9 + 7

for i in range(1, K+1):
    print(combination(N-K+1, i) * combination(K-1, i-1)%mod)

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
from math import factorial
N, K = map(int, input().split())
mod = 10**9 + 7
def combination(n, r):
    return int(factorial(n) / (factorial(r) * factorial(n - r)) % mod)

for i in range(1, K+1):
    if i%2 == 0:
        print(combination(N-K+1, i)*2)
    else:
        print(combination(N-K+1, i))

Fixed submission:
# coding: utf-8
from math import factorial
def combination(n, r):
    if n >= r and n >= 0 and r >= 0:
        return int(factorial(n) // (factorial(r) * factorial(n - r)))
    else:
        return 0
N, K = map(int, input().split())
mod = 10**9 + 7

for i in range(1, K+1):
    print(combination(N-K+1, i) * combination(K-1, i-1)%mod)
Buggy python submission (verdict: Time Limit Exceeded):
#coding: utf-8
from collections import deque
N, M = map(int, input().split())
graph = {i:[] for i in range(1, N+1)}
for i in range(M):
    u, v = map(int, input().split())
    graph[u].append(v)
    # graph[v].append(u)
S, T = map(int, input().split())
queue = deque([[graph[S][i], 0] for i in range(len(graph[S]))])
cnt = 0
visited = [False for _ in range(N)]
while queue:
    # print(len(queue))
    now = queue.popleft()
    # print(now)
    now[1] += 1
    # if visited[now[0]-1]:
    #     continue
    if now[1] >= 10**6:
        break
    if now[1] % 3 == 0:
        # print("visited", now[0])
        visited[now[0]-1] = True
        if now[0] == T:
            print(now[1] // 3)
            exit()
        for i in range(len(graph[now[0]])):
            queue.append([graph[now[0]][i], now[1]])
    else:
        for i in range(len(graph[now[0]])):
            queue.append([graph[now[0]][i], now[1]])
print(-1)



Fixed submission:
from sys import stdin
from collections import deque
def main():
    #入力
    readline=stdin.readline
    n,m=map(int,readline().split())
    G=[[] for _ in range(n*3)]
    for i in range(m):
        a,b=map(lambda x:int(x)-1,readline().split())
        for j in range(3):
            G[3*a+j].append(3*b+(j+1)%3)

    s,t=map(lambda x:int(x)-1,readline().split())
    s*=3
    t*=3
    #bfs
    d=deque([s])
    flags=[-1]*(3*n)
    flags[s]=0
    while len(d)>0:
        now=d.popleft()
        for nex in G[now]:
            if flags[nex]==-1:
                flags[nex]=flags[now]+1
                d.append(nex)

    print(flags[t]//3)

if __name__=="__main__":
    main()
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
from math import ceil, floor, gcd
A, B, C, D = map(int, input().split())
lcm = (C * D) // gcd(C, D)
# c_cnt = ceil((B) / C) - (A-1) // C
# d_cnt = ceil((B) / D) - (A-1) // D
# cd_cnt = ceil((B) / (lcm)) - (A-1) // (lcm)
c_cnt = B // C - (A-1) // C
d_cnt = B // D - (A-1) // D
cd_cnt = B // (lcm) - (A-1) // (lcm)
minus = c_cnt + d_cnt - cd_cnt
# print(c_cnt, d_cnt, cd_cnt)
print(B - A - minus + 1)

Fixed submission:
# coding: utf-8
from math import ceil, floor
from fractions import gcd
A, B, C, D = map(int, input().split())
lcm = (C * D) // gcd(C, D)
c_cnt = B // C - (A-1) // C
d_cnt = B // D - (A-1) // D
cd_cnt = B // (lcm) - (A-1) // (lcm)
minus = c_cnt + d_cnt - cd_cnt
print(B - A - minus + 1)
Buggy python submission (verdict: Time Limit Exceeded):
#coding:utf-8
n, m = map(int, input().split())
l, r = 10**6, 0
ll = []
ans_l = []
tmp_ans = []
for i in range(m):
    a, b = map(int, input().split())
    ans_l = []
    if i == 0:
        tmp_ans = list(range(a, b+1, 1))
    else:
        for j in range(len(tmp_ans)):
            if a <= tmp_ans[j] <= b:
                ans_l.append(tmp_ans[j])
        tmp_ans = ans_l[:]
print(len(set(tmp_ans)))

Fixed submission:
#coding:utf-8
n, m = map(int, input().split())
l, r = 0, 10**6
for i in range(m):
    a, b = map(int, input().split())
    l = max(l, a)
    r = min(r, b)
print(r - l  + 1 if l <= r else 0)

Buggy python submission (verdict: Time Limit Exceeded):
#coding:utf-8
n, m = map(int, input().split())
l, r = 10**6, 0
ll = []
for i in range(m):
    a, b = map(int, input().split())
    ll.append([a, b])
    l = min(l, a)
    r = max(r, b)
ans = 0
for i in range(l, r+1):
    cnt = 0
    for j in range(len(ll)):
        if ll[j][0] <= i <= ll[j][1]:
            cnt += 1
    if cnt == len(ll):
        ans += 1
print(ans)

Fixed submission:
#coding:utf-8
n, m = map(int, input().split())
l, r = 0, 10**6
for i in range(m):
    a, b = map(int, input().split())
    l = max(l, a)
    r = min(r, b)
print(r - l  + 1 if l <= r else 0)
Buggy python submission (verdict: Runtime Error):
#coding: utf-8
S = input()
year = 19
month = 12
mae, ushiro = S[:2], S[2:]
if 0 < mae <= month and 0 < ushiro <= month:
	print("AMBIGUOUS")
elif 0 < mae <= month and 0 < ushiro <= year:
	print("MMYY")
elif 0 < mae <= year and 0 < ushiro <= month:
	print("YYMM")
else:
	print("NA")

Fixed submission:
#coding: utf-8
S = input()
year = 99
month = 12
mae, ushiro = int(S[:2]), int(S[2:])
if 0 < mae <= month and 0 < ushiro <= month:
	print("AMBIGUOUS")
elif 0 < mae <= month and 0 <= ushiro <= year:
	print("MMYY")
elif 0 <= mae <= year and 0 < ushiro <= month:
	print("YYMM")
else:
	print("NA")
Buggy python submission (verdict: Time Limit Exceeded):
#coding: utf-8
from math import ceil
R, G, B, N = map(int, input().split())
ans = 0
for r in range(ceil(N/R) + 1):
	for g in range(ceil(N/G) + 1):
		for b in range(ceil(N/B) + 1):
			if r * R + g * G + b * B == N:
				ans += 1
print(ans)

Fixed submission:
#coding: utf-8
from math import ceil
R, G, B, N = map(int, input().split())
ans = 0
for r in list(range(ceil(N/R) + 1))[::-1]:
	for g in range(ceil(N/G) + 1):
		if (N - r*R - g*G) % B == 0 and N >= r*R + g*G:
			ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
#coding: utf-8
N = int(input())
ans = 0
l_B = 0
r_A = 0
lbra = 0
for _ in range(N):
	tmp = input()
	ans += tmp.count("AB")
	if tmp[0] == "B":
		if tmp[-1] == "A":
			lbra += 1
		else:
			l_B += 1
	elif tmp[-1] == "A":
		r_A += 1
l.sort()
print(ans + lbra + min(l_B, r_A))

Fixed submission:
#coding: utf-8
N = int(input())
ans = 0
l_B = 0
r_A = 0
lbra = 0
for _ in range(N):
	tmp = input()
	ans += tmp.count("AB")
	if tmp[0] == "B":
		if tmp[-1] == "A":
			lbra += 1
		else:
			l_B += 1
	elif tmp[-1] == "A":
		r_A += 1
        
if lbra == 0:
    ans += min(l_B, r_A)
else:
    if l_B + r_A > 0:
        ans += lbra + min(l_B, r_A)
    else:
        ans += lbra - 1
print(ans)
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
try:
    from math import gcd
except:
    from fractions import gcd
N = int(input())
A = list(map(int, input().split()))
A.sort()
l = []
for i in range(2, A[0]+1):
    if A[0] % i == 0:
        l.append(i)
for i in range(2, A[1]+1):
    if A[1] % i == 0:
        l.append(i)
l = list(set(l))
ans = []
for i in l:
    cnt = 0
    for a in A:
        if a % i != 0:
            cnt += 1
    if cnt == 1:
        ans.append(i)
print(max(ans))


Fixed submission:
#coding: utf-8
try:
    from math import gcd
except:
    from fractions import gcd
N = int(input())
A = list(map(int, input().split()))
AL = [0] * N  # 左からGCD
AR = [0] * N  # 右からGCD
for i in range(1, N):
    AR[i] = gcd(AR[i-1], A[i-1])
for i in range(N-1)[::-1]:
    AL[i] = gcd(AL[i+1], A[i+1])
A_list = [gcd(AL[i], AR[i]) for i in range(N)]
print(max(A_list))
Buggy python submission (verdict: Runtime Error):
#coding: utf-8
N = int(input())
S = list(input())
ans = 0
for j in range(i, N):
    if S[j] == ".":
        ans += 1
print(ans)

Fixed submission:
#coding: utf-8
N = int(input())
S = list(input())
ans = S.count(".")
cnt = ans
for i in range(N):
    if S[i] == "#":
        cnt += 1
    else:
        cnt -= 1
    ans = min(ans, cnt)
print(ans)
Buggy python submission (verdict: Runtime Error):
#coding: utf-8
S = list(input())
enki = ["A", "T", "G", "C"]
cnt = 0
index = 0
a = []
ans = ""
for i in range(len(S)):
    if S[i] in enki:
        ans += S[i]
        a.append(ans)
    else:
        ans = ""
print(len(max(a)))

Fixed submission:
#coding: utf-8
S = input()
enki = ["A", "T", "G", "C"]
a = []
ans = ""
max_ = 0
for i in range(len(S)):
    if S[i] in enki:
        ans += S[i]
    else:
        ans = ""
    a.append(ans)
    max_ = max(max_, len(ans))
print(max_)

Buggy python submission (verdict: Runtime Error):
#coding: utf-8
S = list(input())
enki = ["A", "T", "G", "C"]
cnt = 0
index = 0
a = []
ans = ""
for i in range(len(S)):
    if S[i] in enki:
        ans += S[i]
    else:
        a.append(ans)
        ans = ""
print(len(max(a)))

Fixed submission:
#coding: utf-8
S = input()
enki = ["A", "T", "G", "C"]
a = []
ans = ""
max_ = 0
for i in range(len(S)):
    if S[i] in enki:
        ans += S[i]
    else:
        ans = ""
    a.append(ans)
    max_ = max(max_, len(ans))
print(max_)
Buggy python submission (verdict: Runtime Error):
#coding: utf-8
N, M, C = map(int, input().split())
B = list(map(int, input().split()))
A = list(map(int, input().split())) for _ in range(N))
l []
for i in range(N):
    A = list(map(int, input().split()))
    l.append(sum(A[j] * B[j] for j in range(M)) + C > 0)
print(l)

Fixed submission:
#coding: utf-8
import numpy as np
N, M, C = map(int, input().split())
B = np.array(list(map(int, input().split())))
A = np.array([list(map(int, input().split())) for _ in range(N)])
sum_ = np.array([np.sum(A[i] * B) + C for i in range(N)])
print(np.sum(sum_ > 0))

Buggy python submission (verdict: Runtime Error):
N, M, C = map(int, input().split())
B = list(map(int, input().split()))
l = []
for i in range(N):
    l.append(list(map(int, input().split())))
for j in range(N):
    sum_ = [l[j][i] * B[i] for i in range(M)]
print(sum([sum_[i] > -C for i in range(N)]))

Fixed submission:
#coding: utf-8
import numpy as np
N, M, C = map(int, input().split())
B = np.array(list(map(int, input().split())))
A = np.array([list(map(int, input().split())) for _ in range(N)])
sum_ = np.array([np.sum(A[i] * B) + C for i in range(N)])
print(np.sum(sum_ > 0))
Buggy python submission (verdict: Time Limit Exceeded):
#coding: utf-8
s = list(map(int, input()))
cnt = 0
while len(set(s)) > 1:
    for i in range(len(s)-1):
        if (s[i] == 1 and s[i+1] == 0) or (s[i] == 0 and s[i+1] == 1):
            cnt += 2
            del s[i:i+2]
            break
print(cnt)

Fixed submission:
#coding: utf-8
s = list(map(int, input()))
cnt = 0
zero = s.count(0)
one = s.count(1)
print(zero*2 if zero < one else one * 2)

Buggy python submission (verdict: Time Limit Exceeded):
#coding: utf-8
s = list(map(int, input()))
cnt = 0
while len(set(s)) > 1:
    for i in range(len(s)-1):
        if s[i] == 1 and s[i+1] == 0:
            cnt += 2
            del s[i:i+2]
            break
print(cnt)

Fixed submission:
#coding: utf-8
s = list(map(int, input()))
cnt = 0
zero = s.count(0)
one = s.count(1)
print(zero*2 if zero < one else one * 2)

Buggy python submission (verdict: Runtime Error):
#coding: utf-8
s = list(map(int, input()))
if len(s) <= 1:
    print(0)
else:
    zero = [i for i, x in enumerate(s) if x == 0]
    one = [i for i, x in enumerate(s) if x == 1]
    zeros = s[:zero[-1]].count(0)
    ones = s[:one[-1]].count(1)
    print(zeros * 2 if zeros < ones else ones * 2)


Fixed submission:
#coding: utf-8
s = list(map(int, input()))
cnt = 0
zero = s.count(0)
one = s.count(1)
print(zero*2 if zero < one else one * 2)
Buggy python submission (verdict: Runtime Error):
#coding: utf-8
import numpy as np

N, A, B, C = map(int, input().split())
bumboo = np.array([int(input()) for _ in range(N)])
magic = 0
for i in [A, B, C]:
    bumboo_diff = bumboo - i
    bumboo_diff = np.where(bumboo_diff >= 0)
    if np.sum(bumboo_diff) >= 2:
        magic += 10
    else:
        magic += np.min(bumboo_diff)
print(magic)

Fixed submission:
# coding: utf-8
def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = int(X_dumy/n)
    return out
    
N, A, B, C = map(int, input().split())
L = [int(input()) for _ in range(N)]
ans = float("inf")
for i in range(4**N):
    bits = Base_10_to_n(i, 4).zfill(N)
    a, b, c = 0, 0, 0
    cost = 0
    for j in range(len(bits)):
        if bits[j] == "0":
            pass
        elif bits[j] == "1":
            a += L[j]
            cost += 10
        elif bits[j] == "2":
            b += L[j]
            cost += 10
        else:
            c += L[j]
            cost += 10
    if min(a, b, c) > 0:
        ans = min(ans, cost + abs(a-A)+abs(b-B)+abs(c-C) - 10*3)
print(ans)

Buggy python submission (verdict: Runtime Error):
#coding: utf-8
import numpy as np

N, A, B, C = map(int, input().split())
bumboo = np.array([int(input()) for _ in range(N)])
magic = 0
for i in [A, B, C]:
    bumboo_diff = bumboo - i
    bumboo_diff = np.where(bumboo_diff >= 0)
    if np.sum(bumboo_diff) == 2:
        magic += 10
    else:
        magic += np.min(bumboo_diff)
print(magic)

Fixed submission:
# coding: utf-8
def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = int(X_dumy/n)
    return out
    
N, A, B, C = map(int, input().split())
L = [int(input()) for _ in range(N)]
ans = float("inf")
for i in range(4**N):
    bits = Base_10_to_n(i, 4).zfill(N)
    a, b, c = 0, 0, 0
    cost = 0
    for j in range(len(bits)):
        if bits[j] == "0":
            pass
        elif bits[j] == "1":
            a += L[j]
            cost += 10
        elif bits[j] == "2":
            b += L[j]
            cost += 10
        else:
            c += L[j]
            cost += 10
    if min(a, b, c) > 0:
        ans = min(ans, cost + abs(a-A)+abs(b-B)+abs(c-C) - 10*3)
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
monstar = list(map(int, input().split()))
monstar.sort()
min1, min2 = monstar[0], monstar[1]
while min1 > 0 and min2 > 0:
  if min1 <= min2:
    min2 -= min1
  else:
    min1 -= min2
print(max(min1, min2))

Fixed submission:
A, B = map(int, input().split())
if B % A == 0:
  print(A+B)
else:
  print(B-A)

Buggy python submission (verdict: Runtime Error):
import numpy as np
N, M = map(int, input().split())
menu = np.array([])
for i in range(N):
  a = np.array(input().split())
  menu = np.append(menu, a[1:])
menu = np.array(menu).astype(int).ravel()
count = 0
for i in range(1, M+1):
  if np.sum(menu == i) == N:
    count += 1
print(count)

Fixed submission:
A, B = map(int, input().split())
if B % A == 0:
  print(A+B)
else:
  print(B-A)
Buggy python submission (verdict: Time Limit Exceeded):
def gcd(a, b):
  if a > b:
    min1, min2 = a, b
  else:
    min1, min2 = b, a
  if min2 == 0:
    return min1
  else:
    return gcd(min2, min1%min2)
N = int(input())
monster = list(map(int, input().split()))
monster.sort()
while len(monster) > 1:
  monster = [gcd(monster[i], monster[i+1]) for i in range(len(monster)-1)]
print(monster[0])

Fixed submission:
from functools import reduce
from fractions import gcd
N = int(input())
monster = list(map(int, input().split()))
print(reduce(gcd, monster))

Buggy python submission (verdict: Runtime Error):
N = int(input())
monster = list(map(int, input().split()))
if 1 in monster:
  print(1)
else:
  monster.sort()
  min1, min2 = monster[0], monster[1]
  while min1 >= 0 and min2 > 0:
    if min1 <= min2:
      min2 = min2 % min1
    else:
      min1 = min1 % min2
  print(max(min1, min2))

Fixed submission:
from functools import reduce
from fractions import gcd
N = int(input())
monster = list(map(int, input().split()))
print(reduce(gcd, monster))

Buggy python submission (verdict: Runtime Error):
N = int(input())
monster = list(map(int, input().split()))
if 1 in monster:
  print(1)
else:
  monster.sort()
  min1, min2 = monster[0], monster[1]
  while min1 >= 0 and min2 > 0:
    if min1 < min2:
      min2 = min2 % min1
    else:
      min1 = min1 % min2
  print(max(min1, min2))

Fixed submission:
from functools import reduce
from fractions import gcd
N = int(input())
monster = list(map(int, input().split()))
print(reduce(gcd, monster))

Buggy python submission (verdict: Runtime Error):
N = int(input())
monster = list(map(int, input().split()))
if 1 in monster:
  print(1)
else:
  monster.sort()
  min1, min2 = monster[0], monster[1]
  while min1 >= 0 and min2 > 0:
    if min1 < min2:
      min2 = min2 % min1
    else:
      min1 = min1 % min2
  print(min1 + min2)

Fixed submission:
from functools import reduce
from fractions import gcd
N = int(input())
monster = list(map(int, input().split()))
print(reduce(gcd, monster))

Buggy python submission (verdict: Runtime Error):
N = int(input())
monster = list(map(int, input().split()))
if 1 in monster:
  print(1)
else:
  monster.sort()
  min1, min2 = monster[0], monster[1]
  while min1 >= 0 and min2 > 0:
    if min1 < min2:
      min2 = min2 % min1
    else:
      min1 = min1 % min2
  print(max(min1, min2))

Fixed submission:
from functools import reduce
from fractions import gcd
N = int(input())
monster = list(map(int, input().split()))
print(reduce(gcd, monster))
Buggy python submission (verdict: Runtime Error):
K, A, B = map(int, input().split())
bis = 0
C = int(B/A)
D = int(K/A)
if C >= 2 and K>A:
  if K >= A*D+D:
    K -= A*D+D
    print(K+B*D)
  else:
    K -= A*(D-1)+D-1
    print(K+B*(D-1))
else:
  print(K+1)

Fixed submission:
N, K = map(int, input().split())
if (N+1)/K >= 2:
  print("YES")
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
K, A, B = map(int, input().split())
C = int(B/A)
D = int(K/A)
if C >= 2:
  if K >= A*D+D:
    K -= A*D+D
    print(K+B*D)
  else:
    K -= A*(D-1)+D-1
    print(K+B*(D-1))
else:
  print(K+1)

Fixed submission:
N, K = map(int, input().split())
if (N+1)/K >= 2:
  print("YES")
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
K, A, B = map(int, input().split())
bis = 0
C = int(B/A)
D = int(K/A)
if C >= 2:
  if K >= A*D+D:
    K -= A*D+D
    print(K+B*D)
  else:
    K -= A*(D-1)+D-1
    print(K+B*(D-1))
else:
  print(K+1)

Fixed submission:
N, K = map(int, input().split())
if (N+1)/K >= 2:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
#coding: utf-8
N, M = map(int, input().split())
points = list(map(int, input().split()))
points.sort()
koma = [points[i+1] - points[i] for i in range(M-1)]
koma.sort()
print(sum(koma[:M-N]))

Fixed submission:
#coding: utf-8
x, t = map(int, input().split())
print(x / t)

Buggy python submission (verdict: Runtime Error):
#coding: utf-8
N, M = map(int, input().split())
points = list(map(int, input().split()))
points.sort()
koma = [points[i+1] - points[i] for i in range(M-1)]
koma.sort()
print(sum(koma[:M-N]))

Fixed submission:
#coding: utf-8
x, t = map(int, input().split())
print(x / t)

Buggy python submission (verdict: Runtime Error):
#coding: utf-8
N, M = map(int, input().split())
points = list(map(int, input().split()))
points = sorted(points)
koma = [points[i+1] - points[i] for i in range(M-1)]
koma.sort(reverse=True)
print(sum(koma[:M-N]

Fixed submission:
#coding: utf-8
x, t = map(int, input().split())
print(x / t)