Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
from fractions import gcd

n,k=map(int,input().split())

if n == 1 or k == 1:
    print(0)
else:2 6
    print(gcd(n,k))

Fixed submission:
n,k=map(int,input().split())
n=int(n%k)
result=abs(k-n)

if n==0:
    print(0)
else:
    while result > abs(result-k):
        result=abs(result-k)
    print(result)

Buggy python submission (verdict: Runtime Error):
import math
n,k=map(int,input().split())

if n == 1 or k == 1:
    print(0)
else:
    print(math.gcd(n,k))

Fixed submission:
n,k=map(int,input().split())
n=int(n%k)
result=abs(k-n)

if n==0:
    print(0)
else:
    while result > abs(result-k):
        result=abs(result-k)
    print(result)

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

result=abs(n-k)

while result > abs(result-k):
    result=abs(result-k)

print(result)

Fixed submission:
n,k=map(int,input().split())
n=int(n%k)
result=abs(k-n)

if n==0:
    print(0)
else:
    while result > abs(result-k):
        result=abs(result-k)
    print(result)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
l=list(map(int,input().split()))
d=dict()

for i in range(len(l)):
  d.setdefault(l[i],0)
  d[l[i]] += 1

for i in range(len(l)):
    d[l[i]] -= 1
    result=0
    for key,value in d.items():
        num=(value*(value-1))/2
        result += num
    d[l[i]] += 1
    print(int(result))

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
d=dict()

for i in range(len(l)):
  d.setdefault(l[i],0)
  d[l[i]] += 1

result=0

for key,value in d.items():
    num=(value*(value-1))/2
    result += num

for i in range(len(l)):
    r1=int((d[l[i]]*(d[l[i]]-1))/2)
    r2=int(((d[l[i]]-1)*(d[l[i]]-2))/2)
    output=int(result-r1+r2)
    print(output)

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

for i in range(len(l)):
  d.setdefault(l[i],0)
  d[l[i]] += 1

for i in range(len(l)):
    d[l[i]] -= 1
    result=0
    for key,value in d.items():
        num=(value*(value-1))/2
        result += num
    d[l[i]] += 1
    print(int(result))

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
d=dict()

for i in range(len(l)):
  d.setdefault(l[i],0)
  d[l[i]] += 1

result=0

for key,value in d.items():
    num=(value*(value-1))/2
    result += num

for i in range(len(l)):
    r1=int((d[l[i]]*(d[l[i]]-1))/2)
    r2=int(((d[l[i]]-1)*(d[l[i]]-2))/2)
    output=int(result-r1+r2)
    print(output)
Buggy python submission (verdict: Runtime Error):
a,b,c = list(map(int,input().split()))
cnt = 1

if a == b and b == c:
    cnt += 1
else a<>b and b<>c:
    cnt += 1

if cnt == 1:
    print("Yes")
else:
    print("No")

Fixed submission:
a,b,c = list(map(int,input().split()))
cnt = 1

if a == b and b == c:
    cnt += 1
elif  a != b and b != c and a != c:
    cnt += 1
else:
    pass

if cnt == 1:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n=int(input())
d=dict()

for i in range(n):
  a=input()
  d.setdefault(s,0)
  d[s] += 1

mx=0
result=[]
for key,value in d.items:
  if mx < value:
    mx = value
    result=[key]
  elif mx == value:
    result.append(key)

result.sort()

for i in range(len(result)):
  print(i)

Fixed submission:
n=int(input())
d=dict()

for i in range(n):
  a=input()
  d.setdefault(a,0)
  d[a] += 1

mx=0
result=[]
for key,value in d.items():
  if mx < value:
    mx = value
    result=[key]
  elif mx == value:
    result.append(key)

result.sort()

for i in range(len(result)):
  print(result[i])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s= []

for _ in range(n):
    s.append(input())

s.sort()
n =set(s)
n=list(n)

f = []

for i in range(len(n)):
    f.append([n[i],s.count(n[i])])

f.sort(reverse=True,key=lambda f:f[1])
max = f[0][1]
fl=[]
for i in range (len(f)):
    if f[i][1] == max:
        fl.append(f[i][0])
    else:
        break

fl.sort()
ans=(set(fl))
ansf=list(ans)
ansf.sort()

