Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
x = int(input())
a = 0
if x == 0:
    print(0, 0)
else:
    while a ** 5 - (a - 1) ** 5 < x:
        a += 1
        b = a
        while a ** 5 - b ** 5 < x:
            b -= 1
            if a ** 5 - b ** 5 == x:
                break
        else:
            continue
        break
    print(a, b)

Fixed submission:
x = int(input())
a = 0
if x == 0:
    print(0, 0)
else:
    while a ** 5 - (a - 1) ** 5 <= x:
        a += 1
        b = a
        while a ** 5 - b ** 5 < x:
            b -= 1
            if a ** 5 - b ** 5 == x:
                break
        else:
            continue
        break
    print(a, b)

Buggy python submission (verdict: Runtime Error):
x = int(input())
a = 0
while a ** 5 - (a - 1) ** 5 < x:
    a += 1
    b = a
    while a ** 5 - b ** 5 < x:
        b -= 1
        if a ** 5 - b ** 5 == x:
            break
    else:
        continue
    break
print(a, b)


Fixed submission:
x = int(input())
a = 0
if x == 0:
    print(0, 0)
else:
    while a ** 5 - (a - 1) ** 5 <= x:
        a += 1
        b = a
        while a ** 5 - b ** 5 < x:
            b -= 1
            if a ** 5 - b ** 5 == x:
                break
        else:
            continue
        break
    print(a, b)

Buggy python submission (verdict: Runtime Error):
x = int(input())
i = -1
while (i + 1) ** 5 - i ** 5 < x:
    i += 1
    j = i
    while i ** 5 - j ** 5 < x:
        j -= 1
        #print(i, j)
        if i ** 5 - j ** 5 == 0:
            break
    else:
        continue
    break
print(i, j)

Fixed submission:
x = int(input())
a = 0
if x == 0:
    print(0, 0)
else:
    while a ** 5 - (a - 1) ** 5 <= x:
        a += 1
        b = a
        while a ** 5 - b ** 5 < x:
            b -= 1
            if a ** 5 - b ** 5 == x:
                break
        else:
            continue
        break
    print(a, b)
Buggy python submission (verdict: Runtime Error):
X=input()
a=list()
for i in range(len(X)):
    a.append(int(X[i:len(X)])%2019)
S=a.count(0)
for j in range(1,2018):
    b=a.count(j)
    S+=int(b*(b-1)/2)
print(S)  

Fixed submission:
a=list(map(int,input().split()))
if a[1]>=a[0]:
    print('unsafe')
else:
    print('safe')

Buggy python submission (verdict: Runtime Error):
S=int(input())
W=int(input())
if W>=S:
    print('unsafe')
else:
    print('safe')

Fixed submission:
a=list(map(int,input().split()))
if a[1]>=a[0]:
    print('unsafe')
else:
    print('safe')
Buggy python submission (verdict: Time Limit Exceeded):
X=input()
a=list()
for i in range(len(X)):
    a.append(int(X[i:len(X)])%2019)
S=a.count(0)    
for j in set(a):
    b=a.count(j)
    S+=int(b*(b-1)/2)
print(S)



Fixed submission:
A=[0]*2019
s=input()
a=0
b=1
for i in range(len(s)):
    b=b%2019
    a=(a+int(s[len(s)-1-i])*b)%2019
    b=b*10
    A[a]+=1
x=A[0]
for j in range(2019):
    x+=int(A[j]*(A[j]-1)/2)
print(x)

Buggy python submission (verdict: Time Limit Exceeded):
X=input()
a=list()
for i in range(len(X)):
    a.append(int(X[i:len(X)])%2019)
S=a.count(0)
for j in range(1,2018):
    b=a.count(j)
    S+=int(b*(b-1)/2)
print(S)  

Fixed submission:
A=[0]*2019
s=input()
a=0
b=1
for i in range(len(s)):
    b=b%2019
    a=(a+int(s[len(s)-1-i])*b)%2019
    b=b*10
    A[a]+=1
