Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

A_sum = 0
A_max = 0
B_sum = 0
B_max = 0
best_num = 0
A_max = N
flag = True
for i in range(N):
    A_sum += A[i]
    if A_sum > K:
        A_sum -= A[i]
        A_max = i
        flag = False
        break
A = A[0:A_max]
now_num = A_max
mixsum = A_sum
b_num = 0
if flag:
    for i in range(M):
        mixsum += B[i]
        if mixsum > K:
            mixsum -= B[i]
            now_num += i
            b_num = i
            break
A.reverse()
best_num = 0
for i in range(A_max):
    A_sum -= A[i]
    mixsum = A_sum
    now_num = A_max - i
    for j in range(M):
        mixsum += B[b_num+j]
        now_num += 1
        if mixsum > K:
            now_num -= 1
            break
    if now_num > best_num:
        best_num = now_num
print(best_num)


Fixed submission:
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))


A_max = 0
B_sum = 0
B_max = 0
best_num = 0

flag = True # Aだけ読んで時間が尽きるかどうか

# Aを最大まで読んだ時の冊数と時間
A_max = N
A_sum = 0
for i in range(N):
    A_sum += A[i]
    if A_sum > K:
        A_sum -= A[i]
        A_max = i
        break
A = A[0:A_max]
now_num = A_max # 今の読んだ数
mixsum = A_sum # A,Bを合わせた時間
b_num = 0 # bを読んだ数
if flag:
    now_num += M
    b_num = M
    for i in range(M):
        mixsum += B[i]
        if mixsum > K:
            mixsum -= B[i]
            now_num = A_max + i
            b_num = i  #i冊読んだので次取るならi番目から
            break
A.reverse()
best_num = now_num
for i in range(A_max):
    mixsum -= A[i]
    now_num -= 1
    for j in range(b_num, M):
        mixsum += B[j]
        now_num += 1
        if mixsum > K:
            mixsum -= B[j]
            now_num -= 1
            b_num = j #miss
            break
    if now_num > best_num:
        best_num = now_num
print(best_num)
Buggy python submission (verdict: Runtime Error):
def main():
    N = int(input())
    A = list(map(int, input().split()))
    
    A.sort()
    A_set = set(A)
    count = 0
    last_num = 0
    flag = True
    now_num = 0
    half_num = 0
    count_flag = False
    
    if A.count(1) == 1:
        print(1)
        exit()
    for i in range(N):
        count_flag = True
        now_num = A[i]
        half_num = A[i]/2
        if now_num == last_num:
            if flag:
                count -= 1
                flag = False
        else:
            for j in range(0, i):
                if A[j] > half_num:
                    break
                if now_num % A[j] == 0:
                    count_flag = False
                    break
            if count_flag:
                if not flag:
                    flag = True
                count += 1
            last_num = A[i]
    print(count)

if __name__ == '__main__':
    main()

Fixed submission:
x = list(map(int, input().split()))
print(x.index(0)+1)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import decimal
N = int(input())
A = list(map(int, input().split()))

new_A = np.array(A, dtype=np.dtype(decimal.Decimal))
Answer = int(new_A.prod())

if Answer > 1000000000000000000:
    print(-1)
else:
    print(Answer)

Fixed submission:

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

B = set(A)
Answer = 1
if 0 in B:
    print(0)
    exit()
for i in range(N):
    Answer *= A[i]
    if Answer > 1000000000000000000:
        print(-1)
        exit()
print(Answer)

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

Answer = 1
for i in range(N):
    Answer *= A[i]

if Answer > 1000000000000000000:
    print(-1)
else:
    print(Answer)


Fixed submission:

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

B = set(A)
Answer = 1
if 0 in B:
    print(0)
    exit()
for i in range(N):
    Answer *= A[i]
    if Answer > 1000000000000000000:
        print(-1)
        exit()
print(Answer)

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

Answer = 1
for i in range(N):
    Answer *= A[i]

if Answer > 10**18:
    print(-1)
else:
    print(Answer)

Fixed submission:

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

B = set(A)
Answer = 1
if 0 in B:
    print(0)
    exit()
