Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
A, B, N = map(int, input().split())
ans_dict = {}
for x in range(N + 1):
    if (A * x) // B >= (A * (x // B)):
        ans_dict.setdefault((((A * x) // B) - (A * (x // B))), x)
    else:
        break


print(max(ans_dict))

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

if N >= B:
    x = B - 1
    ans = ((A * x) // B) - (A * (x // B))
else:
    x = N
    ans = ((A * x) // B) - (A * (x // B))


print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
A, B, N = map(int, input().split())
ans_dict = {}
for x in range(N + 1):
    ans_dict.setdefault((((A * x) // B) - (A * (x // B))), x)


print(max(ans_dict))

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

if N >= B:
    x = B - 1
    ans = ((A * x) // B) - (A * (x // B))
else:
    x = N
    ans = ((A * x) // B) - (A * (x // B))


print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
A, B, N = map(int, input().split())
ans_list = []
for x in range(N + 1):
    ans_list.append(((A * x) // B) - (A * (x // B)))


print(max(ans_list))

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

if N >= B:
    x = B - 1
    ans = ((A * x) // B) - (A * (x // B))
else:
    x = N
    ans = ((A * x) // B) - (A * (x // B))


print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

K = int(input())

ans = 0
for i in range(1, K+1):
    for h in range(1, K+1):
        for j in range(1, K+1):
            ans += gcd(i, h, j)

print(ans)

Fixed submission:
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

K = int(input())

ans = 0
for i in range(1, K+1):
    for h in range(1, K+1):
        for j in range(1, K+1):
            ans += gcd(i, h, j)

print(ans)
Buggy python submission (verdict: Runtime Error):
S = list(input())

for i in range(len(S) - 1):
    if S[i] == "h" and S[i + 1] == "i" and S[i + 2] != "i":
        print("Yes")
        exit()

print("No")

Fixed submission:
S = input()

if len(S) % 2 != 0:
    print("No")
    exit()

if len(S) == 2 and S == "hi":
    print("Yes")
    exit()
elif len(S) == 4 and S == "hihi":
    print("Yes")
    exit()
elif len(S) == 6 and S == "hihihi":
    print("Yes")
    exit()
elif len(S) == 8 and S == "hihihihi":
    print("Yes")
    exit()
elif len(S) == 10 and S == "hihihihihi":
    print("Yes")
    exit()

print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
p_list = list(map(int, input().split()))

j = 1
temp = p_list[0]
for i in range(1,N):
  if p_list[i] > temp:
    continue
  if p_list[i] <= min(p_list[0:i+1]):
    j = j + 1
  else:
    temp = p_list[i]

print(j)

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

j = 1
temp = p_list[0]
for i in range(1,N):
  if temp >= p_list[i]:
    j += 1
    temp = min(temp,p_list[i])

print(j)

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

j = 1
temp = p_list[0]
for i in range(1,N):
  if p_list[i] > temp:
    continue
  elif p_list[i] == 1:
    j = j + 1
    break
  sort_list = sorted(p_list[0:i+1])
  if p_list[i] <= sort_list[0]:
    j = j + 1
  else:
    temp = p_list[i]

print(j)

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

j = 1
temp = p_list[0]
for i in range(1,N):
  if temp >= p_list[i]:
    j += 1
    temp = min(temp,p_list[i])

print(j)

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

j = 1
temp = p_list[0]
for i in range(1,N):
  if p_list[i] > temp:
    continue
  sort_list = sorted(p_list[0:i+1])
  if p_list[i] <= sort_list[0]:
    j = j + 1
  else:
    temp = p_list[i]

print(j)

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

j = 1
temp = p_list[0]
for i in range(1,N):
  if temp >= p_list[i]:
    j += 1
    temp = min(temp,p_list[i])

print(j)

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

j = 1
for i in range(1,N):
  sort_list = sorted(p_list[0:i+1])
  if p_list[i] <= sort_list[0]:
    j = j + 1

print(j)

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

j = 1
temp = p_list[0]
for i in range(1,N):
  if temp >= p_list[i]:
    j += 1
    temp = min(temp,p_list[i])

print(j)
Buggy python submission (verdict: Time Limit Exceeded):
A, B, K = map(int, input().split())

for i in range(K):
    if A >= 1:
        A = A - 1
    elif B >= 1:
        B = B - 1
print(A, B)

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

if (K - A) <= 0:
    print(A - K, B)
elif (K - A) > 0 and (B - K + A) > 0:
    print(0, B - K + A)
else:
    print(0, 0)
Buggy python submission (verdict: Runtime Error):
import math
from fractions import gcd

A, B = map(int, input().split())

print((A * B)//math.gcd(A, B))

Fixed submission:
import math
from fractions import gcd

A, B = map(int, input().split())

print((A * B)//gcd(A, B))

Buggy python submission (verdict: Runtime Error):
import math

A, B = map(int, input().split())

print((A * B)//math.gcd(A, B))

Fixed submission:
import math
from fractions import gcd

A, B = map(int, input().split())

print((A * B)//gcd(A, B))
Buggy python submission (verdict: Time Limit Exceeded):
X = int(input())

A = X // 100

for i_100 in range(A + 1):
    for i_101 in range(A + 1 - i_100):
        for i_102 in range(A + 1 - i_100 - i_101):
            for i_103 in range(A + 1 - i_100 - i_101 - i_102):
                for i_104 in range(A + 1 - i_100 - i_101 - i_102 - i_103):
                    for i_105 in range(A + 1 - i_100 - i_101 - i_102 - i_103 - i_104):
                        if i_100 + i_101 + i_102 + i_103 + i_104 + i_105 == A:
                            if i_100 * 100 + i_101 * 101 + i_102 * 102 + i_103 * 103 + i_104 * 104 + i_105 * 105 == X:
                                print("1")
                                exit()

print("0")




Fixed submission:
X = int(input())

A100 = 0
A105 = 0
for i in range(1001):
    A100 += 100
    A105 += 105
    if A100 <= X <= A105:
        print("1")
        exit()

print("0")

Buggy python submission (verdict: Time Limit Exceeded):
X = int(input())

A = X // 100

for i_100 in range(A + 1):
    for i_101 in range(A + 1):
        for i_102 in range(A + 1):
            for i_103 in range(A + 1):
                for i_104 in range(A + 1):
                    for i_105 in range(A + 1):
                        if i_100 + i_101 + i_102 + i_103 + i_104 + i_105 == A:
                            if i_100 * 100 + i_101 * 101 + i_102 * 102 + i_103 * 103 + i_104 * 104 + i_105 * 105 == X:
                                print("1")
                                exit()

print("0")




Fixed submission:
X = int(input())

A100 = 0
A105 = 0
for i in range(1001):
    A100 += 100
    A105 += 105
    if A100 <= X <= A105:
        print("1")
        exit()

print("0")
Buggy python submission (verdict: Runtime Error):
N = int(input())

A_list = list(input().split())
A_list_int = [int(s) for s in A_list]

B_list = list(input().split())
B_list_int = [int(s) for s in B_list]

C_list = list(input().split())
C_list_int = [int(s) for s in C_list]

Answer = []

for i in range(0, N):
  Answer.append(B_list_int[A_list_int[i] - 1])
  if i != N and i != 0:
      if A_list_int[i - 1] == A_list_int[i] - 1:
          Answer.append(C_list_int[i])

print(sum(Answer))

Fixed submission:
N = int(input())

A_list = list(input().split())
A_list_int = [int(s) for s in A_list]

B_list = list(input().split())
B_list_int = [int(s) for s in B_list]

C_list = list(input().split())
C_list_int = [int(s) for s in C_list]

Answer = []

for i in range(0, N):
  Answer.append(B_list_int[A_list_int[i] - 1])
  if i != N and i != 0:
      if A_list_int[i - 1] == A_list_int[i] - 1:
          Answer.append(C_list_int[A_list_int[i] - 2])

print(sum(Answer))
Buggy python submission (verdict: Runtime Error):
A, B, C = [int(x) for x in input()]

if A - B > C:
  print(C)
elif C > A - B:
  print(A - B)

Fixed submission:
A, B, C = [int(x) for x in input().split()]

if A - B >= C:
  print(0)
elif C > A - B:
  print(C - (A - B))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
A, B = [int(x) for x in input().split()]

for K in range(10**9):
    if abs(A - K) == abs(B - K):
        print(K)
        sys.exit

print("IMPOSSIBLE")

Fixed submission:
import sys
A, B = [int(x) for x in input().split()]

if (A + B)%2 == 0:
    print((A + B)//2)
else:
    print("IMPOSSIBLE")
Buggy python submission (verdict: Runtime Error):
A, P = map(int, input().split())

print((3A + P)//2)

Fixed submission:
A, P = map(int, input().split())

print((3*A + P)//2)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
x, N = map(int, input().split())

if N != 0:
    num_list = list(map(int, input().split()))

min_abs = 100
min_num = 0

for num in range(1, 101):
    if not num_list:
        min_num = x
        break
    if num in num_list:
        continue
    else:
        b = abs(num-x)
        if b < min_abs:
            min_abs = b
            min_num = num
            
print(min_num)

Fixed submission:
# -*- coding: utf-8 -*-
x, N = map(int, input().split())

num_list = list(map(int, input().split()))

i = 0            
while True:
    a = x - i
    b = x +i
    if not a in num_list:
        min_num = a
        break
    elif not b in num_list:
        min_num = b
        break
    else:
        i += 1
            
print(min_num)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
x, N = map(int, input().split())

if N != 0:
    p1, p2, p3, p4, p5 = map(int, input().split())
    num_list = [p1, p2, p3, p4, p5]

min_abs = 100
min_num = 0

for num in range(1, 101):
    if not num_list:
        min_num = x
        break
    if num in num_list:
        continue
    else:
        b = abs(num-x)
        if b < min_abs:
            min_abs = b
            min_num = num
            
print(min_num)

Fixed submission:
# -*- coding: utf-8 -*-
x, N = map(int, input().split())

num_list = list(map(int, input().split()))

i = 0            
while True:
    a = x - i
    b = x +i
    if not a in num_list:
        min_num = a
        break
    elif not b in num_list:
        min_num = b
        break
    else:
        i += 1
            
print(min_num)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
x, N = map(int, input().split())
p1, p2, p3, p4, p5 = map(int, input().split())
num_list = [p1, p2, p3, p4, p5]

min_abs = 100
min_num = 0

for num in range(1, 101):
    if num in num_list:
        continue
    else:
        b = abs(num-x)
        if b < min_abs:
            min_abs = b
            min_num = num
            
print(min_num)

Fixed submission:
# -*- coding: utf-8 -*-
x, N = map(int, input().split())

num_list = list(map(int, input().split()))

i = 0            
while True:
    a = x - i
    b = x +i
    if not a in num_list:
        min_num = a
        break
    elif not b in num_list:
        min_num = b
        break
    else:
        i += 1
            
print(min_num)
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
import numpy as np

hairetsu = input().split(' ')
sunuke = int(hairetsu[0])
okashi = int(hairetsu[1])
books = [[0]*sunuke]*okashi

for i in range(0, okashi):
  kaisu = int(input())
  whohas = list(map(int, input().split(' ')))
  for j in range(0, kaisu):
    k = int(whohas[j])-1
    books[i][k] = 1


result = np.sum(books,axis=0)
a = np.count_nonzero(result)
print(sunuke - a)

Fixed submission:
# coding: utf-8
import numpy as np

hairetsu = input().split(' ')
sunuke = int(hairetsu[0])
okashi = int(hairetsu[1])
books = [[0]*sunuke]*okashi

for i in range(0, okashi):
  kaisu = int(input())
  whohas = list(map(int, input().split(' ')))
  for j in range(0, kaisu):
    k = int(whohas[j])-1
    books[i][k] = 1


result = np.sum(books,axis=0)
a = np.count_nonzero(result)
print(sunuke - a)
Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
import math as mt

num = int(input())
list = []

for i in range(1, num+1):
    for j in range(1, num+1):
        for k in range(1, num+1):
            twoGcd = mt.gcd(i, j)
            threeGcd = mt.gcd(twoGcd, k)
            list.append(threeGcd)
            
print(sum(list))

Fixed submission:
# coding: utf-8
# Your code here!
import math as mt

num = int(input())
list = []

for i in range(1, num+1):
    for j in range(1, num+1):
        for k in range(1, num+1):
            twoGcd = mt.gcd(i, j)
            threeGcd = mt.gcd(twoGcd, k)
            list.append(threeGcd)
            
print(sum(list))
Buggy python submission (verdict: Runtime Error):
T = input()
for i in range(len(T)):
    if T[i]=='?':
        if T[i-1]=='P':
            T=T.replace('?','D',1)
        elif T[i+1]=='D':
            T=T.replace('?','P',1)
        elif T[i+1]=='?':
            T=T.replace('??','PD',1)
        else:
            T.replace('?','D',1)
print(T)

Fixed submission:
T=input()
T=T.replace('?','D')
print(T)

Buggy python submission (verdict: Runtime Error):
T = input()
for i in range(1,len(T)):
    if T[i]=='?':
        if T[i-1]=='P':
            T=T.replace('?','D',1)
        elif T[i+1]=='D':
            T=T.replace('?','P',1)
        elif T[i+1]=='?':
            T=T.replace('??','PD',1)
print(T)

Fixed submission:
T=input()
T=T.replace('?','D')
print(T)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = []
for i in range(n):
    s = input()
    if not s in l:
        l.append(s)
print(len(l))

Fixed submission:
n = int(input())
l = [input() for i in range(n)]
l =  list(set(l))
print(len(l))
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def gcd_3(a,b,c):
    a = gcd(gcd(a,b),c)
    return a

k = int(input())
ans = 0

num = list(itertools.product(range(1,k+1),range(1,k+1),range(1,k+1)))

for l in num:
    a,b,c = l
    ans += gcd_3(a,b,c)
print(ans)

Fixed submission:
import itertools

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def gcd_3(a,b,c):
    a = gcd(gcd(a,b),c)
    return a

k = int(input())
ans = 0

num = list(itertools.combinations_with_replacement(range(1,k+1),3))

for l in num:
    a,b,c = l
    if a==b==c:
        ans += a
    elif a!=b!=c:
        ans += gcd_3(a,b,c)*6
    else:
        ans += gcd_3(a,b,c)*3
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def gcd_3(a,b,c):
    p = gcd(a,b)
    q = gcd(p,c)
    return q

k = int(input())
ans = 0

num = list(itertools.product(range(1,k+1),range(1,k+1),range(1,k+1)))

for l in num:
    a,b,c = l
    ans += gcd_3(a,b,c)
print(ans)

Fixed submission:
import itertools

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def gcd_3(a,b,c):
    a = gcd(gcd(a,b),c)
    return a

k = int(input())
ans = 0

num = list(itertools.combinations_with_replacement(range(1,k+1),3))

for l in num:
    a,b,c = l
    if a==b==c:
        ans += a
    elif a!=b!=c:
        ans += gcd_3(a,b,c)*6
    else:
        ans += gcd_3(a,b,c)*3
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
if k==1 or n%k==0:
    print(0)
    exit()
while n > abs(n-k):
    n = abs(n-k)
print(n)

Fixed submission:
n,k = map(int,input().split())
if n%k==0:
    print(0)
else:
    ans_a = n%k
    ans_b = abs(ans_a-k)
    print(min(ans_a,ans_b))

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
if k==1:
    print(0)
    exit()
while n > abs(n-k):
    n = abs(n-k)
print(n)

Fixed submission:
n,k = map(int,input().split())
if n%k==0:
    print(0)
else:
    ans_a = n%k
    ans_b = abs(ans_a-k)
    print(min(ans_a,ans_b))
Buggy python submission (verdict: Runtime Error):
k,n = map(int,input().split())
A = list(map(int,input().split()))
A.append(k)
A.sort()
m = max(y-x for x,y in zip(A,A[1:]))
ans = k-m
print(ans)

Fixed submission:
s = input()
if s[2]==s[3] and s[4]==s[5]:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
import numpy as np
k,n = map(int,input().split())
A = list(map(int,input().split()))
A.append(k)
A.sort()
dist = np.diff(A)
ans = k-max(dist)
print(ans)

Fixed submission:
s = input()
if s[2]==s[3] and s[4]==s[5]:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
n,a,b = map(int,input().split())
l = ('b'*a+'r'*b)*10**100
print(l[:n].count('b'))

Fixed submission:
n,a,b = map(int,input().split())
ans = n // (a+b) * a
rem = n % (a+b)
ans += min(rem,a)
print(ans)

Buggy python submission (verdict: Runtime Error):
n,a,b = map(int,input().split())
l = ('b'*a+'r'*b)*100
print(l[:n].count('b'))

Fixed submission:
n,a,b = map(int,input().split())
ans = n // (a+b) * a
rem = n % (a+b)
ans += min(rem,a)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,a,b = map(int,input().split())
for i in range(10**9):
    if i*(a+b)==n:
        print(a*i)
        exit()
    elif i*(a+b)>n:
        t = n-(i-1)*(a+b)
        if t>a:
            t = a
        print((i-1)*a+t)
        exit()

Fixed submission:
n,a,b = map(int,input().split())
ans = n // (a+b) * a
rem = n % (a+b)
ans += min(rem,a)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,a,b = map(int,input().split())
for i in range(10**18):
    if i*(a+b)==n:
        print(a*i)
        exit()
    elif i*(a+b)>n:
        t = n-(i-1)*(a+b)
        if t>a:
            t = a
        print((i-1)*a+t)
        exit()

Fixed submission:
n,a,b = map(int,input().split())
ans = n // (a+b) * a
rem = n % (a+b)
ans += min(rem,a)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,a,b = map(int,input().split())
for i in range(10**100):
    if i*(a+b)==n:
        print(a*i)
        exit()
    elif i*(a+b)>n:
        t = n-(i-1)*(a+b)
        if t>a:
            t = a
        print((i-1)*a+t)
        exit()

Fixed submission:
n,a,b = map(int,input().split())
ans = n // (a+b) * a
rem = n % (a+b)
ans += min(rem,a)
print(ans)
Buggy python submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
if A>=K:
    print(A-K, B)
else:
    print(0, max(0, B-(K-A)))

Fixed submission:
S, T = input().split()
print(T+S)
Buggy python submission (verdict: Runtime Error):
import fractions
a,b = map(int,input().split())
def lcm(x,y):
    return (x*y)//fractions.gcd(x,y)
print(lcm(a,b))

Fixed submission:
A = input()
B = input()
ans = '123'
ans = ans.replace(A,'').replace(B,'')
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
a,b = map(int,input().split())
def lcm(x,y):
    return (x*y)//math.gcd(x,y)
print(lcm(a,b))

Fixed submission:
import fractions
a,b = map(int,input().split())
def lcm(x,y):
    return (x*y)//fractions.gcd(x,y)
print(lcm(a,b))
Buggy python submission (verdict: Runtime Error):
N, X = map(int, input().split())
L = list(map(int, input().split()))
D = 0
for i in range(1,N+2):
    D += L[i-1]
    if D>X:
        print(i)
        exit()

Fixed submission:
N, X = map(int, input().split())
L = list(map(int, input().split()))
count = 1
D = 0
for i in range(N):
    D += L[i]
    if D<=X:
        count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
import numpy as np
n,m,c = map(int, input().split())
b = list(map(int, input().split()))
a = [list(map(int, input().split())) for i in range(n)]
cnt = 0
l = np.matmul(b,np.transpose(a)) + c
for i in l:
    if i>0:
        cnt += 1
print(cnt)

Fixed submission:
n,m,c = map(int, input().split())
b = list(map(int, input().split()))
A = [list(map(int, input().split())) for i in range(n)]
cnt = 0
for i in range(n):
    if sum(list([a*b for (a,b) in zip(A[i],b)]))+c > 0:
        cnt += 1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
cnt = 1
for i in A:
    cnt *= i

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

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

A.sort()
cnt = 1
for i in A:
    cnt *= i
    if cnt > 10**18:
        print(-1)
        exit()

print(cnt)
Buggy python submission (verdict: Runtime Error):
N, M, X = map(int,input().split())
l = [list(map(int, input().split())) for i in range(N)]

yen = []
scores = []
def dfs(m,i,score_sum,y):
  if i == N:
    scores.append(score_sum)
    yen.append(y)
    return
  dfs(m,i+1,score_sum,y)
  dfs(m,i+1,score_sum+l[i][m],y+l[i][0])

for k in range(1,M+1):
  dfs(k,0,0,0)

cycle = len(scores)// M

goodyen = []
for k in range(len(yen)):
  cnt = 0
  for m in range(M):
    if scores[ m * cycle + k] >= X:
      cnt += 1
  if cnt == M:
    goodyen.append(yen[k])
print(min(goodyen))

Fixed submission:
N,M,X = map(int,input().split())
C = []
A = []
for i in range(N):
    ls = list(map(int,input().split()))
    C.append(ls[0])
    A.append(ls[1:])

INF = 10**9
ans = INF
for i in range(2**N):
    skill = [0]*M
    yen = 0
    for j in range(N):
        if i >> j & 1:
            for k in range(M):
                skill[k] += A[j][k]
            yen += C[j]
    ok = True
    for j in skill:
        if j < X:
            ok = False

    if ok:
        ans = min(ans,yen)
if ans == INF:
    print(-1)
else:
    print(ans)
Buggy python submission (verdict: Runtime Error):
S = input()
if S = "ARC":
    print("ABC")
else:
    print("ARC")

Fixed submission:
S = input()
if S == "ARC":
    print("ABC")
else:
    print("ARC")
Buggy python submission (verdict: Runtime Error):
X = int(input())
k = list(range(0,X))
k5 = []
for i in k:
    k5.append(i**5)
for j in k5:
    if X + j in k5:
        print(k[k5.index(X+j)],k[k5.index(j)])
        exit()
    elif X - j in k5:
        print(k[k5.index(X-j)],-k[k5.index(j)])
        exit()

Fixed submission:
X = int(input())
k = list(range(0,100000))
k5 = []
for i in k:
    k5.append(i**5)
for j in k5:
    if X + j in k5:
        print(k[k5.index(X+j)],k[k5.index(j)])
        exit()
    elif X - j in k5:
        print(k[k5.index(X-j)],-k[k5.index(j)])
        exit()
Buggy python submission (verdict: Runtime Error):
A, B, N = map(int,input().split())
m = min(B-1,N)
M =list(range(1,m+1))
newM = [x/B for x in M]
print(int(A*(max(newM))))

Fixed submission:
A, B, N = map(int,input().split())
m = min(B-1,N)
print(int(A*(m/B)))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
ans = [0]*N
for i in range(1,N+1):
    ans[i-1]=A.count(i)
print(*ans,sep="\n")

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
ans = [0]*N

for i in A:
    ans[i-1] += 1

for k in ans:
    print(k)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
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

for k in ans:
    print(k)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
for i in range(1,N+1):
    count = A.count(i)
    print(count)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
ans = [0]*N

for i in A:
    ans[i-1] += 1

for k in ans:
    print(k)
Buggy python submission (verdict: Time Limit Exceeded):
def gcd(a,b):
    while b:
        a, b = b, a%b
    return a

def gcd3(a,b,c):
    m = gcd(a,b)
    h = gcd(m,c)
    return h

N = int(input())
count = 0
for i in range(1,N+1):
    for j in range(1,N+1):
        for k in range(1,N+1):
            l=gcd3(i,j,k)
            count += l
print(count)

Fixed submission:
def gcd(a,b):
    while b:
        a, b = b, a%b
    return a

def gcd3(a,b,c):
    m = gcd(a,b)
    h = gcd(m,c)
    return h

N = int(input())
count = 0
for i in range(1,N+1):
    for j in range(1,N+1):
        for k in range(1,N+1):
            l=gcd3(i,j,k)
            count += l
print(count)