Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
def main():
    from sys import stdin
    def input():
        return stdin.readline().strip()
    
    n, c = map(int, input().split())
    d = [list(map(int, input().split())) for _ in range(c)]

    
    # if I can change the color of the same square many times
    # Warshall-Floyd algorithm
    for k in range(c):
        for i in range(c):
            for j in range(c):
                if d[i][j] > d[i] + d[j]:
                    d[i][j] = d[i][j]
    

    color = [list(map(int, input().split())) for _ in range(n)]

    counters = [[0] * c for _ in range(3)]
    for i in range(n):
        for j in range(n):
            counters[(i+j) % 3][color[i][j] - 1] += 1
    
    # full search
    cost = []
    for group in counters:
        l = []
        for i in range(c):
            num = 0
            for j in range(c):
                num += d[j][i] * group[j]
            l.append((num, i))
        l.sort()
        cost.append(l[c-3:])

    ans = 10 ** 9
    for i in range(3):
        for j in range(3):
            for k in range(3):
                if cost[0][i][1] != cost[1][j][1] and cost[1][j][1] != cost[2][k][1] and cost[2][k][1] != cost[0][i][1]:
                    if ans > cost[0][i][0] + cost[1][j][0] + cost[2][k][0]:
                        ans = cost[0][i][0] + cost[1][j][0] + cost[2][k][0]
    
    print(ans)

main()

Fixed submission:
def main():
    from sys import stdin
    def input():
        return stdin.readline().strip()
    
    n, c = map(int, input().split())
    d = [list(map(int, input().split())) for _ in range(c)]

    '''
    # if I can change the color of the same square many times
    # Warshall-Floyd algorithm
    for k in range(c):
        for i in range(c):
            for j in range(c):
                if d[i][j] > d[i][k] + d[k][j]:
                    d[i][j] = d[i][k] + d[k][j]
    '''

    color = [list(map(int, input().split())) for _ in range(n)]

    counters = [[0] * c for _ in range(3)]
    for i in range(n):
        for j in range(n):
            counters[(i+j) % 3][color[i][j] - 1] += 1
    
    # full search
    cost = []
    for group in counters:
        l = []
        # from j to i
        for i in range(c):
            num = 0
            for j in range(c):
                num += d[j][i] * group[j]
            l.append((num, i))
        l.sort()
        cost.append(l[:3])

    ans = 10 ** 9
    for i in range(3):
        for j in range(3):
            for k in range(3):
                if cost[0][i][1] != cost[1][j][1] and cost[1][j][1] != cost[2][k][1] and cost[2][k][1] != cost[0][i][1]:
                    if ans > cost[0][i][0] + cost[1][j][0] + cost[2][k][0]:
                        ans = cost[0][i][0] + cost[1][j][0] + cost[2][k][0]
    
    print(ans)

main()
Buggy python submission (verdict: Runtime Error):
s = list(set((input())))

s.sort()

for i in range(26):
    if s[i] != chr(i + ord('a')):
        print(chr(i + ord('a')))
        exit()
else:
    print('None')

Fixed submission:
s = list(set((input())))

s.sort()

for i in range(26):
    if i >= len(s) or s[i] != chr(i + ord('a')):
        print(chr(i + ord('a')))
        exit()
else:
    print('None')
Buggy python submission (verdict: Runtime Error):
from sys import stdin, setrecursionlimit
def input():
    return stdin.readline().strip()

#setrecursionlimit((10**5) * 2)

n = int(input())
edge = [[] for _ in range(n)]
for _ in range(n-1):
    i, j = map(int, input().split())
    i -= 1
    j -= 1
    edge[i].append(j)
    edge[j].append(i)

# root: 0
# edge1: parent→children
# edge2: child→parent
# tfに探索済かどうかを保存する
tf = [False] * n
tf[0] = True
edge1 = [[] for _ in range(n)]
edge2 = [-1] * n

def divide(i):
    for j in edge[i]:
        if tf[j]:
            continue
        else:
            tf[j] = True
            edge1[i].append(j)
            edge2[j] = i
            divide(j)

divide(0)

now = n - 1
l = [n-1]
while edge2[now] != -1:
    now = edge2[now]
    l.append(now)