for i in range(len(ansf)):
    print(ansf[i])

Fixed submission:
n=int(input())
d=dict()

for i in range(n):
  a=input()
  d.setdefault(a,0)
  d[a] += 1

mx=0
result=[]
for key,value in d.items():
  if mx < value:
    mx = value
    result=[key]
  elif mx == value:
    result.append(key)

result.sort()

for i in range(len(result)):
  print(result[i])
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
num = list(map(int, input().split()))
 
# 各サイコロの期待値を出す
expect = []
for i in range(N):
  expect.append((1 + num[i]) / 2)
 
# 累積和を作る
cs = [0]
for i in range(N):
    cs.append(cs[i]+expect[i])

max = 0
for i in range(K, N+1): # 配列0番目に初期値0が増えてるので1足す
  if max < cs[i] - cs[i-K]:
    max = cs[i] - cs[i - K]
print(max)

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

if s == u:
    a=a-1
else:
    b=b-1

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

cnt=0
for i in range(n):
    for j in range(i+1,n):
        if l[i] == l[j]:
            cnt += 1
    else:
        continue

if cnt == 0:
    print("YES")
else:
    print("NO")

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
l.sort()
cnt=0
for i in range(len(l)):
    if i == 0:
        continue
    elif l[i]==l[i-1]:
        cnt+=1

if cnt == 0:
    print("YES")
else:
    print("NO")

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

cnt=0
for i in range(n):
    for j in range(i+1,n):
        if l[i] == l[j]:
            cnt += 1
    else:
        continue

if cnt == 0:
    print("YES")
else:
    print("NO")

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
l.sort()
cnt=0
for i in range(len(l)):
    if i == 0:
        continue
    elif l[i]==l[i-1]:
        cnt+=1

if cnt == 0:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())

if a = b:
    print("YES")
else:
    print("NO")

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

if a == b:
    print("Yes")
else:
    print("No")

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

if a = b:
    print("Yes")
else:
    print("No")

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

if a == b:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
p=list(map(int,input().split()))

cnt=0

for i in range(n):
    if i == 0:
        cnt += 1
    else:
      if min(p[:i+1]) == p[i]:
          cnt += 1
      else:
        continue

print(cnt)

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

min=p[0]
cnt=0

for i in range(n):
    if min >= p[i]:
        cnt+=1
        min=p[i]
    else:
        continue
print(cnt)

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

cnt=0

for i in range(n):
    if i == 0:
        cnt += 1
    else:
      if min(p[:i+1]) == p[i]:
          cnt += 1
      else:
        continue

print(cnt)


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

min=p[0]
cnt=0

for i in range(n):
    if min >= p[i]:
        cnt+=1
        min=p[i]
    else:
        continue
print(cnt)
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())

ac_cnt=[False]*n
wa_cnt=[0]*n

for _ in range(m):
    a,b=input().split()
    a=int(a)-1
    if b == "AC":
        ac_cnt[a] = True
    else:
        if ac_cnt[a] == False:
            wa_cnt[a] += 1
c=0
d=0

for i in range(n):
    if ac_cnt[a]:
        c += 1
        d += wa_cnt[i]

print(c,d)

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

ac_cnt=[False]*n
wa_cnt=[0]*n

for _ in range(m):
    a,b=input().split()
    a=int(a)-1
    if b == "AC":
        ac_cnt[a] = True
    else:
        if ac_cnt[a] == False:
            wa_cnt[a] += 1
c=0
d=0

for i in range(n):
    if ac_cnt[i]:
        c += 1
        d += wa_cnt[i]

print(c,d)

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

ac_cnt=[False]*n
wa_cnt=[0]*n

for _ in range(m):
    a,b=input().split()
    a=int(a)-1
    if b == "AC":
        ac_cnt[a] = True
    else:
        if ac_cnt[a] == False:
            wa_cnt[a] += 1

print(ac_cnt)
c=0
d=0

for i in range(n):
    if ac_cnt[a]:
        c += 1
        d += wa_cnt[i]

print(c,d)

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

ac_cnt=[False]*n
wa_cnt=[0]*n

for _ in range(m):
    a,b=input().split()
    a=int(a)-1
    if b == "AC":
        ac_cnt[a] = True
    else:
        if ac_cnt[a] == False:
            wa_cnt[a] += 1