x=A[0]
for j in range(2019):
    x+=int(A[j]*(A[j]-1)/2)
print(x)

Buggy python submission (verdict: Time Limit Exceeded):
X=input()
a=list()
for i in range(len(X)):
    a.append(int(X[i:len(X)])%2019)
S=a.count(0)
for j in range(1,2018):
    b=a.count(j)
    S+=int(b*(b-1)/2)
print(S)  

Fixed submission:
A=[0]*2019
s=input()
a=0
b=1
for i in range(len(s)):
    b=b%2019
    a=(a+int(s[len(s)-1-i])*b)%2019
    b=b*10
    A[a]+=1
x=A[0]
for j in range(2019):
    x+=int(A[j]*(A[j]-1)/2)
print(x)

Buggy python submission (verdict: Time Limit Exceeded):
X=input()
a=list()
for i in range(len(X)):
    a.append(int(X[i:len(X)])%2019)
S=a.count(0)
for j in range(1,2018):
    S+=int(a.count(j)*(a.count(j)-1)/2)
print(S)    


Fixed submission:
A=[0]*2019
s=input()
a=0
b=1
for i in range(len(s)):
    b=b%2019
    a=(a+int(s[len(s)-1-i])*b)%2019
    b=b*10
    A[a]+=1
x=A[0]
for j in range(2019):
    x+=int(A[j]*(A[j]-1)/2)
print(x)

Buggy python submission (verdict: Time Limit Exceeded):
S=input()
x=0
for i in range(len(S)):
    for j in range(i+1,len(S)+1):
        a=int(S[i:j])
        if a%2019==0:
            x=x+1
print(x)   

Fixed submission:
A=[0]*2019
s=input()
a=0
b=1
for i in range(len(s)):
    b=b%2019
    a=(a+int(s[len(s)-1-i])*b)%2019
    b=b*10
    A[a]+=1
x=A[0]
for j in range(2019):
    x+=int(A[j]*(A[j]-1)/2)
print(x)
Buggy python submission (verdict: Time Limit Exceeded):
k=int(input())
from math import gcd
from itertools import product
L=tuple(product([i for i in range(1,k+1)],repeat=3))
s=0
for a,b,c in L:
    a=gcd(a,b)
    s+=gcd(a,c)
print(s)

Fixed submission:
s=0
k=int(input())
from math import gcd
from itertools import product
L=product([i for i in range(1,k+1)],repeat=2)
S=[gcd(a,b) for (a,b) in L]
from collections import Counter
S_counter=Counter(S)
for key,value in S_counter.items():
    for i in range(1,k+1):
        s+=gcd(key,i)*value
print(s)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
from collections import deque
s=deque(input())
R=[]
G=[]
B=[]
i=0
while s:
    x=s.popleft()
    if x=='R':
        R.append(i)
    elif x=='G':
        G.append(i)
    else:
        B.append(i)
    i+=1
#print(R)    
ans=0
from itertools import product
S=product(R,G,B)
for i,j,k in S:
    if i+j-2*k!=0 and j+k-2*i!=0 and k+i-2*j!=0:
        ans+=1
print(ans)        

Fixed submission:
from itertools import product
from collections import deque
n = int(input())
s = deque(input())
R = []
G = []
B = []
i = 0
while s:
    x = s.popleft()
    if x == 'R':
        R.append(i)
    elif x == 'G':
        G.append(i)
    else:
        B.append(i*2)
    i += 1
ans = len(R)*len(G)*len(B)
# print(len(R))
# print(len(G))
# print(len(B))
# print(R)
# print(G)
# print(B)
B = set(B)
S = product(R, G)
for i, j in S:
    if i + j in B:
        ans -= 1
    if 4 * i - 2*j in B:
        ans -= 1
    if 4 * j - 2 * i in B:
        ans -= 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
from collections import deque
s=deque(input())
R=[]
G=[]
B=[]
i=0
while s:
    x=s.popleft()
    if x=='R':
        R.append(i)
    elif x=='G':
        G.append(i)
    else:
        B.append(i)
    i+=1