root = l[len(l)//2 - 1]

def divide2(i):
    ans = 1
    for j in edge1[i]:
        ans += divide2(j)
    return ans

Snuke = divide2(root)
Fennec = n - Snuke

if Snuke < Fennec:
    print('Fennec')
else:
    print('Snuke')

Fixed submission:
from sys import stdin, setrecursionlimit
def input():
    return stdin.readline().strip()

setrecursionlimit((10**5) * 2)

n = int(input())
edge = [[] for _ in range(n)]
for _ in range(n-1):
    i, j = map(int, input().split())
    i -= 1
    j -= 1
    edge[i].append(j)
    edge[j].append(i)

# root: 0
# edge1: parent→children
# edge2: child→parent
# tfに探索済かどうかを保存する
tf = [False] * n
tf[0] = True
edge1 = [[] for _ in range(n)]
edge2 = [-1] * n

def divide(i):
    for j in edge[i]:
        if tf[j]:
            continue
        else:
            tf[j] = True
            edge1[i].append(j)
            edge2[j] = i
            divide(j)

divide(0)

now = n - 1
l = [n-1]
while edge2[now] != -1:
    now = edge2[now]
    l.append(now)

root = l[len(l)//2 - 1]

def divide2(i):
    ans = 1
    for j in edge1[i]:
        ans += divide2(j)
    return ans

Snuke = divide2(root)
Fennec = n - Snuke

if Snuke < Fennec:
    print('Fennec')
else:
    print('Snuke')
Buggy python submission (verdict: Runtime Error):
h, w = map(int, input().split())

if h % 3 == 0 or w % 3 == 0:
    print(0)
    exit()

def solve2(h, w):
    if h % 2 == 0 or w % 2 == 0:
        return [h*w // 2]
    elif h < w:
        return [h * (w//2), h * (w//2 + 1)]

def solve1(h, w):
    ans = []
    ans.append(max([(h//3) * w] + solve2(h - h//3, w)) - min([(h//3) * w] + solve2(h - h//3, w)))
    ans.append(max([(h//3 + 1) * w] + solve2(h - h//3 -1, w)) - min([(h//3 + 1) * w] + solve2(h - h//3 -1, w)))
    return min(ans)

print(min([solve1(h, w), solve1(w, h)]))

Fixed submission:
h, w = map(int, input().split())

if h % 3 == 0 or w % 3 == 0:
    print(0)
    exit()

def solve2(h, w):
    if h % 2 == 0 or w % 2 == 0:
        return [h*w // 2]
    elif h < w:
        return [h * (w//2), h * (w//2 + 1)]
    else:
        return [w * (h//2), w * (h//2 + 1)]

def solve1(h, w):
    ans = []
    ans.append(max([(h//3) * w] + solve2(h - h//3, w)) - min([(h//3) * w] + solve2(h - h//3, w)))
    ans.append(max([(h//3 + 1) * w] + solve2(h - h//3 - 1, w)) - min([(h//3 + 1) * w] + solve2(h - h//3 - 1, w)))
    return min(ans)

print(min([solve1(h, w), solve1(w, h)]))
Buggy python submission (verdict: Runtime Error):
from sys import stdin
def input():
    return stdin.readline().strip()

n, weight = map(int, input().split())
w, v = [0]*n, [0]*n
for i in range(n):
    w[i], v[i] = map(int, input().split())

base = w[0]
#q, r = divmod(weight, base)

for i in range(n):
    w[i] -= base

# dp[i][j] = i個選んで重さの余りがjの時の、価値の最大値
dp = [[0] * (3*n) for _ in range(n+1)]

for i in range(n):
    for j in range(i, -1, -1):
        for k in range(3*j+1):
            if dp[j+1][k+w[i]] < dp[j][k] + v[i]:
                dp[j+1][k+w[i]] = dp[j][k] + v[i]

ans = 0
for i in range(n+1):
    for j in range(3*n):
        if base * i + j <= weight and ans < dp[i][j]:
            ans = dp[i][j]

print(ans)

Fixed submission:
from sys import stdin
def input():
    return stdin.readline().strip()

n, weight = map(int, input().split())
w, v = [0]*n, [0]*n
for i in range(n):
    w[i], v[i] = map(int, input().split())

base = w[0]

for i in range(n):
    w[i] -= base

# dp[i][j] = i個選んで重さの余りがjの時の、価値の最大値
dp = [[0] * (3*n+1) for _ in range(n+1)]

for i in range(n):
    for j in range(i, -1, -1):
        for k in range(3*j+1):
            if dp[j+1][k+w[i]] < dp[j][k] + v[i]:
                dp[j+1][k+w[i]] = dp[j][k] + v[i]

ans = 0
for i in range(n+1):
    for j in range(3*n+1):
        if base * i + j <= weight and ans < dp[i][j]:
            ans = dp[i][j]

print(ans)
Buggy python submission (verdict: Runtime Error):
def main():
    from sys import stdin
    def input():
        return stdin.readline().strip()

    n, m = map(int, input().split())
    tree = [[] for _ in range(n)]
    for _ in range(m):
        i, j, k = map(int, input().split())
        i -= 1
        j -= 1
        tree[i].append((k, j))
        tree[j].append((k, i))

    # dijkstra
    import heapq
    from numpy import zeros

    ans = 0
    for i in range(n):
        for j in tree[i]:
            seen = zeros(n)
            goal = j[1]
            base = j[0]
            seen[i] = 1
            todo = []
            heapq.heapify(todo)
            for k in tree[i]:
                if k[0] < base and k != j:
                    heapq.heappush(todo, k)
            while len(todo) > 0:
                k = heapq.heappop(todo)
                if k[1] == goal:
                    if k[0] < base:
                        ans += 1
                    break
                seen[k[1]] = 1
                for l in tree[k[1]]:
                    if seen[l[1]] == 0 and k[0] + l[0] < base:
                        heapq.heappush(todo, (k[0] + l[0], l[1]))

    print(ans // 2)

main()

Fixed submission:
def main():
    from sys import stdin
    def input():
        return stdin.readline().strip()

    n, m = map(int, input().split())
    tree = [[] for _ in range(n)]
    for _ in range(m):
        i, j, k = map(int, input().split())
        i -= 1
        j -= 1
        tree[i].append((k, j))
        tree[j].append((k, i))

    # dijkstra
    import heapq
    from numpy import zeros

    ans = 0
    for i in range(n):
        for j in tree[i]:
            seen = zeros(n)
            goal = j[1]
            base = j[0]
            seen[i] = 1
            todo = []
            heapq.heapify(todo)
            for k in tree[i]:
                if k[0] < base and k != j:
                    heapq.heappush(todo, k)
            while len(todo) > 0:
                k = heapq.heappop(todo)
                if k[1] == goal:
                    if k[0] < base:
                        ans += 1
                    break
                seen[k[1]] = 1
                for l in tree[k[1]]:
                    if seen[l[1]] == 0 and k[0] + l[0] < base:
                        heapq.heappush(todo, (k[0] + l[0], l[1]))

    print(ans // 2)

main()
Buggy python submission (verdict: Runtime Error):
open Batteries
let n = read_int ()
let a = read_line () 
let a2 = a |> String.split_on_char ' ' |> List.map int_of_string
let rec loop lst r=
  match lst with
  | [] -> r
  | first :: rest ->
    if List.mem 0 a2 then 0 else
    if first <> 1 && 1000000000000000000 / 2 <= r then -1 else
    loop rest (r*first)

let l = loop a2 1
let _ = l |> Printf.printf "%d\n"

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
i = 1
if 0 in a:
  print(0)
  exit()

for x in a:
  i *= x
  if i > 10 ** 18:
    break


if i > 10 ** 18:
  i = -1
print(i)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = map(int, input().split())
i = 1
for x in a:
  i *= x

if i > 1000000000000000000:
  i = -1
print(i)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
i = 1
if 0 in a:
  print(0)
  exit()

for x in a:
  i *= x
  if i > 10 ** 18:
    break


if i > 10 ** 18:
  i = -1
print(i)
Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())

AB = "b" * A + "r" * B

o = N // len(AB) + 1
l = AB * o

print(l[:N].count("b"))


Fixed submission:
N, A, B = map(int, input().split())
ans = 0
amari = N % (A + B)
o = N // (A + B)
if amari > A:
    amari = A

print(amari + A * o)
Buggy python submission (verdict: Runtime Error):
let n = read_int ()

let () = n / 2 + (n mod 2) |> print_int; print_string "\n"

Fixed submission:
N = int(input())
print(int(N / 2 if not N % 2 else N // 2 + 1))
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
num = [input().split() for y in range(N)]


def check(target):
    if not len(target) == N:
        return False
    for x, y in num:
        if not target[int(x)-1] == y:
            return False
    return True


for i in range(1000):
    if check(str(i)):
        print(i)
        exit()

print(-1)


Fixed submission:
N, M = map(int, input().split())
num = [input().split() for y in range(M)]


def check(target):
    if not len(target) == N:
        return False
    for x, y in num:
        if not target[int(x)-1] == y:
            return False
    return True


for i in range(1000):
    if check(str(i)):
        print(i)
        exit()

print(-1)

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
num = [input().split() for y in range(N)]


def check(target):
    if not len(target) == N:
        return False
    for x, y in num:
        if not target[x-1] == y:
            return False
    return True


for i in range(1000):
    if check(str(i)):
        print(i)
        exit()
        
print(-1)


Fixed submission:
N, M = map(int, input().split())
num = [input().split() for y in range(M)]


def check(target):
    if not len(target) == N:
        return False
    for x, y in num:
        if not target[int(x)-1] == y:
            return False
    return True


for i in range(1000):
    if check(str(i)):
        print(i)
        exit()

print(-1)

Buggy python submission (verdict: Runtime Error):
for x in range(0, 1000):
    if not len(str(x)) == N:
        continue
    p = []
    for i, y in enumerate(num, start=0):
        if not y:
            y.append("0")
        try:
            p.append(str(x)[i] in y)
        except:
            continue
    if all(p):
        print(x)
        exit()

print(-1)

Fixed submission:
N, M = map(int, input().split())
num = [input().split() for y in range(M)]


def check(target):
    if not len(target) == N:
        return False
    for x, y in num:
        if not target[int(x)-1] == y:
            return False
    return True


for i in range(1000):
    if check(str(i)):
        print(i)
        exit()

print(-1)
Buggy python submission (verdict: Runtime Error):
n, k = input().split()
print(len(str(int(n, int(k)))))

Fixed submission:
import numpy as np
n, r = map(int, input().split())
print(len(str(np.base_repr(n,r))))
Buggy python submission (verdict: Runtime Error):
import collections
N = int(input())
S_list = [input() for i in range(N)]
c = collections.Counter(S_list)
l = {}
m = c[0][0]
for x, y in zip(*c):
  if x in l.keys():
    l[x] = [y]
  else:
    l[x].append(y)

  
for y in sorted(l[m]):
  print(y)

Fixed submission:
N = int(input())

value_dict = {}

for x in range(N):
    value = input()
    if value not in value_dict.keys():
        value_dict[value] = 1
        continue
    value_dict[value] += 1

max_count = max(value_dict.values())
max_values = [k for k, v in value_dict.items() if v == max_count]
max_values.sort()


print("\n".join(max_values))

Buggy python submission (verdict: Runtime Error):
import collections
N = int(input())
S_list = [input() for i in range(N)]
c = collections.Counter(S_list)
l = {}
for x, y in zip(*c):
  if x in l.keys():
    l[x] = [y]
  else:
    l[x].append(y)

for x in sorted(l.keys(), reverse=True):
  for y in sorted(l[x]):
    print(y)




Fixed submission:
N = int(input())

value_dict = {}

for x in range(N):
    value = input()
    if value not in value_dict.keys():
        value_dict[value] = 1
        continue
    value_dict[value] += 1

max_count = max(value_dict.values())
max_values = [k for k, v in value_dict.items() if v == max_count]
max_values.sort()


print("\n".join(max_values))
Buggy python submission (verdict: Runtime Error):
H, A = map(int, input.split())
i = 0
while H > 0:
  H -= A
  i += 1
print(i)


Fixed submission:
H, A = map(int, input().split())
i = 0
while H > 0:
  H -= A
  i += 1
print(i)

Buggy python submission (verdict: Runtime Error):
H, A = map(int, input.split())
i = 0
while H <= 0:
  H -= A
  i += 1
print(i)

Fixed submission:
H, A = map(int, input().split())
i = 0
while H > 0:
  H -= A
  i += 1
print(i)
Buggy python submission (verdict: Runtime Error):
import asyncio
a, b, c, d = map(int, input().split())
loop = asyncio.get_event_loop()
i = c if c < d else d
num = 0
global num
loop_was_not_running = not loop.is_running()
async def y(q):
  if q % c and q % d:
    num += 1
    
def print_hello_world(future):
  if loop_was_not_running:
    loop.stop()

li = [y(o) for o in range(a, b)]
future = asyncio.gather(*li)
asyncio.ensure_future(future)
future.add_done_callback(print_hello_world)
    if loop_was_not_running:
        loop.run_forever()
print(num)


Fixed submission:
s = input()
for k in ["11", "22", "33", "44", "55", "66", "77", "88", "99", "00"]:
  if k in s:
    print('Bad')
    break
else:
  print("Good")
Buggy python submission (verdict: Runtime Error):
n, y = map(int, input().split())

for yukiti in range(0, 1 + (y // 10000)):
  for higuti in range(0, 1 + (y - 10000 * yukiti) // 5000):
    noguti = (y - 10000 * yukiti - 5000 * higuti) // 1000
    paper = yukiti + higuti + noguti # 今気がついたんだけど全員tiで終わってるわw
    #count = yukiti * 10000 + higuti * 5000 + noguti * 
    if paper == n:
      print("{0} {1} {2}".format(yukiti, higuti, noguti))
      exit(1)

print("-1 -1 -1")

Fixed submission:
n, y = map(int, input().split())

for yukiti in range(0, 1 + (y // 10000)):
  for higuti in range(0, 1 + (y - 10000 * yukiti) // 5000):
    noguti = (y - 10000 * yukiti - 5000 * higuti) // 1000
    paper = yukiti + higuti + noguti # 今気がついたんだけど全員tiで終わってるわw
    #count = yukiti * 10000 + higuti * 5000 + noguti * 
    if paper == n:
      print("{0} {1} {2}".format(yukiti, higuti, noguti))
      exit(0)

print("-1 -1 -1")
Buggy python submission (verdict: Runtime Error):
kami = list()
N = int(input())
for x in range(N):
  i = int(input())
  if i in kami:
    kami.discard(i)
  else:
    kami.append(i)
print(len(kami))


Fixed submission:
kami = set()
N = int(input())
for x in range(N):
  i = int(input())
  if i in kami:
    kami.remove(i)
  else:
    kami.add(i)
print(len(kami))

Buggy python submission (verdict: Time Limit Exceeded):
kami = list()
N = int(input())
for x in range(N):
  i = int(input())
  if i in kami:
    kami.remove(i)
  else:
    kami.append(i)
print(len(kami))


Fixed submission:
kami = set()
N = int(input())
for x in range(N):
  i = int(input())
  if i in kami:
    kami.remove(i)
  else:
    kami.add(i)
print(len(kami))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
def digitsum(n):
    x=0
    while n>=10:
        x+=n%10
        n//=10
    x+=n
    return x
x=digitsum(n)
print("Yes" if x%9==0 else "No")

Fixed submission:
n=int(input())
print("Yes" if n%9==0 else "No")
Buggy python submission (verdict: Time Limit Exceeded):
k=int(input())
for i in range(1,10**6):
    x=int("7"*i)
    if x%k==0:
        print(i)
        exit()
print(-1)

Fixed submission:
k = int(input())
now = k
r = 0
for i in range(1, k + 100):
    r = (r * 10 % k + 7) % k
    if r==0:
        print(i)
        exit()
print(-1)
Buggy python submission (verdict: Runtime Error):
x,n=map(int,input().split())
p=list(map(int, input().split()))
youso=[]
for i in range(1,101):
    if not i in p:
        youso+=[i]
hikaku=[]
for i in youso:
    hikaku+=[(i,abs(x-i))]
hikaku1=sorted(hikaku,key=lambda x:x[1])
if n == 0:res = x
else :res=hikaku1[0][0]
print(res)

Fixed submission:
x,n=map(int,input().split())
p=list(map(int, input().split()))
youso=[]
for i in range(-300,1000):
    if not i in p:
        youso+=[i]
hikaku=[]
for i in youso:
    hikaku+=[(i,abs(x-i))]
hikaku1=sorted(hikaku,key=lambda x:x[1])
res=hikaku1[0][0]
print(res)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ls = list(map(int, input().split()))
res = 1
for i in range(0, n):
    res *= ls[i]
print(res if res <= 10 ** 18 else "-1")

Fixed submission:
n=int(input())
a=list(map(int, input().split()))
if 0 in a:
    print(0)
    exit()
else:
    res=1
    for i in a:
        res*=i
        if res>10**18:
            res=-1
            break
    print(res)
Buggy python submission (verdict: Runtime Error):
K = int(input())
a,b = map(int, input().split())
if a < K and K < B:
    print("OK")
elif (b - a) > K:
    print("OK")
elif (b-a)== 0 and K == 1:
    print("OK")
else :
    print("NG")

Fixed submission:
K = int(input())
a,b = map(int, input().split())
kekka = ("NG")
for i in range(a,b+1):
    if i % K == 0:
        kekka = ("OK")
print(kekka)

Buggy python submission (verdict: Runtime Error):
K = int(input())
a,b = map(int, input().split())
if a < K and K < B:
    print("OK")
elif (b - a)/K >= 1:
    print("OK")
elif (b-a)== 0 and K == 1:
    print("OK")
else :
    print("NG")

Fixed submission:
K = int(input())
a,b = map(int, input().split())
kekka = ("NG")
for i in range(a,b+1):
    if i % K == 0:
        kekka = ("OK")
print(kekka)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int, input().split()))
ans = []*(n-1)
for i in range (1,n+1):
    print(a.count(i))



Fixed submission:
n=int(input())
a=list(map(int, input().split()))
ans = [0]*n
for i in a:
    ans[i-1]+=1
print(*ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
import math
res=0
for a in range(1,n+1):
    for b in range(1, n + 1):
        gcd1 = math.gcd(a, b)
        for c in range(1, n + 1):
           gcd2=math.gcd(gcd1,c)
           res+=gcd2
print(res)

Fixed submission:
n=int(input())
import math
res=0
for a in range(1,n+1):
    for b in range(1, n + 1):
        gcd1 = math.gcd(a, b)
        for c in range(1, n + 1):
           gcd2=math.gcd(gcd1,c)
           res+=gcd2
print(res)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
import math
res=0
for a in range(1,n+1):
    for b in range(1, n + 1):
        for c in range(1, n + 1):
           gcd1=math.gcd(a,b)
           gcd2=math.gcd(gcd1,c)
           res+=gcd2
print(res)

Fixed submission:
n=int(input())
import math
res=0
for a in range(1,n+1):
    for b in range(1, n + 1):
        gcd1 = math.gcd(a, b)
        for c in range(1, n + 1):
           gcd2=math.gcd(gcd1,c)
           res+=gcd2
print(res)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
import math
res=0
for a in range(1,n+1):
    for b in range(1, n + 1):
        for c in range(1, n + 1):
           gcd1=math.gcd(a,b)
           gcd2=math.gcd(gcd1,c)
           res+=gcd2
print(res)

Fixed submission:
n=int(input())
import math
res=0
for a in range(1,n+1):
    for b in range(1, n + 1):
        gcd1 = math.gcd(a, b)
        for c in range(1, n + 1):
           gcd2=math.gcd(gcd1,c)
           res+=gcd2
print(res)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
import math
res=0
for a in range(1,n+1):
    for b in range(1, n + 1):
        for c in range(1, n + 1):
            li=[]
            for i in range(1,max(a,b,c)+1):
                if a%i==0 and b%i ==0 and c%i==0:
                    li+=[i]
            res+=max(li)
print(res)

Fixed submission:
n=int(input())
import math
res=0
for a in range(1,n+1):
    for b in range(1, n + 1):
        gcd1 = math.gcd(a, b)
        for c in range(1, n + 1):
           gcd2=math.gcd(gcd1,c)
           res+=gcd2
print(res)
Buggy python submission (verdict: Runtime Error):
s = input()
print("Yes" if s[2] == s[3] and s[4] == s[5] else "No)

Fixed submission:
s = input()
print("Yes" if s[2] == s[3] and s[4] == s[5] else "No")
Buggy python submission (verdict: Runtime Error):
n,k = map(int, input().split())
res = 0
a = 0
while res == 0:
    if k**(a-1) < n and n <= k**a:
        ans = a
        res += 1
        break
    a += 1
print(ans)

Fixed submission:
n, r = map(int, input().split())
print( r if n >= 10 else r + (10-n)*100)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
name=[]
num=[]
for i in range(n):
    s=input()
    if s in name:
        num[name.index(s)]+=1
    else:
        name.append(s)
        num.append(1)
x=max(num)
res=[]
for i in range(len(num)):
    if num[i]==x:
        res.append(name[i])
res.sort()
print(*res)

Fixed submission:
n=int(input())
d={}
m=1
for i in range(n):
    s=input()
    if s in d:
        d[s]+=1
        m=max(m,d[s])
    else:
        d[s]=1
se=set()
for i in d:
    if d[i]==m:
        se.add(i)
se=list(se)
se.sort()
print(*se)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=set(a)
print("YES" if n == len(b), else "NO")


Fixed submission:
s,t = map(str, input().split())
a,b = map(int, input().split())
u = input()
if u == s:
    print(a-1, b)
else :
    print(a, b-1)