for i in range(N):
    Answer *= A[i]
    if Answer > 1000000000000000000:
        print(-1)
        exit()
print(Answer)
Buggy python submission (verdict: Runtime Error):
N, M, X = map(int, input().split())
CA = [list(map(int, input().split())) for i in range(N)]
min_can = set()


def cal_score(bought_books):
    global CA
    global M
    global N
    global X
    algo_Q = [0]*M
    cost = 0
    for i in range(N):
        if bought_books[i] == 1:
            for j in range(1, M+1):
                algo_Q[j-1] += CA[i][j]
            cost += CA[i][0]
    flag = True
    for i in range(M):
        if algo_Q[i] < X:
            flag = False
            break
    if flag:
        global min_can
        min_can.add(cost)
    return 0


def next_book(book_list):
    global N
    global M

    if len(book_list) == N:
       return cal_score(book_list)
    book_list.append(0)
    next_book(book_list)
    book_list.pop(-1)

    book_list.append(1)
    next_book(book_list)
    book_list.pop(-1)
    return 0


book_list = []
next_book(book_list)
print(min(min_can))



Fixed submission:
N, M, X = map(int, input().split())
CA = [list(map(int, input().split())) for i in range(N)]
min_can = set()


def cal_score(bought_books):
    global CA
    global M
    global N
    global X
    algo_Q = [0]*M
    cost = 0
    for i in range(N):
        if bought_books[i] == 1:
            for j in range(1, M+1):
                algo_Q[j-1] += CA[i][j]
            cost += CA[i][0]
    flag = True
    for i in range(M):
        if algo_Q[i] < X:
            flag = False
            break
    if flag:
        global min_can
        min_can.add(cost)
    return 0


def next_book(book_list):
    global N
    global M

    if len(book_list) == N:
       return cal_score(book_list)
    book_list.append(0)
    next_book(book_list)
    book_list.pop(-1)

    book_list.append(1)
    next_book(book_list)
    book_list.pop(-1)
    return 0


book_list = []
next_book(book_list)
if set() == min_can:
    print(-1)
else:
    print(min(min_can))
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())

if A < 1 or A > 9 or B < 1 or B > 9:
    print("-1")
else:
    print(A*B)

Fixed submission:
A, B = map(int, input().split())
if A < 1 or A > 9 or B < 1 or B > 9:
    print("-1")
else:
    print(A*B)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

answer_list=[]
for i in range(1, int((N/2))+1):
    if N % i == 0:
        s = N/i
        answer_list.append(s+i)

print(int(min(answer_list)) - 2)

Fixed submission:
import math
N = int(input())

answer_list=[]
for i in range(1, int((math.sqrt(N)))+1):
    if N % i == 0:
        s = N/i
        answer_list.append(s+i)

print(int(min(answer_list)) - 2)
Buggy python submission (verdict: Runtime Error):
s = input()
print(s[3])


Fixed submission:
s = input()
print(s[:3])
Buggy python submission (verdict: Runtime Error):
s, w = input().split(' ')
s = int(s)
w = int(w)
 
if s > w :
  print('safe')
else:
  pritn('unsafe')

Fixed submission:
s, w = input().split(' ')
s = int(s)
w = int(w)
 
if s > w :
  print('safe')
else:
  print('unsafe')

Buggy python submission (verdict: Runtime Error):
s, w = input()
s = int(s)
w = int(w)

if s > w :
  print('safe')
else:
  pritn('unsafe')

Fixed submission:
s, w = input().split(' ')
s = int(s)
w = int(w)
 
if s > w :
  print('safe')
else:
  print('unsafe')
Buggy python submission (verdict: Runtime Error):
a,b,c = input().split(' ')
l = []
l.append([a,b,c])
n=len(set(l))
if n == 2:
  print('Yes')
else:
  print('No')


Fixed submission:
a,b,c = input().split(' ')
l = []
l.append(a)
l.append(b)
l.append(c)
l = set(l)
n=len(l)
if n == 2:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
def inverse_lookup(d, x):
    a = []
    for k,v in d.items():
        if x == v:
          a.append(k)
    return a