#print(R)    
ans=0
for i in R:
    for j in G:
        for k in B:
            if not(i+j==2*k or j+k==2*i or k+i==2*j):
                ans+=1
print(ans)                

Fixed submission:
from itertools import product
from collections import deque
n = int(input())
s = deque(input())
R = []
G = []
B = []
i = 0
while s:
    x = s.popleft()
    if x == 'R':
        R.append(i)
    elif x == 'G':
        G.append(i)
    else:
        B.append(i*2)
    i += 1
ans = len(R)*len(G)*len(B)
# print(len(R))
# print(len(G))
# print(len(B))
# print(R)
# print(G)
# print(B)
B = set(B)
S = product(R, G)
for i, j in S:
    if i + j in B:
        ans -= 1
    if 4 * i - 2*j in B:
        ans -= 1
    if 4 * j - 2 * i in B:
        ans -= 1
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
x=100*a/8
y=100/8*(a+1)
z=10*b
w=10*(b+1)
import math
if max(math.ceil(z),math.ceil(x))<min(y,w)1 3 :
    print(math.ceil(max(z,x)))
else:
    print(-1)    

Fixed submission:
a,b=map(int,input().split())
x=100*a/8
y=100/8*(a+1)
z=10*b
w=10*(b+1)
import math
if max(math.ceil(z),math.ceil(x))<min(y,w) :
    print(math.ceil(max(z,x)))
else:
    print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
s=deque(input())
q=int(input())
for i in range(q):
    t=list(map(str,input().split()))
    if int(t[0])==1:
        s.reverse()
        #print(s)
    else:
        if int(t[1])==1:
            s.appendleft(t[2])
        else:
            s.append(t[2])
for k in s:
    print(k,end='')                



Fixed submission:
S=list(input())
#print(S)
q=int(input())
x=0
appends=[[] for i in range(2)]
for i in range(q):
    s=list(input().split())
    if int(s[0])==1:
        x+=1
    else:
        appends[(x+int(s[1])+1)%2].append(s[2])
        #print(appends)
if  x%2==1:
    S=S[::-1]
S=appends[x%2][::-1]+S+appends[(x+1)%2]
#print(S)
for k in S:
    print(k,end='')
Buggy python submission (verdict: Time Limit Exceeded):
N,P=map(int,input().split())
S=input()
if P==2 or P==5:
    x=0
    for j in range(N):
        if int(S[j])%P==0:
            x+=j+1
    print(x)
else:
    A=[0]*P
    a=0
    b=1
    for i in range(N):
        a=(a+int(S[(N-1-i)])*(b%P))%P
        A[a]+=1
        b=b*10
    x=A[0]
    for k in range(P):
        x+=int(A[k]*(A[k]-1)/2)
    print(x)
    

Fixed submission:
N,P=map(int,input().split())
S=input()
if P==2 or P==5:
    x=0
    for j in range(N):
        if int(S[j])%P==0:
            x+=j+1
    print(x)
else:
    A=[0]*P
    a=0
    b=1
    for i in range(N):
        a=(a+int(S[(N-1-i)])*b)%P
        A[a]+=1
        b=(b*10)%P
    x=A[0]
    for k in range(P):
        x+=int(A[k]*(A[k]-1)/2)
    print(x)

Buggy python submission (verdict: Time Limit Exceeded):
N,P=map(int,input().split())
S=input()
if P==2 or P==5:
    x=0
    for j in range(len(S)):
        if int(S[j])%P==0:
            x+=j+1
    print(x)
else:
    A=[0]*P
    a=0
    b=1
    for i in range(len(S)):
        a=(a+int(S[(len(S)-1-i)])*(b%P))%P
        A[a]+=1
        b=b*10
    x=A[0]
    for k in range(P):
        x+=int(A[k]*(A[k]-1)/2)
    print(x)

Fixed submission:
N,P=map(int,input().split())
S=input()
if P==2 or P==5:
    x=0
    for j in range(N):
        if int(S[j])%P==0:
            x+=j+1
    print(x)