c=0
d=0

for i in range(n):
    if ac_cnt[i]:
        c += 1
        d += wa_cnt[i]

print(c,d)

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

ac_cnt=[False]*n
wa_cnt=[0]*n

p=int(p-1)

for _ in range(m):
    a,b=input().split()
    if b == "AC":
        ac_cnt[a] == True
    else:
        if ac_cnt[a] == False:
            wa_cnt[a] += 1
a=0
b=0

for i in range(n):
    if ac_cnt[a]:
        a += 1
        b += wa_cnt[i]

print(a,b)

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

ac_cnt=[False]*n
wa_cnt=[0]*n

for _ in range(m):
    a,b=input().split()
    a=int(a)-1
    if b == "AC":
        ac_cnt[a] = True
    else:
        if ac_cnt[a] == False:
            wa_cnt[a] += 1
c=0
d=0

for i in range(n):
    if ac_cnt[i]:
        c += 1
        d += wa_cnt[i]

print(c,d)

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

ac_cnt=0
wa_cnt=0
flag=0
no=-1

for i in range(m):
    a,b=input().split()
    if flag == 1 and no!= a:
        flag=0
    else:
        if flag == 0 and b == "WA":
            wa_cnt += 1
        elif flag == 0 and b == "AC":
            ac_cnt += 1
            flag += 1
            no=a
    else:
        continue

print(ac_cnt,wa_cnt)

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

ac_cnt=[False]*n
wa_cnt=[0]*n

for _ in range(m):
    a,b=input().split()
    a=int(a)-1
    if b == "AC":
        ac_cnt[a] = True
    else:
        if ac_cnt[a] == False:
            wa_cnt[a] += 1
c=0
d=0

for i in range(n):
    if ac_cnt[i]:
        c += 1
        d += wa_cnt[i]

print(c,d)
Buggy python submission (verdict: Runtime Error):
import math

a,b=map(int,input().split())