n = int(input())
w = {}
for i in range(n):
  if i in w:
    w[i] += 1
  else:
    w[i] = 1
m = max(w.values())
for i in inverse_lookup(w,m).sort(reverse=True):
  print(i)

Fixed submission:
def inverse_lookup(d, x):
    a = []
    for k,v in d.items():
        if x == v:
          a.append(k)
    return sorted(a)

n = int(input())
w = {}
for _ in range(n):
  i = input()
  if i in w:
    w[i] += 1
  else:
    w[i] = 1
m = max(w.values())
for j in inverse_lookup(w,m):
  print(j)
Buggy python submission (verdict: Runtime Error):
s, t = input()
a, b = input().split(" ")
u = input()
a = int(a)
b = int(b)
u = int(u)

if u == s:
  print(a - 1, b)
else:
  print(a, b-1)

Fixed submission:
s, t = input().split()
a, b = input().split(" ")
u = input()
a = int(a)
b = int(b)

 
if u == s:
  print(a - 1, b)
else:
  print(a, b-1)
Buggy python submission (verdict: Runtime Error):
h, n = input().split(" ")
h = int(h)
n = int(n)
a = [int(input()) for i in range(n) ]
if sum(a) >= h:
  print('Yes')
else:
  print('No')

Fixed submission:
h, n = input().split(" ")
h = int(h)
n = int(n)
a = input().split(" ")
a = [int(x) for x in a]
if sum(a) >= h:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
n,m = inout().split(' ')
n = int(n)
m = int(m)
if n == m:
  print('Yes')
else:
 print('No')

Fixed submission:
n,m = input().split(' ')
n = int(n)
m = int(m)
if n == m:
  print('Yes')
else:
 print('No')
Buggy python submission (verdict: Runtime Error):
k, x = input().split("")
k = int(k)
x = int(x)
if 500*k >= x:
  print('Yes')
else:
  print('No')

Fixed submission:
k,x = input().split(' ') 
k = int(k)
x = int(x)
if 500 * k >= x:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = list(input())
q = list(input())

b = [s + 1 for s in range(n)]
print(b)
for i in p:
  print(i)

Fixed submission:
n = input()
s = input()
print(s.count('ABC') )
Buggy python submission (verdict: Runtime Error):
n = int(input())
s, t = input()
l = []
m = []
r = ""
for i in s:
  l.append(i)
for i in t:
  m.append(i)

for i in range(n):
  r += (l[i] + m[i])
print(r)

Fixed submission:
n = int(input())
s, t = input().split(' ')
l = []
m = []
r = ""
for i in s:
  l.append(i)
for i in t:
  m.append(i)
 
for i in range(n):
  r += (l[i] + m[i])
print(r)
Buggy python submission (verdict: Runtime Error):
m1, d1 = input().split()
m1, d2 = input().split()
d2 = int(d2)
result = 0

if d2 == 1
  result = 1
print(result)

Fixed submission:
m1, d1 = input().split()
m1, d2 = input().split()
d2 = int(d2)
result = 0

if d2 == 1:
  result = 1
print(result)
Buggy python submission (verdict: Runtime Error):
n  = int(input())
x = n // 100
result = 0
if n % 100 < 5 * x && x < 1000000:
  result = 1
print(result)
  

Fixed submission:
n  = int(input())
x = n // 100
result = 0
if n % 100 <= 5 * x and x <= 1000000:
  result = 1
print(result)
Buggy python submission (verdict: Runtime Error):
x = int(input())
y + int(input())
sum = 0
if x ==1 and y ==1:
  sum += 400000

if x == 1:
  sum += 300000
elif x == 2 :
  sum += 200000
elif x == 3:
  sum += 100000
  
if y == 1:
  sum += 300000
elif y == 2 :
  sum += 200000
elif y == 3:
  sum += 100000

print(sum)

  
  


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

sum = 0
if x ==1 and y ==1:
  sum += 400000
 
if x == 1:
  sum += 300000
elif x == 2 :
  sum += 200000
elif x == 3:
  sum += 100000
  