else:
    A=[0]*P
    a=0
    b=1
    for i in range(N):
        a=(a+int(S[(N-1-i)])*b)%P
        A[a]+=1
        b=(b*10)%P
    x=A[0]
    for k in range(P):
        x+=int(A[k]*(A[k]-1)/2)
    print(x)
Buggy python submission (verdict: Time Limit Exceeded):
def S(n):
    k=list(str(n))
    import functools
    return functools.reduce(lambda x,y:x+y,[int(i) for i in k])
k=int(input())
def T(n):
    return n/S(n)
i=10
A=[1,2,3,4,5,6,7,8,9]
while len(A)<k:
   t=1
   i_list=list(str(i))
   i_len=len(i_list)
   import functools
   I=functools.reduce(lambda x,y:x+y,[int(k) for k in i_list])
   for j in range(len(i_list)):
       if (10**(i_len-1-j))*I<i:
           if int(i_list[j])!=9:
               t=0
   if t==1:
       A.append(i)
   i+=1
for i in range(k):
    print(A[i])


Fixed submission:
def S(n):
    k=list(str(n))
    import functools
    return functools.reduce(lambda x,y:x+y,[int(i) for i in k])
k=int(input())
def T(n):
    return n/S(n)
def f(N):
    len_N=len(str(N))
    A=[10**len_N+10**i-1 for i in range(len_N)]
    B=[T(i) for i in A]
    ans1=A[B.index(min(B))]
    i=0
    while True:
        I=10**(len_N-1)+10**i-1
        J=10**(len_N-1)+10**(i+1)-1
        if T(J)<T(I):
            i+=1
        else:
            break
    C=[((N+1)//(10**i))*10**i+j*10**i-1 for j in range(1,11)]
    D=[T(i) for i in C]
    ans2=C[D.index(min(D))]
    if T(ans1)<T(ans2):
        return(ans1)
    else:
        return(ans2)
K=[]
N=1
while len(K)<k:
    K.append(N)
    N=f(N)
for i in range(k):
    print(K[i])

Buggy python submission (verdict: Time Limit Exceeded):
def S(n):
    k=list(str(n))
    import functools
    return functools.reduce(lambda x,y:x+y,[int(i) for i in k])
k=int(input())
def T(n):
    return n/S(n)
A=list()
i=0
import functools
while len(A)<k:
    i=i+1
    if i<10:
        A.append(i)
    else:
        I=list(str(i))
        j=int(I[0])*10**(len(I)-1)+functools.reduce(lambda x,y:x+y,[9*10**i for i in range(len(I)-1)])
        if i>=j:
            if T(i)<=T(i+1):
                A.append(i)
for i in A:
    print(i)
    
            
    

Fixed submission:
def S(n):
    k=list(str(n))
    import functools
    return functools.reduce(lambda x,y:x+y,[int(i) for i in k])
k=int(input())
def T(n):
    return n/S(n)
def f(N):
    len_N=len(str(N))
    A=[10**len_N+10**i-1 for i in range(len_N)]
    B=[T(i) for i in A]
    ans1=A[B.index(min(B))]
    i=0
    while True:
        I=10**(len_N-1)+10**i-1
        J=10**(len_N-1)+10**(i+1)-1
        if T(J)<T(I):
            i+=1
        else:
            break
    C=[((N+1)//(10**i))*10**i+j*10**i-1 for j in range(1,11)]
    D=[T(i) for i in C]
    ans2=C[D.index(min(D))]
    if T(ans1)<T(ans2):
        return(ans1)
    else:
        return(ans2)
K=[]
N=1
while len(K)<k:
    K.append(N)
    N=f(N)
for i in range(k):
    print(K[i])
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
AB=list()
for i in range(N):
    AB.append(list(map(int,input().split())))
CD=list()
for i in range(N):
    CD.append(list(map(int,input().split())))
import itertools
ans=0
for v in itertools.permutations(CD):
    s=0
    for x,y in zip(AB,v):
        if x[0]<y[0] and x[1]<y[1]:
            s+=1
    if s>ans:
        ans=s
print(ans)


Fixed submission:
n=int(input())
ab=list()
cd=list()
for i in range(n):
    ab.append(list(map(int,input().split())))
for j in range(n):
    cd.append(list(map(int,input().split())))
cd.sort(key=lambda x:x[0])
AB=[[-1,-1]]*n
for i in range(n):
    S=[x for x in ab if x[0]<cd[i][0] and x[1]<cd[i][1]]
    S.sort(key=lambda k:k[1])
    if len(S)>0:
        AB[i]=S[-1]
        ab.remove(S[-1])
print(len(AB)-AB.count([-1,-1]))
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
# 整数の入力
# a = int(input())
# スペース区切りの整数の入力
# b, c = map(int, input().split())
# 文字列の入力
# s = input()
# 出力
# print("{} {}".format(a+b+c, s))

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:
# -*- coding: utf-8 -*-
# 整数の入力
# a = int(input())
# スペース区切りの整数の入力
# b, c = map(int, input().split())
# 文字列の入力
# s = input()
# 出力
# print("{} {}".format(a+b+c, s))
import sys
N = int(input())
A = list(map(int, input().split()))
for i in range(N):
    if A[i] == 0:
        print(0)
        sys.exit(0)
answer = 1
for i in range(N):
    answer *= A[i]
    if answer > 1000000000000000000:
       print(-1)
       sys.exit(0)

print(answer)
Buggy python submission (verdict: Runtime Error):
k = int(input())
if k % 7 == 0:
    L = 9 * k / 7
else:
    L = 9 * k
out = -1
s = 10
for i in range(L):
    if s % L == 1:
        out = i + 1
        break
    else:
        s = (s % L) * 10
print(out)


Fixed submission:
k = int(input())
if k % 7 == 0:
    L = 9 * k // 7
else:
    L = 9 * k
out = -1
s = 10
for i in range(L):
    if s % L == 1:
        out = i + 1
        break
    else:
        s = (s % L) * 10
print(out)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

k = int(input())
r = np.zeros(k)

out = 1
s = 7 % k
while s != 0:
    n = s + 7 * (10 ** out)
    s = n % k
    if r[s] == 1:
        out = -1
        break
    if s != 0:
        r[s] = 1
    out += 1
print(out)

Fixed submission:
k = int(input())
if k % 7 == 0:
    L = 9 * k // 7
else:
    L = 9 * k
out = -1
s = 10
for i in range(L):
    if s % L == 1:
        out = i + 1
        break
    else:
        s = (s % L) * 10
print(out)
Buggy python submission (verdict: Runtime Error):
n = int(input())
c = str(input())

r_m = c.count('R')
w_m = c.count('W')
wr_m = c.count('WR')

print(min(r_m, w_m) - wr_m //2)
s = 0
if r_m >= w_m:
    for i in range(len(c) - 1):
    if c[i] == 'W' and c[i + 1] == 'R':
        c[i + 1] = 'W'
        s += 1

Fixed submission:
n = int(input())
c = str(input())

r_m = c.count('R')
w_m = 0
out = max(r_m, w_m)
for i in range(n):
    if c[i] == 'W':
        w_m += 1
    else:
        r_m -= 1
    out = min(out, max(w_m, r_m))
print(out)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
A = list(map(int, input().strip().split()))

b = 0
e = max(A)
L = e // 2
while e - b >= 1:
    m = sum(list(map(lambda x: x // L, A)))
    if m <= k:
        e = L
        L = (e + b) // 2
    else:
        b = L
        L = (e + b) // 2
print(e)


Fixed submission:
n, k = map(int, input().split())
A = list(map(int, input().strip().split()))

b = 0
e = max(A)
L = e // 2
while e - b > 1:
    L = (e + b) // 2
    m = sum(list(map(lambda x: (x - 1) // L, A)))
    if m <= k:
        e = L
    else:
        b = L
print(e)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

for i in range(n):
    j = i + 1
    x, y, z = 1, 1, 1
    out = 0
    while x**2 + y**2 + z**2 + x*y + y*z + z*x <= j:
        while x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x <= j:
            while x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x <= j:
                out += 1 if x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x == j else 0
                z += 1
            z = 1
            y += 1
        y, z = 1, 1
        x += 1
    print(out)


Fixed submission:
import numpy as np
n = int(input())
A = np.zeros(n)

x, y, z = 1, 1, 1

while x**2 + y**2 + z**2 + x*y + y*z + z*x <= n:
    while x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x <= n:
        while x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x <= n:
            i = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            A[i - 1] += 1
            z += 1
        z = 1
        y += 1
    y, z = 1, 1
    x += 1
for i in range(n):
    print(int(A[i]))
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

d = int(input())
C = np.array(list(map(int, input().strip().split())))
S = np.array([list(map(int, input().strip().split())) for i in range(d)])

D = np.zeros(26)
s_d = np.zeros(d)
W = np.ones(26) + C / 100
out = np.zeros(d)
t = 0
for k in range(100):
    for i in range(d):
        day = i + 1
        temp_score = 0
        con = 0
        d_l = [day]*26
        for j in range(26):
            score = S[i][j]
            score -= sum((d_l - D) * C)
            score += (day - D[j]) * C[j] * W[j]
            if score > temp_score:
                con = j
                temp_score = score
        out[i] = con + 1
        D[con] = i + 1
        t += temp_score
        s_d[i] = t
        W = W * 0.95
        W[j] = W[j] * 1.05
for i in out:
    print(int(i))


Fixed submission:
import numpy as np

d = int(input())
C = np.array(list(map(int, input().strip().split())))
S = np.array([list(map(int, input().strip().split())) for i in range(d)])
D = np.zeros(26)

t = 0
for i in range(d):
    day = i + 1
    temp_score = 0
    con = 0
    d_l = [day]*26
    for j in range(26):
        score = S[i][j]
        score -= sum((d_l - D) * C)
        score += (day - D[j]) * C[j]
        if score > temp_score:
            con = j
            temp_score = score
    print(con + 1)
    D[con] = i + 1
    t += temp_score
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
out = 0
for i in range(n):
    j = 1
    while (i + 1) * j <= n:
        out += (i + 1) * j
        j += 1

print(out)


Fixed submission:
n = int(input())
out = 0
for i in range(n):
    k = n // (i + 1)
    out += (i + 1) * k * (k + 1)/2

print(int(out))
Buggy python submission (verdict: Runtime Error):
n = int(input())
w_dict = {1:"a", 2: "b", 3:"c", 4:"d", 5:"e", 6:"f", 7:"g" , 8:"h", 9:"i", 10:"j", 11:"k"
        , 12:"l", 13:"m", 14:"n", 15:"o" , 16:"p", 17:"q", 18:"r", 19:"s", 20:"t", 21:"u"
        , 22:"v", 23:"w", 24:"x", 25:"y", 26:"z"}
out = ""
while n > 26:
    out = out + w_dict[n % 26]
    n = n // 26

out = out + w_dict[n]
print(out[::-1])

Fixed submission:
n = int(input())

n_c = n - 1
w_dict = {0: "a", 1: "b", 2: "c", 3: "d", 4: "e", 5:"f", 6:"g" , 7:"h", 8:"i", 9:"j", 10:"k"
        , 11:"l", 12:"m", 13:"n", 14:"o" , 15:"p", 16:"q", 17:"r", 18:"s", 19:"t", 20:"u"
        , 21:"v", 22:"w", 23:"x", 24:"y", 25:"z"}
out = ""
while n_c > 25:
    out = out + w_dict[n_c % 26]
    n_c = n_c // 26 - 1

out = out + w_dict[n_c]
print(out[::-1])
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

k = int(input())
out = 0
for i in range(k):
    a = i + 1
    for j in range(k):
        b = j + 1
        gcd2 = np.gcd(a, b)
        for m in range(k):
            c = m + 1
            out = out + np.gcd(c, gcd2)


print(out)

Fixed submission:
from math import  gcd

k = int(input())
out = 0

# 3つとも同じ数字のとき
out = out + (1 + k) * k / 2

#2つが同じ数字の時
for i in range(k):
    a = i + 1
    b = i + 1
    for j in range(a - 1):
        c = j + 1
        out = out + gcd(a, c) * 6

#3つとも違うとき
for m in range(k):
    a = m + 1
    for n in range(a - 1):
        b = n + 1
        gcd2 = gcd(a, b)
        for o in range(b - 1):
            c = o + 1
            out = out + gcd(gcd2, c) * 6


print(int(out))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
num_list = list(map(int, input().split()))
out = "YES"
for j in range(len(num_list)):
    for k in num_list[j + 1:]:
        out = "NO" if num_list[j] == k else out
print(out)


Fixed submission:
n = int(input())
num_list = list(map(int, input().split()))
out = "YES" if len(num_list) == len(set(num_list)) else "NO"
print(out)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
num_list = list(map(int, input().split()))
k_sum = sum(num_list[0:b])
max_sum = k_sum
for i, j in zip(num_list[0:], num_list[k:]):
    k_sum -= i
    k_sum += j
    max_sum = max(max_sum, k_sum)
out = (max_sum + b) / 2
print(out)

Fixed submission:
a, b = map(int, input().split())
num_list = list(map(int, input().split()))
k_sum = sum(num_list[0:b])
max_sum = k_sum
for i, j in zip(num_list[0:], num_list[b:]):
    k_sum -= i
    k_sum += j
    max_sum = max(max_sum, k_sum)
out = (max_sum + b) / 2
print(out)

Buggy python submission (verdict: Time Limit Exceeded):
a, b = map(int, input().split())
num_list = list(map(int, input().split()))
k_sum = 0.0
for j in range(a - b + 1):
    k_sum = max(k_sum, sum(num_list[j:j+b]))

out = (k_sum + b) / 2
print(out)

Fixed submission:
a, b = map(int, input().split())
num_list = list(map(int, input().split()))
k_sum = sum(num_list[0:b])
max_sum = k_sum
for i, j in zip(num_list[0:], num_list[b:]):
    k_sum -= i
    k_sum += j
    max_sum = max(max_sum, k_sum)
out = (max_sum + b) / 2
print(out)

Buggy python submission (verdict: Time Limit Exceeded):
a, b = map(int, input().split())
num_list = list(map(int, input().split()))
k_sum = 0.0
for j in range(a - b + 1):
    k_list = num_list[j:j+b]
    k_sum = max(k_sum, sum(k_list))

out = (k_sum + b) / 2
print(out)

Fixed submission:
a, b = map(int, input().split())
num_list = list(map(int, input().split()))
k_sum = sum(num_list[0:b])
max_sum = k_sum
for i, j in zip(num_list[0:], num_list[b:]):
    k_sum -= i
    k_sum += j
    max_sum = max(max_sum, k_sum)
out = (max_sum + b) / 2
print(out)

Buggy python submission (verdict: Time Limit Exceeded):
a, b = map(int, input().split())
num_list = list(map(int, input().split()))
out = 0.0
for j in range(a - b + 1):
    k_list = num_list[j:j+b]
    k_sum = 0.0
    for i in k_list:
        k_sum = k_sum + ((1 + i) * i / 2) / i
        out = max(out, k_sum)
print(out)

Fixed submission:
a, b = map(int, input().split())
num_list = list(map(int, input().split()))
k_sum = sum(num_list[0:b])
max_sum = k_sum
for i, j in zip(num_list[0:], num_list[b:]):
    k_sum -= i
    k_sum += j
    max_sum = max(max_sum, k_sum)
out = (max_sum + b) / 2
print(out)
Buggy python submission (verdict: Runtime Error):
a = int(input())
array = list(map(int, input().strip().split()))
out = 0
for i in range(a):
    if array[i] == min(array[0:i+1]):
        out = out + 1
print(out)

Fixed submission:
a, b = map(int, input().split())
out = "Yes" if a == b else "No"
print(out)