result=float(a*b//math.gcd(a,b))
print(result)

Fixed submission:
from fractions import gcd
a,b=map(int,input().split())

result=int(a*b//gcd(a,b))
print(result)

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

a,b=map(int,input().split())

result=int(a*b//math.gcd(a,b))
print(result)

Fixed submission:
from fractions import gcd
a,b=map(int,input().split())

result=int(a*b//gcd(a,b))
print(result)

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

a,b=map(int,input().split())

result=int(a*b//math.gcd(a,b))
print(result)

Fixed submission:
from fractions import gcd
a,b=map(int,input().split())

result=int(a*b//gcd(a,b))
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())

r=[]

for i in range(1,n//2+1):
    if n % i == 0:
        r.append(i + n//i -2)

print(min(r))

Fixed submission:
n=int(input())

r=[]

for i in range(1,int(n**0.5+1)):
    if n % i == 0:
        r.append(i + n//i -2)

print(min(r))
Buggy python submission (verdict: Runtime Error):
s=str(input())

for i in range(s):
    if i%2==0 and s[i]=="R":
        print("No")
    elif i%2==1 and s[i]=="L":
        print("No")
    else:
        print("Yes")

Fixed submission:
import sys

s=str(input())

for i in range(len(s)):
    if i%2==0 and s[i]=="L":
        print("No")
        sys.exit(0)
    elif i%2==1 and s[i]=="R":
        print("No")
        sys.exit(0)

print("Yes")

Buggy python submission (verdict: Runtime Error):
s=str(input())

for i in range(S):
    if i%2==0 and s[i]=="R":
        print("No")
    elif i%2==1 and s[i]=="L":
        print("No")
    else:
        print("Yes")

Fixed submission:
import sys

s=str(input())

for i in range(len(s)):
    if i%2==0 and s[i]=="L":
        print("No")
        sys.exit(0)
    elif i%2==1 and s[i]=="R":
        print("No")
        sys.exit(0)

print("Yes")

Buggy python submission (verdict: Runtime Error):
s=str(input())

if s[0] == "L" or s[2] == "L" or s[1] == "R" or s[3] =="R":
    print("No")
else:
    print("Yes")

Fixed submission:
import sys

s=str(input())

for i in range(len(s)):
    if i%2==0 and s[i]=="L":
        print("No")
        sys.exit(0)
    elif i%2==1 and s[i]=="R":
        print("No")
        sys.exit(0)

print("Yes")
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())

result=a
count=1
while result =< b:
    result += a-1
    count += 1

print(count)

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

result=1
count=0
while result < b:
    result += a-1
    count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
n,d = map(int, input().split())
x = [list(map(int, input().split())) for _ in range(n)]

cnt=0
for i in range(n):
    for j in range(i+1,n):
        for k in range(d):
            sum=0
            sum += (x[i][k]-x[j][k])**2
        route = sum**0.5
        if route.is_integer:
        cnt += 1
        
print(cnt)

Fixed submission:
n,d = map(int, input().split())
x = [list(map(int, input().split())) for _ in range(n)]
cnt=0

for i in range(n):
    for j in range(i+1,n):
        distance=0
        for k in range(d):
            distance += (x[i][k]-x[j][k])**2
        if (distance**0.5).is_integer():
            cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
s=input()

if (s[0]==s[2] and s[1]==s[3]) or (s[0]==s[1] and s[2]==s[3]) or (s[0]==s[3] and s[1]==s[2]) 
    print("Yes")
else:
    print("No")

Fixed submission:
s=input()

if s[0]==s[1] and s[0]==s[2] and s[0]==s[3]:
    print("No")
elif(s[0]==s[2] and s[1]==s[3]) or (s[0]==s[1] and s[2]==s[3]) or (s[0]==s[3] and s[1]==s[2]):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
s=input()

cnt=0

for i in range(1,len(s):
    if s[i]==s[i-1]:
        cnt += 1

if cnt > 1:
    print("Bad")
else:
    print("Good")

Fixed submission:
s=input()

cnt=0

for i in range(1,len(s)):
    if s[i]==s[i-1]:
        cnt += 1

if cnt >= 1:
    print("Bad")
else:
    print("Good")
Buggy python submission (verdict: Runtime Error):
n=int(input())
w=list(map(int,input().split()))

total=sum[w]
s1=w[0]
ans=total-s1

for i in range(1,n):
    s1+=w[i]
    ans=min(ans,abs(total-s1*2))

print(ans)

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

total=sum(w)
s1=w[0]
ans=total-s1

for i in range(1,n):
    s1+=w[i]
    ans=min(ans,abs(total-s1*2))

print(ans)

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

total=sum[w]
s1=w[0]
ans=total-s1

for in range(1,n):
    s1+=w[i]
    ans=min(ans,abs(total-s1*2))

print(ans)

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

total=sum(w)
s1=w[0]
ans=total-s1

for i in range(1,n):
    s1+=w[i]
    ans=min(ans,abs(total-s1*2))

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
dp=[0]*(n+1)
f=[]
dp[0]=1

for i in range(m):
    t=int(input())
    f.append(t)

for i in range(1,n+1):
    if i in f:
        continue
    else:
        if dp[i-1] != 0:
            dp[i] += dp[i-1]
        if i > 1:
            if dp[i-2] != 0:
                dp[i] += dp[i-2]

print(dp[-1]%1000000007)

Fixed submission:
n,m=map(int,input().split())
dp=[0]*(n+1)
f=[]
dp[0]=1

f=[True]*(n+1)
for _ in range(m):
    f[int(input())]=False

for i in range(1,n+1):
    if f[i]==False:
        continue
    else:
        if dp[i-1] != 0:
            dp[i] += dp[i-1]
        if i > 1:
            if dp[i-2] != 0:
                dp[i] += dp[i-2]

print(dp[-1]%1000000007)
Buggy python submission (verdict: Runtime Error):
n=int(input())
d=0

for i in range(n):
    s,p=input().split()
    d.append(s,int(100-p),i)

d.sort()
for i in range(n):
    print(d[i][2])

Fixed submission:
n=int(input())
d=[]

for i in range(n):
    s,p=input().split()
    d.append((s,100-int(p),i+1))

d.sort()
for i in range(n):
    print(d[i][2])
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())

if B%A==0:
    print(a+b)
else:
    print(b-a)

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

if b%a==0:
    print(a+b)
else:
    print(b-a)
Buggy python submission (verdict: Runtime Error):
from math import gcd

n=int(input())

print(n*2//gcd(2,n))

Fixed submission:
from fractions import gcd

n=int(input())

print(n*2//gcd(2,n))
Buggy python submission (verdict: Runtime Error):
a,b= map(int,input().split())

if a > 8 or b > 8:
    print(":(")
else:
    priunt("Yay!")

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

if a > 8 or b > 8:
    print(":(")
else:
    print("Yay!")
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())

if abs(a,c)<=d or (abs(a-b)<=d and abs(b-c) <=d):
    print("Yes")
else:
    print("No")

Fixed submission:
a,b,c,d=map(int,input().split())

if abs(a-c)<=d or (abs(a-b)<=d and abs(b-c)<=d):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
s=input()
s.sort()

if s=="abc":
    print("Yes")
else:
    print("No")

Fixed submission:
s=list(input())
s.sort()
s="".join(s)

if s=="abc":
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
l=[int(input)for _ in range(n)]
print(min(l[0],l[1])+min(l[2],l[3]))

Fixed submission:
l=[int(input()) for _ in range(4)]
print(min(l[0],l[1])+min(l[2],l[3]))
Buggy python submission (verdict: Runtime Error):
a, b = map(input().split())
c = a*b

if c%2 = 0:
    print("Even")

    else:
        print("Odd")



Fixed submission:
a, b = map(int, input().split())
c = a*b

if c % 2:
    print("Odd")

else:
    print("Even")
Buggy python submission (verdict: Runtime Error):
import math

a,b=map(int,input().split())
c=math.floor((a+b)//2)
print(c)

import math

a,b=map(int,input().split())
c=math.floor((a+b)//2)
print(c)

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

if (a+b)%2==0:
    print((a+b)//2)    
else:
    print((a+b)//2+1)
Buggy python submission (verdict: Runtime Error):
s1=input()
s2=input()
s3=s2[::-1]

if s1=s3:
    print("YES")
else:
    print("NO")

Fixed submission:
s1=input()
s2=input()

cnt=0
for i in range(len(s1)):
    if s1[i]==s2[-i-1]:
        cnt+=1

if cnt == 3:
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
s1=input()
s2=input()

cnt=0
for i in range(len(l1)):
    print(l1[i])
    print(l2[-i-1])
    if l1[i]==l2[-i-1]:
        cnt+=1

if cnt == 3:
    print("YES")
else:
    print("NO")

Fixed submission:
s1=input()
s2=input()

cnt=0
for i in range(len(s1)):
    if s1[i]==s2[-i-1]:
        cnt+=1

if cnt == 3:
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
l1=list(map(str,input().split()))
l2=list(map(str,input().split()))

cnt=0
for i in range(len(l1)):
    if l[i]==l[-i-1]:
        cnt+=1

if cnt == 3:
    print("YES")
else:
    print("NO")

Fixed submission:
s1=input()
s2=input()

cnt=0
for i in range(len(s1)):
    if s1[i]==s2[-i-1]:
        cnt+=1

if cnt == 3:
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))

cnt=0
for i in range(len(l1)):
    if l[i]==l[-i-1]:
    cnt+=1

if cnt == 3:
    print("YES")
else:
    print("NO")

Fixed submission:
s1=input()
s2=input()

cnt=0
for i in range(len(s1)):
    if s1[i]==s2[-i-1]:
        cnt+=1

if cnt == 3:
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))

cnt=0
for i in range(len(l1)):
    l[i]==l[-i-1]:
    cnt+=1

if cnt == 3:
    print("YES")
else:
    print("NO")

Fixed submission:
s1=input()
s2=input()

cnt=0
for i in range(len(s1)):
    if s1[i]==s2[-i-1]:
        cnt+=1

if cnt == 3:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
x,a,b=map(int,input().split())
ad=abs(x-a)
bd=abs(x-b)

if ad > bd:
    print("A")
elif ad < bd
    print("B")

Fixed submission:
x,a,b=map(int,input().split())
ad=abs(x-a)
bd=abs(x-b)

if ad > bd:
    print("B")
elif ad < bd:
    print("A")
Buggy python submission (verdict: Runtime Error):
r,g,b = map(int, input().split())

t=r*100+g*10+b

if t % 4 ==0:
    print("YES")
    else:
        print("NO")

Fixed submission:
r,g,b = map(int, input().split())

t=r*100+g*10+b

if t % 4 ==0:
    print("YES")
else:
     print("NO")
Buggy python submission (verdict: Runtime Error):
X = int(input())
# X = 1

B = 0
while(True):
    B5 = B**5
    C5 = (-B)**5
    A5 = (X + B5)**0.2
    A5r = (X + C5)**0.2
    if A5 == round(A5,0):
        print (int(A5), int(B5))
        break
    if A5r ==  round(A5r,0):
        print (int(A5r), int(C5))
        break
    B += 1
    

Fixed submission:
X = int(input())
# X = 1
stopFlag = 0
for i in range (-201, 201):
    a = i
    for j in range(-201, 201):
        if a**5 - j**5 == X:
            print (a, j)
            stopFlag = 1            
        if stopFlag:
            break
    if stopFlag:
        break
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split(" ")))

pair = 0
for i in range(N):
    for j in range(i, N):
        if (A[i]+A[j])==abs(i-j):
            pair +=1
print (pair)

Fixed submission:
from collections import Counter

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

List1 = [i + A[i] for i in range(N)]
List2 = [i - A[i] for i in range(N)]

ans = 0

CList1 = Counter(List1)
CList2 = Counter(List2)

for i in range(N):
    ans += CList1[i]*CList2[i]
    
print (ans)
Buggy python submission (verdict: Runtime Error):
a = A//K
# b = B//K
C = K * (a+1)

# if K > B:
    # print ("NG")


if C <= B:
    print ("OK")
else:
    print ("NG")

Fixed submission:
import math

# K = 1
# A, B = 11, 11

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

a = math.ceil(A/K)
# b = B//K
C = K * (a)

# if K > B:
    # print ("NG")


if C <= B:
    print ("OK")
else:
    print ("NG")
Buggy python submission (verdict: Time Limit Exceeded):
import math                                                       
A, B, N = map(int, input().split())

# A, B, N = 11, 10, 9

maxR = -1
maxX = 0
for x in range(0, N+1):
    R = math.floor(A*x/B) - A * math.floor(x/B)
    if R >= maxR:
        maxR = R
        maxX = x
print (maxR)

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

# A, B, N = 11, 10, 9
T = N//B
maxR = -1
maxT = 0
# for x in range(1, T+2):
    # t = min(x*B-1,N)
    # R = math.floor(A*t/B) - A * math.floor(t/B)
    # if R >= maxR:
    #     maxR = R
    #     maxT = t
t = min(B-1,N)
maxR = math.floor(A*t/B) - A * math.floor(t/B)
print (maxR)
Buggy python submission (verdict: Runtime Error):
N = str(input())

#N = str(14282668646)

count = 0
lenN = len(N)+1
for i in range(0, lenN):
#    t = i
    for j in range(i+5, i+8):
#        print (i, j)
        number = int(str(N[i:j]))
        if number%2019 == 0:
            count +=1
            break


print (count)

Fixed submission:
N, K = map(int, input().split())
sumR = 0
for i in range(K, N+2):
    front = i*(2*N + 2 - i + 1)/2
    rear = i*(i+1)/2
    number = front - rear + 1
#    print (i)
#    print (number)
    sumR += number
print (int(sumR%(1000000007)))

Buggy python submission (verdict: Runtime Error):
N = str(input())

#N = str(14282668646)

count = 0
lenN = len(N)+1
for i in range(0, lenN):
#    t = i
    for j in range(i+5, i+8):
#        print (i, j)
        number = int(str(N[i:j]))
#        if number%2019 == 0:
#            count +=1
#            break
#            print (i, j)
#T = int(N)//2019
#
#for t in range (T):
#    den = 2019*t
#    length = len(str(den))
#    sum_length = len(N)
#    for i in range(sum_length-length):
#        if den == int(N[i:i+length]):
#            count +=1

print (count

Fixed submission:
N, K = map(int, input().split())
sumR = 0
for i in range(K, N+2):
    front = i*(2*N + 2 - i + 1)/2
    rear = i*(i+1)/2
    number = front - rear + 1
#    print (i)
#    print (number)
    sumR += number
print (int(sumR%(1000000007)))