if y == 1:
  sum += 300000
elif y == 2 :
  sum += 200000
elif y == 3:
  sum += 100000
 
print(sum)
Buggy python submission (verdict: Runtime Error):
r = input()
print (r **2)

Fixed submission:
r = int(input())
print(r*r)
Buggy python submission (verdict: Runtime Error):
a=input()
n = 0
print(int((a-1)/2))

  
  

Fixed submission:
a=int(input())

print(int((a-1)/2))
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

n = int(input())
a = list(map(int, input().split()))
q = int(input())
b = [0 for _ in range(q)]
c = [0 for _ in range(q)]
for i in range(q):
    b[i], c[i] = map(int, input().split())

a = np.array(a)
for num, rep in zip(b, c):
    if num in set(a):
        a = np.where(a == num, rep, a)
        print(sum(a))
    else:
        print(sum(a))
        continue

Fixed submission:
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
X = Counter(a)
q = int(input())
b = [0 for _ in range(q)]
c = [0 for _ in range(q)]
for i in range(q):
    b[i], c[i] = map(int, input().split())

ans = sum(a)
for num, rep in zip(b, c):
    ans += (rep * X[num] - num * X[num])
    X[rep] += X[num]
    del(X[num])
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
q = int(input())
b = [0 for _ in range(q)]
c = [0 for _ in range(q)]
for i in range(q):
    b[i], c[i] = map(int, input().split())

for num, rep in zip(b, c):
    if num in set(a):
        a = [rep if ele == num else ele for ele in a]
        print(sum(a))
    else:
        print(sum(a))
        continue

Fixed submission:
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
X = Counter(a)
q = int(input())
b = [0 for _ in range(q)]
c = [0 for _ in range(q)]
for i in range(q):
    b[i], c[i] = map(int, input().split())

ans = sum(a)
for num, rep in zip(b, c):
    ans += (rep * X[num] - num * X[num])
    X[rep] += X[num]
    del(X[num])
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
q = int(input())
b = [0 for _ in range(q)]
c = [0 for _ in range(q)]
for i in range(q):
    b[i], c[i] = map(int, input().split())

for num, rep in zip(b, c):
    a = [rep if ele == num else ele for ele in a]
    print(sum(a))

Fixed submission:
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
X = Counter(a)
q = int(input())
b = [0 for _ in range(q)]
c = [0 for _ in range(q)]
for i in range(q):
    b[i], c[i] = map(int, input().split())

ans = sum(a)
for num, rep in zip(b, c):
    ans += (rep * X[num] - num * X[num])
    X[rep] += X[num]
    del(X[num])
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = map(int, input().split())

mul = 1
for ele in a:
    mul *= ele
print(mul if mul <= 1e18 else -1)

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

mul = 1
if 0 in set(a): mul = 0
else:
    iter = 0
    for i in range(n):
        mul *= a[i]
        if mul > 1e18:
            mul = -1
            break
print(mul)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

mul = 1
for i in range(n):
    mul *= a[i]
print(mul if mul <= 1e18 else -1)

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

mul = 1
if 0 in set(a): mul = 0
else:
    iter = 0
    for i in range(n):
        mul *= a[i]
        if mul > 1e18:
            mul = -1
            break
print(mul)
Buggy python submission (verdict: Runtime Error):
a, b = map(float, input().split())

print(long(a * b))

Fixed submission:
from math import floor
import decimal
a, b = input().split()
a = int(a)
b = decimal.Decimal(b)
#print(a, b)
#print(type(a), type(b))
print(floor(a * b))

Buggy python submission (verdict: Runtime Error):
a, b = map(float, input().split())

print(int(a * B))

Fixed submission:
from math import floor
import decimal
a, b = input().split()
a = int(a)
b = decimal.Decimal(b)
#print(a, b)
#print(type(a), type(b))
print(floor(a * b))
Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())
A = np.zeros(N)
B = np.zeros(N)
for i in range(N):
    A[i], B[i] = map(int, input().split())

am = np.median(A)
bm = np.median(B)

if n % 2 == 0:
    print(int((bm - am) * 2 + 1))
