Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
[a, b, c, d, e] = [int(input()) for i in range(5)]
k = int(input())

difs = [b-a, c-b, d-c, e-d]
Mdif = Max(difs)
if Mdif <= k:
  print("Yay!")
else:
  print(":(")

Fixed submission:
[a, b, c, d, e] = [int(input()) for i in range(5)]
k = int(input())

if e-a <= k:
  print("Yay!")
else:
  print(":(")

Buggy python submission (verdict: Runtime Error):
[a, b, c, d, e] = [int(input()) for i in range(5)]
k = int(input())

difs = [b-a, c-b, d-c, e-d]
Mdif = Max(difs)
if Mdif <= k:
  print("Yay!)
else:
  print(":(")

Fixed submission:
[a, b, c, d, e] = [int(input()) for i in range(5)]
k = int(input())

if e-a <= k:
  print("Yay!")
else:
  print(":(")
Buggy python submission (verdict: Runtime Error):
input = raw_input()

base = {"A":"T", "T":"A", "C":"T", "T":"C"}

print base[input]

Fixed submission:
input = raw_input()
 
base = {"A":"T", "T":"A", "C":"G", "G":"C"}
 
print base[input]
Buggy python submission (verdict: Time Limit Exceeded):
an = int(input())

numbers = [an]
while True:
  if an%2 == 1:
    an = 3*an+1
  else:
    an = an*2
  if an in numbers:
    print(len(numbers)+1)
    break
  else:
    numbers.append(an)

Fixed submission:
an = int(input())

numbers = [an]
while True:
  if an%2 == 1:
    an = 3*an+1
  else:
    an = an//2
  if an in numbers:
    print(len(numbers)+1)
    break
  else:
    numbers.append(an)

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

numbers = [an]
while True:
	if an%2 == 1:
		an = 3*an+1
	else:
		an = an//2
	if an in numbers:
		print(len(numbers)+1)
        break
    else:
		numbers.append(an)

Fixed submission:
an = int(input())

numbers = [an]
while True:
  if an%2 == 1:
    an = 3*an+1
  else:
    an = an//2
  if an in numbers:
    print(len(numbers)+1)
    break
  else:
    numbers.append(an)

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

numbers = []
while True:
	if an%2 == 1:
		an = 3*an+1
	else:
		an = an//2
	if an in numbers:
		print(len(numbers)+1)
        break
    else:
		numbers.append(an)

Fixed submission:
an = int(input())

numbers = [an]
while True:
  if an%2 == 1:
    an = 3*an+1
  else:
    an = an//2
  if an in numbers:
    print(len(numbers)+1)
    break
  else:
    numbers.append(an)
Buggy python submission (verdict: Runtime Error):
data = ["Christmas Eve Eve Eve", "Christmas Eve Eve", "Christmas Eve", "Christmas"]

print(data(int(input())-22))

Fixed submission:
data = ["Christmas Eve Eve Eve", "Christmas Eve Eve", "Christmas Eve", "Christmas"]

print(data[int(input())-22])

Buggy python submission (verdict: Runtime Error):
data = ["Christmas Eve Eve Eve", "Christmas Eve Eve", "Christmas Eve", "Christmas"]

print(data(int(input())-22))

Fixed submission:
data = ["Christmas Eve Eve Eve", "Christmas Eve Eve", "Christmas Eve", "Christmas"]

print(data[int(input())-22])
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
lengths = list(int(input()) for i in range(N))
sorted_lengths = sorted(lengthes)
min_score = 2**100

for i in range(N-K+1):
  score = sorted_lengths[i+K-1] - sorted_lengths[i]
  min_score = min(min_score, score)

print(min_score)

Fixed submission:
N, K = map(int, input().split())
lengths = list(int(input()) for i in range(N))
sorted_lengths = sorted(lengths)
min_score = 2**100

for i in range(N-K+1):
  score = sorted_lengths[i+K-1] - sorted_lengths[i]
  min_score = min(min_score, score)

print(min_score)
Buggy python submission (verdict: Runtime Error):
age = input()
if age == 1:
  print("Hello World")
else:
  print(input()+input())

Fixed submission:
age = int(input())
if age == 1:
  print("Hello World")
else:
  print(int(input())+int(input()))
Buggy python submission (verdict: Runtime Error):
inp = input()

corrected = ""
for l in inp:
  if l == "1":
    corrected += "9"
  elif l == 9:
    corrected += "1"
  else:
    print("error")

print(int(corrected))

Fixed submission:
inp = input()

corrected = ""
for l in inp:
  if l == "1":
    corrected += "9"
  elif l == "9":
    corrected += "1"
  else:
    print("error")

print(int(corrected))
Buggy python submission (verdict: Runtime Error):
X = int(input)

if 100 <= X <= 111:
  n = 111
elif X <= 222:
  n = 222
elif X <= 333:
  n = 333
elif X <= 444:
  n = 444
elif X <= 555:
  n = 555
elif X <= 666:
  n = 666
elif X <= 777:
  n = 777
elif X <= 888:
  n = 888
elif X <= 999:
  n = 999
else:
  print("error")

print(n)

Fixed submission:
X = int(input())

if 100 <= X <= 111:
  n = 111
elif X <= 222:
  n = 222
elif X <= 333:
  n = 333
elif X <= 444:
  n = 444
elif X <= 555:
  n = 555
elif X <= 666:
  n = 666
elif X <= 777:
  n = 777
elif X <= 888:
  n = 888
elif X <= 999:
  n = 999
else:
  print("error")

print(n)
Buggy python submission (verdict: Runtime Error):
numbers = map(int, input().split())

print(sum(numbers) + max(numbers)*9)

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

print(sum(numbers) + max(numbers)*9)

Buggy python submission (verdict: Runtime Error):
numbers = [int(input()) for i in range(3)]

print(sum(numbers) + max(numbers)*9)

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

print(sum(numbers) + max(numbers)*9)

Buggy python submission (verdict: Runtime Error):
numbers = [int(input()) for i in range(3)]

numbers.sort()
numbers.reverse()

print(numbers[0]*10 + numbers[1] + numbers[2])

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

print(sum(numbers) + max(numbers)*9)

Buggy python submission (verdict: Runtime Error):
numbers = [int(input()) for i in range(3)]

numbers.sort()
numbers.reverse()

print(numbers[0]*10 + numbers[1] + numbers[2])

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

print(sum(numbers) + max(numbers)*9)
Buggy python submission (verdict: Runtime Error):
K = int(input())

if K%2 == 0:
  ak = k**2//4
else:
  ak = (k**2-1)//4

print(ak)

Fixed submission:
K = int(input())

if K%2 == 0:
  ak = K**2//4
else:
  ak = (K**2-1)//4

print(ak)

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

if K%2 == 0:
  ak = k**2//4
else:
  ak = (k**2-1)//4

print(ak)

Fixed submission:
K = int(input())

if K%2 == 0:
  ak = K**2//4
else:
  ak = (K**2-1)//4

print(ak)
Buggy python submission (verdict: Runtime Error):
print(2*N if N%2==1 else N)

Fixed submission:
N = int(input())

if N%2 == 0:
    print(N)
else:
    print(2*N)

Buggy python submission (verdict: Runtime Error):
print(2*N if N%2==0 else N)

Fixed submission:
N = int(input())

if N%2 == 0:
    print(N)
else:
    print(2*N)
Buggy python submission (verdict: Runtime Error):
print((S = input().count('+')-2)*2)

Fixed submission:
print((input().count('+')-2)*2)
Buggy python submission (verdict: Runtime Error):
X = int(input())

bekijosu=[]

for i in range(2, 1001):
    for j in range(2,10):
        if i ** j <= 1000:
            bekijosu.append(i ** j)

print(max([n for n in bekijosu if n <= X]))

Fixed submission:
X = int(input())

bekijosu=[1]

for i in range(2, 1001):
    for j in range(2,10):
        if i ** j <= 1000:
            bekijosu.append(i ** j)

print(max([n for n in bekijosu if n <= X]))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
X = tuple(map(int, input().split()))

for i in range(N):
    Y = list(X)
    del Y[i]
    Y.sort()
    print(Y[N//2-1])


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

Y = list(X)
Y.sort()

greater_median = Y[N//2]
smaller_median = Y[N//2-1]
average = (greater_median + smaller_median)/2

for x in X:
    if x <= average:
        print(greater_median)
    else:
        print(smaller_median)

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

import statistics

for i in range(N):
    tempX = list(X)
    del tempX[i]
    print(statistics.median(tempX))


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

Y = list(X)
Y.sort()

greater_median = Y[N//2]
smaller_median = Y[N//2-1]
average = (greater_median + smaller_median)/2

for x in X:
    if x <= average:
        print(greater_median)
    else:
        print(smaller_median)
Buggy python submission (verdict: Runtime Error):
A, B, C, X = (int(input()) for i in range(4))

cnt = 0
for a in range(A+1):
  for b in range(B+1):
  	for c in range(C+1):
    	if 500*a + 100*b + 50*c == X:
        	cnt += 1
print(cnt)

Fixed submission:
A, B, C, X = (int(input()) for i in range(4))

cnt = 0
for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      if 500*a + 100*b + 50*c == X:
        cnt += 1
print(cnt)

Buggy python submission (verdict: Runtime Error):
A, B, C, X = (int(input()) for i in range(4))

cnt = 0
for a in range(A+1):
  for b in range(B+1)
  	for c in range(C+1)
    	if 500*a + 100*b + 50*c == X:
        	cnt += 1
print(cnt)

Fixed submission:
A, B, C, X = (int(input()) for i in range(4))

cnt = 0
for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      if 500*a + 100*b + 50*c == X:
        cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
import sys
N, Y = map(int, input().split())
 
for x in range(N+1)[::-1]:
  if x <= N:
    for y in range(N-i+1)[::-1]:
      if x+y <= N:
        z = N-(x+y)
        if 10000*x + 5000*y + 1000*z == Y:
          print(x,y,z)
          sys.exit()
 
print(-1,-1,-1)

Fixed submission:
import sys
N, Y = map(int, input().split())

for x in range(N+1):
  for y in range(N+1):
    z = N-(x+y)
    if z < 0: break
    elif 10000*x + 5000*y + 1000*z == Y:
      print(x,y,z)
      sys.exit()

print(-1,-1,-1)

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

for x in range(N+1)[::-1]:
  for y in range(N+1)[::-1]:
	if x+y <= N:
      z = N-(x+y)
      if 10000*x + 5000*y + 1000*z == Y:
        print(x,y,z)
        sys.exit()

print(-1,-1,-1)

Fixed submission:
import sys
N, Y = map(int, input().split())

for x in range(N+1):
  for y in range(N+1):
    z = N-(x+y)
    if z < 0: break
    elif 10000*x + 5000*y + 1000*z == Y:
      print(x,y,z)
      sys.exit()

print(-1,-1,-1)

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

for x in range(N+1):
  for y in range(N+1):
    z = N-(x+y)
    if 10000*x + 5000*y + 1000*z = Y:
      print(x,y,z)
      sys.exit()

print(-1,-1,-1)

Fixed submission:
import sys
N, Y = map(int, input().split())

for x in range(N+1):
  for y in range(N+1):
    z = N-(x+y)
    if z < 0: break
    elif 10000*x + 5000*y + 1000*z == Y:
      print(x,y,z)
      sys.exit()

print(-1,-1,-1)
Buggy python submission (verdict: Runtime Error):
s1, s2, s3 = input().split()

ans = s1[0].upper()+s1[1].upper()+s1[2].upper()
print(ans)

Fixed submission:
s1, s2, s3 = input().split()

ans = s1[0].upper() + s2[0].upper() + s3[0].upper()
print(ans)
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())

if A==B:
  ans = 'EQUAL'
elif A<B:
  ans = 'LESS'
else:
  ans = 'GREATER'

print(ans)

Fixed submission:
A, B = int(input()), int(input())

if A==B:
  ans = 'EQUAL'
elif A<B:
  ans = 'LESS'
else:
  ans = 'GREATER'

print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
A.sort(reverse=True)
print(sum(A[1::2][N]))

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
A.sort(reverse=True)
print(sum(A[1::2][:N]))
Buggy python submission (verdict: Runtime Error):
K, S = map(int, input().split())

cnt = 0
for x in range(K+1):
  for y in range(K+1):
      if 0 <= S-(x+y) <= K 
        cnt += 1
print(cnt)

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

cnt = 0
for x in range(K+1):
  for y in range(K+1):
      if 0 <= S-(x+y) <= K:
        cnt += 1
print(cnt)

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

cnt = 0
for x in range(K+1):
  for y in range(K+1):
      if S-(x+y) in range(K+1):
        cnt += 1
print(cnt)

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

cnt = 0
for x in range(K+1):
  for y in range(K+1):
      if 0 <= S-(x+y) <= K:
        cnt += 1
print(cnt)

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

cnt = 0
for x in range(K+1):
  for y in range(K+1):
    for z in range(K+1):
      if x+y+z == S:
        cnt += 1
print(cnt)

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

cnt = 0
for x in range(K+1):
  for y in range(K+1):
      if 0 <= S-(x+y) <= K:
        cnt += 1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def solve():
    N = int(input())
    A = list(map(int, input().split()))
    ans = []
    for i in range(N):
        s = 0
        for j, a in enumerate(A):
            s += a * (1 if (((j - i) % N) % 2 == 0) else -1)
        ans.append(str(s))
    return ans


def main():
    print(' '.join(solve()))


if __name__ == "__main__":
    main()


Fixed submission:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def solve():
    N = int(input())
    A = list(map(int, input().split()))
    ans = []
    s = 0
    for j, a in enumerate(A):
        s += a * (1 if ((j % N) % 2 == 0) else -1)
    ans.append(str(s))
    for i in range(1, N):
        s = -s + 2 * A[i - 1]
        ans.append(str(s))
    return ans


def main():
    print(' '.join(solve()))


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys


def main():
    N = int(input())
    A = sorted(list(map(int, input().split())))
    if A[0] > 0:
        printAllPlus(A)
        sys.exit()
    elif A[N - 1] < 0:
        printAllMinus(A)
        sys.exit()

    i = -1
    for k, n in enumerate(A):
        if n >= 0:
            i = k
            break
    plus = A[i:]
    minus = A[:i]
    print(sum(plus) - sum(minus))
    while len(plus) > 1:
        p = plus.pop()
        m = minus.pop()
        print(m, p)
        minus.append(m - p)
    p0 = plus.pop()
    for m in minus:
        print(p0, m)
        p0 -= m


def printAllPlus(nums):
    ans = sum(nums) - 2 * nums[0]
    print(ans)
    tmp = nums[0]
    for n in nums[1:-1]:
        print(tmp, n)
        tmp -= n
    print(nums[-1], tmp)


def printAllMinus(nums):
    nums.reverse()
    ans = -sum(nums) + 2 * nums[0]
    print(ans)
    tmp = nums[0]
    for n in nums[1:]:
        print(tmp, n)
        tmp -= n


if __name__ == "__main__":
    main()


Fixed submission:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def main():
    N = int(input())
    A = sorted(list(map(int, input().split())))
    if A[0] >= 0:
        printAllPlus(A)
    elif A[-1] <= 0:
        printAllMinus(A)
    else:
        printMixed(A)


def printMixed(nums):
    i = -1
    for k, n in enumerate(nums):
        if n >= 0:
            i = k
            break
    plus = nums[i:]
    minus = nums[:i]
    print(sum(plus) - sum(minus))
    while len(plus) > 1:
        p = plus.pop()
        m = minus.pop()
        print(m, p)
        minus.append(m - p)
    p0 = plus.pop()
    for m in minus:
        print(p0, m)
        p0 -= m


def printAllPlus(nums):
    ans = sum(nums) - 2 * nums[0]
    print(ans)
    tmp = nums[0]
    for n in nums[1:-1]:
        print(tmp, n)
        tmp -= n
    print(nums[-1], tmp)


def printAllMinus(nums):
    nums.reverse()
    ans = -sum(nums) + 2 * nums[0]
    print(ans)
    tmp = nums[0]
    for n in nums[1:]:
        print(tmp, n)
        tmp -= n


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from functools import lru_cache
import sys
sys.setrecursionlimit(10 ** 9)

@lru_cache(maxsize=None)
def fib(n):
    if n == 0:
        return 1
    elif n == 1:
        return 1
    else:
        return fib(n-1) + fib(n-2)

PRIME = 10 ** 9 + 7
N, M = list(map(int, input().split()))
broken_stairs = []
for _ in range(M):
    broken_stairs.append(int(input()))

prev_broken = -1
cannot = False
ans = 1
for a in broken_stairs:
    if a - prev_broken == 1:
        cannot = True
        break
    ans *= fib(a - prev_broken - 2)
    ans %= PRIME
    prev_broken = a

ans *= fib(N - prev_broken - 1)
ans %= PRIME

if cannot:
    print(0)
else:
    print(ans)


Fixed submission:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

def fib_memo(n):
    if n <= 1:
        return 1
    memo = [0] * n
    memo[0] = 1
    memo[1] = 2
    for i in range(2, n):
        memo[i] = (memo[i - 1] + memo[i - 2]) % PRIME
    return memo[n-1]

PRIME = 10 ** 9 + 7
N, M = list(map(int, input().split()))
broken_stairs = []
for _ in range(M):
    broken_stairs.append(int(input()))

prev_broken = -1
cannot = False
ans = 1
for a in broken_stairs:
    if a - prev_broken == 1:
        cannot = True
        break
    ans *= fib_memo(a - prev_broken - 2)
    ans %= PRIME
    prev_broken = a

ans *= fib_memo(N - prev_broken - 1)
ans %= PRIME

if cannot:
    print(0)
else:
    print(ans)

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from functools import lru_cache

@lru_cache(maxsize=None)
def fib(n):
    if n == 0:
        return 1
    elif n == 1:
        return 1
    else:
        return fib(n-1) + fib(n-2)

PRIME = 10 ** 9 + 7
N, M = list(map(int, input().split()))
broken_stairs = []
for _ in range(M):
    broken_stairs.append(int(input()))

prev_broken = -1
cannot = False
ans = 1
for a in broken_stairs:
    if a - prev_broken == 1:
        cannot = True
        break
    ans *= fib(a - prev_broken - 2)
    ans %= PRIME
    prev_broken = a

ans *= fib(N - prev_broken - 1)
ans %= PRIME

if cannot:
    print(0)
else:
    print(ans)


Fixed submission:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

def fib_memo(n):
    if n <= 1:
        return 1
    memo = [0] * n
    memo[0] = 1
    memo[1] = 2
    for i in range(2, n):
        memo[i] = (memo[i - 1] + memo[i - 2]) % PRIME
    return memo[n-1]

PRIME = 10 ** 9 + 7
N, M = list(map(int, input().split()))
broken_stairs = []
for _ in range(M):
    broken_stairs.append(int(input()))

prev_broken = -1
cannot = False
ans = 1
for a in broken_stairs:
    if a - prev_broken == 1:
        cannot = True
        break
    ans *= fib_memo(a - prev_broken - 2)
    ans %= PRIME
    prev_broken = a

ans *= fib_memo(N - prev_broken - 1)
ans %= PRIME

if cannot:
    print(0)
else:
    print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
right_A = 0
left_B = 0
B_to_A = 0
AB_count = 0

for _ in range(N):
    target = input()
    AB_count += target.count('AB')
    if target[0] == 'B' and target[-1] == 'A':
        B_to_A += 1
    elif target[0] == 'B':
        left_B += 1
    elif target[-1] == 'A':
        right_A += 1

def recursive(x, y, z):
    if z == 0:
        return min(x, y)
    elif x == y == 0:
        return z - 1
    else:
        return recursive(x, y, z-1) + 1

print(recursive(right_A, left_B, B_to_A) + AB_count)


Fixed submission:
import sys
sys.setrecursionlimit(10 ** 5)

N = int(input())
right_A = 0
left_B = 0
B_to_A = 0
AB_count = 0

for _ in range(N):
    target = input()
    AB_count += target.count('AB')
    if target[0] == 'B' and target[-1] == 'A':
        B_to_A += 1
    elif target[0] == 'B':
        left_B += 1
    elif target[-1] == 'A':
        right_A += 1

def recursive(x, y, z):
    if z == 0:
        return min(x, y)
    elif x == y == 0:
        return z - 1
    else:
        return recursive(x, y, z-1) + 1

print(recursive(right_A, left_B, B_to_A) + AB_count)
Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
from fractions import gcd

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

def gcd_list(nums):
    return reduce(gcd, nums)

ans = -1

for i in range(N-1):
    g = gcd_list(A[:i] + A[i+1:])
    if g > ans:
        ans = g

g = gcd_list(A[:N-1])
if g > ans:
    ans = g

print(ans)


Fixed submission:
def make_divisors(n):
    divisors = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

N = int(input())
A = list(map(int, input().split()))
divisors = sorted(make_divisors(A[0]) + make_divisors(A[1]), reverse=True)

ans = 0
for d in divisors:
    ok_cnt = 0
    for a in A:
        if a % d == 0:
            ok_cnt += 1
    if ok_cnt >= N-1:
        ans = d
        break
print(ans)

Buggy python submission (verdict: Runtime Error):
from functools import reduce
from math import gcd

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

def gcd_list(nums):
    return reduce(gcd, nums)

ans = -1

for i in range(N-1):
    g = gcd_list(A[:i] + A[i+1:])
    if g > ans:
        ans = g

g = gcd_list(A[:N-1])
if g > ans:
    ans = g

print(ans)


Fixed submission:
def make_divisors(n):
    divisors = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

N = int(input())
A = list(map(int, input().split()))
divisors = sorted(make_divisors(A[0]) + make_divisors(A[1]), reverse=True)

ans = 0
for d in divisors:
    ok_cnt = 0
    for a in A:
        if a % d == 0:
            ok_cnt += 1
    if ok_cnt >= N-1:
        ans = d
        break
print(ans)

Buggy python submission (verdict: Runtime Error):
from functools import reduce
from math import gcd

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

def gcd_list(nums):
    return reduce(gcd, nums)

ans = -1

for i in range(N):
    g = gcd_list(A[:i] + A[i+1:])
    if g > ans:
        ans = g

print(ans)


Fixed submission:
def make_divisors(n):
    divisors = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

N = int(input())
A = list(map(int, input().split()))
divisors = sorted(make_divisors(A[0]) + make_divisors(A[1]), reverse=True)

ans = 0
for d in divisors:
    ok_cnt = 0
    for a in A:
        if a % d == 0:
            ok_cnt += 1
    if ok_cnt >= N-1:
        ans = d
        break
print(ans)
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
if A == B and B == C:
    print('Yes')
else:
    print('No')


Fixed submission:
A, B, C = map(int, input().split())
if A == B and B == C:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
if A == B == C:
    print('Yes')
else:
    print('No')


Fixed submission:
A, B, C = map(int, input().split())
if A == B and B == C:
    print('Yes')
else:
    print('No')