else:
    print(int((bm - am) + 1))

Fixed submission:
import numpy as np
N = int(input())
A = np.zeros(N)
B = np.zeros(N)
for i in range(N):
    A[i], B[i] = map(int, input().split())

am = np.median(A)
bm = np.median(B)

if N % 2 == 0:
    print(int((bm - am) * 2 + 1))
else:
    print(int((bm - am) + 1))

Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())
A = []
B = []
for _ in range(N):
    A[i], B[i] = map(int, input().split())

A = np.array(A)
B = np.array(B)
am = np.median(A)
bm = np.median(B)

if n % 2 == 0:
    print((bm - am) * 2 + 1)
else:
    print((bm - am) + 1)

Fixed submission:
import numpy as np
N = int(input())
A = np.zeros(N)
B = np.zeros(N)
for i in range(N):
    A[i], B[i] = map(int, input().split())

am = np.median(A)
bm = np.median(B)

if N % 2 == 0:
    print(int((bm - am) * 2 + 1))
else:
    print(int((bm - am) + 1))

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = []
B = []
for _ in range(N):
    A[i], B[i] = map(int, input().split())

if n / 2 == 0:
    Am = (A[N / 2] + A[(N / 2) + 1]) / 2
    Bm = (B[N / 2] + B[(N / 2) + 1]) / 2
    print((Bm - Am) * 2 + 1)
else:
    Am = A[(N + 1) / 2]
    Bm = B[(N + 1) / 2]
    print(Bm - Am + 1)

Fixed submission:
import numpy as np
N = int(input())
A = np.zeros(N)
B = np.zeros(N)
for i in range(N):
    A[i], B[i] = map(int, input().split())

am = np.median(A)
bm = np.median(B)

if N % 2 == 0:
    print(int((bm - am) * 2 + 1))
else:
    print(int((bm - am) + 1))

Buggy python submission (verdict: Runtime Error):
n = int(input())
A = []
B = []
for _ in range(n):
    A[i], B[i] = map(int, input().split())

if n / 2 == 0:
    Am = (A[N / 2] + A[(N / 2) + 1]) / 2
    Bm = (B[N / 2] + B[(N / 2) + 1]) / 2
    print((Bm - Am) * 2 + 1)
else:
    Am = A[(N + 1) / 2]
    Bm = B[(N + 1) / 2]
    print(Bm - Am + 1)

Fixed submission:
import numpy as np
N = int(input())
A = np.zeros(N)
B = np.zeros(N)
for i in range(N):
    A[i], B[i] = map(int, input().split())

am = np.median(A)
bm = np.median(B)

if N % 2 == 0:
    print(int((bm - am) * 2 + 1))
else:
    print(int((bm - am) + 1))
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
graph=[[] for i in range(n)]
sirusi=[0]*n
for i in range(m):
    a,b=map(int,input().split())
    a-=1;b-=1
    graph[a].append(b)
    graph[b].append(a)
D=deque([0])
visited=[False]*n
visited[0]=True
while D:
    v=D.popleft()
    for i in graph[v]:
        if visited[i]:continue
        visited[i]=True
        sirusi[i]=v
        D.append(i)
print("Yes")
for i in range(1,n):
    print(sirusi[i]+1)

Fixed submission:
N, M = map(int, input().split())
AB = []
cons = [[] for _ in range(N)]
for i in range(M):
    a, b = map(int, input().split())
    cons[a - 1].append(b - 1)
    cons[b - 1].append(a - 1)
visited = [False for _ in range(N)]
visited[0] = True
Q = [0]
sirusi = [0 for _ in range(N)]
while Q:
    v = Q.pop(0)
    for i in cons[v]:
        if visited[i]: continue
        visited[i] = True
        sirusi[i] = v
        Q.append(i)
print("Yes")
for i in range(1, N):
    print(sirusi[i] + 1)
Buggy python submission (verdict: Time Limit Exceeded):
#200802C
X = int(input())
L = len(str(X))
#print(L)


Y = 0

for l in range(L):
    Y += 7*10**l
    
flag = 0
for i in range(10000000):
    Y = Y%X
    #print(i)

    if Y == 0:
        ans = L+i
        flag = 1
        break
    else: 
        Z = Y * 10 + 7
        if Z == Y:
            break
        else:
            Y = Z

if flag == 0:
    print("-1")
else:
    print(ans)

        


Fixed submission:
#200802C
X = int(input())
L = len(str(X))
#print(L)


Y = 0

for l in range(L):
    Y += 7*10**l
    
flag = 0
for i in range(1000000):
    Y = Y%X
    #print(i)

    if Y == 0:
        ans = L+i
        flag = 1
        break
    else: 
        Z = Y * 10 + 7
        if Z == Y:
            break
        else:
            Y = Z

if flag == 0:
    print("-1")
else:
    print(ans)

Buggy python submission (verdict: Runtime Error):
#200802C
X = int(input())
L = len(str(X))
#print(L)



for l in range(L):
    Y += 7*10**l
    
flag = 0
for i in range(10000000):
    Y = Y%X
    #print(i)

    if Y == 0:
        ans = L+i
        flag = 1
        break
    else: 
        Z = Y * 10 + 7
        if Z == Y:
            break
        else:
            Y = Z

if flag == 0:
    print("-1")
else:
    print(ans)


Fixed submission:
#200802C
X = int(input())
L = len(str(X))
#print(L)


Y = 0

for l in range(L):
    Y += 7*10**l
    
flag = 0
for i in range(1000000):
    Y = Y%X
    #print(i)

    if Y == 0:
        ans = L+i
        flag = 1
        break
    else: 
        Z = Y * 10 + 7
        if Z == Y:
            break
        else:
            Y = Z

if flag == 0:
    print("-1")
else:
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
#200426C
N = int(input())

X = []
ans = 0
for i in range(N):
    S = str(input())
    X.append(S)
for i in range(N):
    if len(X)==0:
        break
    else:
        for j in range(X.count(X[0])):
            X.remove(X[0])
        ans += 1
print(ans)

Fixed submission:
#200426C
import collections
N = int(input())

X = []
ans = 0
for i in range(N):
    S = str(input())
    X.append(S)
Y = collections.Counter(X)
print(len(Y))

Buggy python submission (verdict: Time Limit Exceeded):
#200426C
N = int(input())

X = []
ans = 0
for i in range(N):
    S = str(input())
    if X.count(S)==0:
        X.append(S)
        ans += 1
print(ans)


Fixed submission:
#200426C
import collections
N = int(input())

X = []
ans = 0
for i in range(N):
    S = str(input())
    X.append(S)
Y = collections.Counter(X)
print(len(Y))
Buggy python submission (verdict: Time Limit Exceeded):
#200412C
K = int(input())
import math

ans = 0
for i in range(K):
    for k in range(K):
        for l in range (K):
            ans += math.gcd(math.gcd(i+1, k+1), l+1)
print(int(ans))

Fixed submission:
#200412C
K = int(input())
import math

ans = 0
for i in range(K):
    for k in range(K):
        x = math.gcd(i+1,k+1)
        if x==1:
            ans +=K
        else:
            for l in range (K):
                ans += math.gcd(x, l+1)
            
print(int(ans))
Buggy python submission (verdict: Time Limit Exceeded):
#200404C
N, K = map(int, input().split())

while abs(N-K) < N:
    N = abs(N-K)
print(N)

Fixed submission:
#200404C
N, K = map(int, input().split())
flag = 1
X = N%K
if abs(X-K)<X:
    print(abs(X-K))
else:
    print(X)
Buggy python submission (verdict: Runtime Error):
#200322D
N = int(input())
A = list(map(int,input().split()))
count = 0
for i in range(N):
    for j in range(N):
        if A[i] == A[j]:
            count += 1
All = (count - N) / 2
#print(int(All))

for i in range(N):
    count = 0
    for j in range(N):
        if A[i] == A[j]:
            count += 1
    print(int(All - count + 1))

Fixed submission:
#200322A
N, M = map(int,input().split())
x = N * (N - 1)/2 + M * (M-1) /2
print(int(x))