Problem:


Score : 400 points

Problem Statement

Give a pair of integers (A, B) such that A^5-B^5 = X.
It is guaranteed that there exists such a pair for the given integer X.

Constraints

1 \leq X \leq 10^9

X is an integer.

There exists a pair of integers (A, B) satisfying the condition in Problem Statement.

Input

Input is given from Standard Input in the following format:

X

Output

Print A and B, with space in between.
If there are multiple pairs of integers (A, B) satisfying the condition, you may print any of them.

A B

Sample Input 1

33

Sample Output 1

2 -1

For A=2 and B=-1, A^5-B^5 = 33.

Sample Input 2

1

Sample Output 2

0 -1



Sample input:
33


Sample output:
2 -1

Submission status: Runtime Error

Solution code:
import sys

X = int(input())
a = [i for i in range(-10,101)]
b = [i for i in range(-10, 101)]

for i in a:
    for k in b:
        if i**5 == X + k**5
            print(i,k)
            sys.exit()

Submission status: Runtime Error

Solution code:
x = int(input())

for i in range(10**9):
  a1= (x + i**5)**0.2
  a2 = (x + (-i)**5)**0.2
  
  if a1.is_integer():
    print(int(a1),i)
    exit()
  if a2.is_integer():
    print(int(a2),-i)
    exit()

Submission status: Runtime Error

Solution code:
X = int(input())
for i in range(130):
  for j in range(-66,66):
    if i**5 - j**5 ==X:
      A = i
      B = j
      break
print(str(A)+str(" ")+str(B))

Submission status: Runtime Error

Solution code:
import math

X = int(input())

i = 0
j = 0
while True:
   i += 1
   a = math.pow((X + math.pow(i, 5)), float(1/5))
   if a.is_integer():
      print("%d %d" % (a, i))
      exit()
   j -= 1
   a = math.pow((X + math.pow(j, 5)), float(1/5))
   if a.is_integer():
      print("%d %d" % (a, j))
      exit()

Submission status: Runtime Error

Solution code:
import math

X = int(input())

i = 0
while True:
   i += 1
   b = - math.pow((X - math.pow(i, 5)), float(1/5))
   if b.is_integer():
      print("%d %d" % (i, b))
      exit()

Submission status: Runtime Error

Solution code:
if not x == 0:
  for i in range(10000):
    for j in range(-10000,10000):
      if i**5 - j**5 == x:
        a = i
        b = j
    
print(str(a)+" "+str(b))

Submission status: Runtime Error

Solution code:
x = int(input())
if not x == 0:
  for i in range(100):
    for j in range(-100,100):
      if i**5 - j**5 == x:
        a = i
        b = j
print(str(a)+" "+str(b))

Submission status: Runtime Error

Solution code:
x = int(input())
for i in range(100):
  for j in range(-100,100):
    if i ^ 5 - j * 5 == x:
      a = i
      b = j
    break
  break
print(str(a)+" "+str(b))

Submission status: Runtime Error

Solution code:
# 暴力即可
# 範囲指定 A=100 B=-100で20000000000とかになるしどっちも|100|程度でいいのではないか
x = int(input())
for a in range(-100, 101):
    for b in range(-100, 101):
        if a**5 - b**5 == x:
            print(a, b)
            exit()
print(3 / 0)  # はい

Submission status: Runtime Error

Solution code:
def main():
  X = int(input())
  
  a = -1
  b1 = -1
  b2 = +1
  while True:
    a += 1
    while b1 < a:
    	b1 += 1
        b2 -= 1
        if (X/(a-b1)).is_integer():
          if int(X/(a-b1)) == a**4 + b1*(a**3) + (a**2)*(b1**2) + a*(b1**2) + b1**4:
            print("{} {}\n".format(a, b1))
            return 0
          
        if (X/(a-b2)).is_integer():
          if int(X/(a-b2)) == a**4 + b2*(a**3) + (a**2)*(b2**2) + a*(b2**2) + b2**4:
            print("{} {}\n".format(a, b2))
            return 0
          
          
if __name__ == "__main__":
  main()

Submission status: Runtime Error

Solution code:
def main():
  X = int(input())
  
  a = -1
  b1 = -1
  b2 = +1
  while True:
    a += 1
    while True:
    	b1 += 1
        b2 -= 1
        if (X/(a-b1)).is_integer():
          if int(X/(a-b1)) == a**4 + b1*(a**3) + (a**2)*(b1**2) + a*(b1**2) + b1**4:
            print("{} {}\n".format(a, b1))
            return 0
          
        if (X/(a-b2)).is_integer():
          if int(X/(a-b2)) == a**4 + b2*(a**3) + (a**2)*(b2**2) + a*(b2**2) + b2**4:
            print("{} {}\n".format(a, b2))
            return 0
          
          
if __name__ == "__main__":
  main()

Submission status: Runtime Error

Solution code:
a⁵-b⁵=(a-b)(a⁴+a³b+a²b²+ab³+b⁴)
def main():
  X = int(input())
  
  a = -1
  b1 = -1
  b2 = +1
  while True:
    a += 1
    while True:
    	b1 += 1
        b2 -= 1
        if (X/(a-b1)).is_integer():
          if int(X/(a-b1)) == a**4 + b1*(a**3) + (a**2)*(b1**2) + a*(b1**2) + b1**4:
            print("{} {}\n".format(a, b1))
            return 0
          
        if (X/(a-b2)).is_integer():
          if int(X/(a-b2)) == a**4 + b2*(a**3) + (a**2)*(b2**2) + a*(b2**2) + b2**4:
            print("{} {}\n".format(a, b2))
            return 0
          
          
if __name__ == "__main__":
  main()

Submission status: Runtime Error

Solution code:
a⁵-b⁵=(a-b)(a⁴+a³b+a²b²+ab³+b⁴)
def main():
  X = int(input())
  
  a = -1
  b1 = -1
  b2 = +1
  while True:
    a += 1
    while True:
    	b1 += 1
        b2 -= 1
        if (X/(a-b1)).is_integer:
          if int(X/(a-b1)) == a**4 + b1*(a**3) + (a**2)*(b1**2) + a*(b1**2) + b1**4:
            print("{} {}\n".format(a, b1))
            return 0
          
        if (X/(a-b2)).is_integer:
          if int(X/(a-b2)) == a**4 + b2*(a**3) + (a**2)*(b2**2) + a*(b2**2) + b2**4:
            print("{} {}\n".format(a, b2))
            return 0
          
          
if __name__ == "__main__":
  main()

Submission status: Runtime Error

Solution code:
def main():
  X = int(input())

  i = 0
  while True:
    tmp = X + i**5
    tmp5 = tmp**0.2
    if abs(tmp5 - int(tmp5)) < 1e-8:
      print("{} {}".format(i, int(tmp5)))
      return 0

    tmp = X - i**5
    tmp5 = tmp**0.2
    if abs(tmp5 - int(tmp5)) < 1e-8:
      print("{} {}".format(i, int(-tmp5)))
      return 0
    i += 1
    
if __name__ == '__main__':
  main()

Submission status: Runtime Error

Solution code:
X=int(input())
l=[]
for i in range(300):
    a=i**5
    l.append(a)
    l.append(-a)
for j in l:
    for s in l:
        if j-s==X and j!=s:
            ans=[]
            for i in [j,s]:
                aaa=abs(i)**(1/5)
                if i>=0:
                    ans.append(int(aaa)
                else:
                    ans.append(-aaa)
            print(*ans)

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
import sys
INF = 10**9
sys.setrecursionlimit(INF)
import math


def main():
    x, = map(int, open(0).read().split())

    """
    x=a^5-b^5=(a-b)(a^4+a^3b+a^2b^2+ab^3+b^4)
    x//(a-b)=int>0
    a-b>0
    """

    tmp_a = round(x**(1 / 5))
    for i in range(-tmp_a * 2, tmp_a * 2 + 1):
        tmp_bbbbb = i**5 - x
        # print(i, i**5 - x, tmp_bbbbb)
        is_b_positive = True
        if tmp_bbbbb < 0:
            tmp_bbbbb *= -1
            is_b_positive = False
        tmp_b = tmp_bbbbb**(1 / 5)
        if tmp_b == int(tmp_b):
            a = i
            tmp_b = int(tmp_b)
            if is_b_positive:
                b = tmp_b
            else:
                b = -tmp_b
            break

    ans = f'{a} {b}'
    print(ans)
    return(ans)


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
X = input().split()
X = int(X[0])
ans = [0]*2

for i in range(200):
    A5 = X+i**5
    ans[0] = pow(A5,0.2)
    if ans[0].is_integer():
        ans[0] = int(ans[0])
        ans[1] = int(i)
        break
    A5 = X-i**5
    ans[0] = pow(A5,0.2)
    if ans[0].is_integer():
        ans[0] = int(ans[0])
        ans[1] = -int(i)
        break

print(' '.join(map(str,ans)))

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
X = int(input())
li = [i**5 for i in range(0,100,1)]
for A in li:
    if A-X in li:#Bが自然数
        B = li.index(A-X)
        break
    elif A-X < 0:#Bが負の実数
        if abs(A-X) in li:
            B = (li.index((A-X)*(-1))) * (-1)
            break

print(li.index(A),B)

Submission status: Runtime Error

Solution code:
X = int(input())
li = [i**5 for i in range(0,65,1)]
for A in li:
    if A-X in li:#Bが自然数
        B = li.index(A-X)
        break
    elif A-X < 0:#Bが負の実数
        if abs(A-X) in li:
            B = (li.index((A-X)*(-1))) * (-1)
            break

print(li.index(A),B)

Submission status: Runtime Error

Solution code:
X = int(input())
li = [i**5 for i in range(0,40,1)]
for A in li:
    if A-X in li:#Bが自然数
        B = li.index(A-X)
        break
    elif A-X < 0:#Bが負の実数
        if abs(A-X) in li:
            B = (li.index((A-X)*(-1))) * (-1)
            break

print(li.index(A),B)

Submission status: Runtime Error

Solution code:
a,b,N = map(int, input().split())

Ansermax = 0

if b < N :
    N = b
    
for x in range(N+1):

    Anser = 0

    Anser = int((a*x)//b)-a*int(x//b)
    
    if Ansermax < Anser:
        Ansermax = Anser
    
    if x//b >= 1:
     break

print(Ansermax)

Submission status: Runtime Error

Solution code:
x=int(input())

for b in range(0,200):
  b5 = b**5
  a5 = x + b5
  a = int( float(a5)**0.2 )
  if a**5 == a5:
    print(a,b)
    break
  a5 = x - b5
  a = int( float(a5)**0.2 )
  if a**5 == a5:
    print(a,-b)
    break
#

Submission status: Runtime Error

Solution code:
x = int(input())
for a in range(101. -101, -1):
  for b in range(-101, 101, 1):
    if x==a**5-b**5:
      print(a, b)
      exit()

Submission status: Runtime Error

Solution code:
x=int(input())
a5=[0]
for i in range(1,200):
  a5.append(i**5)
#
r=0
for i in range(200):
  for j in range(i+1,200):
    if a5[j]-a5[i]>x:
      break
    if a[j]-a5[i]==a:
      print(a[i],a[j])

Submission status: Runtime Error

Solution code:
X=int(input())

for i in range(100):
    for j in range(-100,100):
        ans=pow(i,5)-pow(j,5)
        if ans==X:
            ans_a=i
            ans_b=j

print(ans_a,ans_b)

Submission status: Runtime Error

Solution code:
X=int(input())
n=0
while n<10**5:
    A=X-(n**5)
    check=(A**0.2)**5
    if(int(check)==check):
        AnsA=A**0.2
        AnsB=-n
        print(str(int(AnsA))+" "+str(int(AnsB)))
        break
    else:
        n=n+1
m=0
while m<10**5:
    A=X+(m**5)
    check=(A**0.2)**5
    if(int(check)==check):
        AnsA=A**0.2
        AnsB=-m
        print(str(int(AnsA))+" "+str(int(AnsB)))
        break
    else:
        m=m+1

Submission status: Runtime Error

Solution code:
X=int(input())
n=0
while n<10**9:
    A=X-(n**5)
    check=(A**0.2)**5
    if(int(check)==check):
        AnsA=A**0.2
        AnsB=-n
        print(str(int(AnsA))+" "+str(int(AnsB)))
        break
    else:
        n=n+1

Submission status: Runtime Error

Solution code:
X = int(input())

result = [0, 0]
powers = [x**5 for x in range(101)]

end_flag = False
for i in range(101):
    a5 = powers[i]
    for j in range(i, 101):
        b5 = powers[j]
        x = a5 - b5
        if (x == X):
            result[0] = i
            result[1] = j
            end_flag = True
            break
        elif (-x == X):
            result[0] = -i
            result[1] = -j
            end_flag = True
            break
        x = a5 + b5
        if (x == X):
            result[0] = i
            result[1] = -j
            end_flag = True
            break
        elif (-x == X):
            result[0] = -i
            result[1] = j
            end_flag = True
            break
    if end_flag:
        break

A, B = result
if A*B == 0:
    raise "invalid X"

print(f"{A} {B}")

Submission status: Runtime Error

Solution code:
X = int(input())
flag = False
for a in range(-118, 120):
    for b in range(-119, 119):
        if a**5 - b**5 == X:
            print('{} {}'.format(a,b))
            flag = True
            break
    if flag:
        breakX = int(input())
flag = False
for a in range(-118, 120):
    for b in range(-119, 119):
        if a**5 - b**5 == X:
            print('{} {}'.format(a,b))
            flag = True
            break
    if flag:
        break

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;

void solve(){
  int X;
  int A,B;
  cin >> X ;
  for (A=-118;A<120;A++){
    for (B=-119;B<A;B++){
      if (pow(A,5.0)-pow(B,5.0)==X){
	cout << A << B << endl;
	goto OUT;
      }
    }
  }
 OUT:;
}

int main(){
  solve();
  return 0;
}

Submission status: Runtime Error

Solution code:
X=int(input())
ans = []
for a in range(-100,101):
    for b in range(-100,101):
        if a**5-b**5 == X:
            ans = [a,b]
            break
print(ans[0],ans[1])

Submission status: Runtime Error

Solution code:
import numpy as np
x=int(input())
v=0
count=1
while v==0:
    if x<=2*(count)**5:
        v=1
    else:
        count+=1
for i in range(-1*count,count):
    if i**5+x<0:
        m=np.power(-1*(i**5+x),0.2)
        m=-1*m
    else:
        m=np.power(i**5+x,0.2)
    M=int(m)
    if m-M<=10**(-5):
        b=i
        a=M
        break
print(a,b)

Submission status: Runtime Error

Solution code:
import sys

sys.setrecursionlimit(10**7)

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

x = ni()
for a in range(-250, 251):
    for b in range(-250, 251):
        if a ** 5 - b ** 5 == x:
            print(a, b)
            exit(1)

Submission status: Runtime Error

Solution code:
X = int(input())

for b in range(-100,100):
    is_minus = False
    if (X + b**5) < 0 : is_minus = True
    result = abs((X + b**5))**(1/5)

    if type(result) is complex:
        continue
    if result - round(result) == 0:
        if is_minus:
            ans_a,ans_b = -b,-round(result)
        else:
            ans_a,ans_b = abs(b),-round(result)


print(ans_a,ans_b)

Submission status: Runtime Error

Solution code:
X = int(input())

for b in range(-100,100):
    result = (X + b**5)**(1/5).real
    if type(result) is complex:
        continue
    if result - round(result) == 0:
        ans_a,ans_b = b,round(result)


print(ans_a,ans_b)

Submission status: Runtime Error

Solution code:
x=int(input())
for i in range(-1000:1000:1):
  for j in range(-1000:1000:1):
    if i**5-j**5==x:
      print(i,j)
      exit()

Submission status: Runtime Error

Solution code:
N=input()
flag=False
while flag:
   for i in range(-119:119:1):
    for j in range(-119:119:1):
       if i**5-j**5==x:
        flag=True
        print("{}{}",format(i,j))
        break
        
    if flag:
      break

Submission status: Runtime Error

Solution code:
x = int(input())
for i in range(120):
  for j in range(-120, 121):
    if i**5 - j**5 == x
    print(i,j)
    break

Submission status: Runtime Error

Solution code:
x = int(input())
for i in range(120):
  for j in range(-120, 121):
    if i^5 - j^5 == x
    print(i,j)
    break

Submission status: Runtime Error

Solution code:
def main():
    print(*solve())


def solve():
    X = int(input())
    N = 10 ** 9 + 7

    step = 2 if X % 2 else step = 1  # if X is odd number, (A - B) also must be odd.

    for x in range(1, N, step):  # x means (A - B)
        if X % x:  # X must be divided by (A - B)
            continue

        for a in range(N):
            b = a - x

            diff = X - (a ** 5 - b ** 5)
            if diff == 0:
                return a, b

            if diff < 0 < b:
                break


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
"""
A^5 - B^5
= (A - B)(A^4 + A^3*B + A^2*B^2 + A*B^3 + B^4)
= (A - B){(A + B) * (A^3 + B^3) + A^2*B^2}
= (A - B){(A + B)^2 * (A^2 - AB + B^2) + A^2*B^2}

-> (A + B)^2 > 1, (A^2 - AB + B^2) > 1, A^2*B^2 > 1.
"""


def main():
    print(*solve())


def solve():
    X = int(input())

    for a in range(-100, 100):
        for b in range(-100, 100):
            if a ** 5 - b ** 5 == X:
                return a, b


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
x=int(input())
a=list(range(-round(sqrt(x)), round(sqrt(x))))
for i in range(x, -1, -1):
    b=i**(1/5)
    if b in a: 
        A=b
        break
for i in a: 
    m=i**5
    if A**5-m==x: 
        print(round(A), round(i))
        break

Submission status: Runtime Error

Solution code:
x=int(input())
a=list(range(-round(sqrt(x)), round(sqrt(x))))
for i in range(x, -1, -1):
    b=i**(1/5)
    if b in a: 
        A=b
        break
for i in a: 
    m=i**5
    if A**5-m==x: B=i; print(round(A), round(B)); break

Submission status: Runtime Error

Solution code:
import bisect
import os
 
X=int(input())
hist = []
for a in range(100000):
    hist.append(a ** 5)
    i = bisect.bisect_left(hist, a ** 5 - X)
    if hist[i] == a ** 5 - X:
        print(a, i)
        break
    i = bisect.bisect_left(hist, X - a ** 5)
    if hist[i] == X - a ** 5:
        print(a, -i)
        break

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline

def main():
    X = int(input())

    i = 0
    while True:
        a = (X + i**5)**(1/5)
        if a.is_integer():
            print(str(int(a))+' '+str(i))
            break
        a = (X - i**5)**(1/5)
        if a.is_integer():
            print(str(int(a))+' '+str(-i))
            break
        i += 1

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
x=int(input)
for i in range(-1000,1000):
  for j in range(-1000,1000):
    if i**5 ==x+j**5:
      print(i,j)
      exit()

Submission status: Runtime Error

Solution code:
X = int(input())
 
N = int(X**0.2)
 
for n1 in range(-N,N):
  for n2 in range(-N,N):
    S = n1**5 - n2**5
    if S == X:
      A=n1
      B=n2
      
print(A,B)

Submission status: Runtime Error

Solution code:
X = int(input())
 
N = int(X**0.2)
 
for n1 in range(N):
  for n2 in range(-N,N):
    S = n1**5 - n2**5
    if S == X:
      A=n1
      B=n2
      break
      
print(A,B)

Submission status: Runtime Error

Solution code:
X = int(input())

N = int(X**0.2)

for n1 in range(N):
  for n2 in range(N):
    S = n1**5 - n2**5
    if S == X:
      A=n1
      B=n2
      
print(A,B)

Submission status: Runtime Error

Solution code:
X = int(input().rsplit())

N = int(X)**0.2

for n1 in range(N):
  for n2 in range(N):
    S = n1**5 - n2**5
    if S == X:
      A=n1
      B=n2
      
print(A,B)

Submission status: Runtime Error

Solution code:
X = int(input())

N = int(X)**0.2

for n1 in range(N):
  for n2 in range(N):
    S = n1**5 - n2**5
    if S == X:
      A=n1
      B=n2
      
print(A,B)

Submission status: Runtime Error

Solution code:
x = int(input())

a = 0
b = 0


while True:
    a5 = pow(a, 5)
    b5 = pow(b, 5)
    if(a5-b5 == x):
        print("{} {}".format(a, b))
        exit(1)
    if(a5+b5 == x):
        print("{} {}".format(a, -b))
        exit(1)
    if(-a5-b5 == x):
        print("{} {}".format(-a, b))
        exit(1)
    if(-a5+b5 == x):
        print("{} {}".format(-a, -b))
        exit(1)

    b += 1
    if(a==b):
        a +=1
        b =0

Submission status: Runtime Error

Solution code:
x = int(raw_input())
for i in range(-120 , 120):
  for j in range(-120 , 120):
    if(math.pow(i , 5) - math.pow(j , 5) == x):
      print(i , " " , j)
      break

Submission status: Runtime Error

Solution code:
x = int(raw_input())
for i in range(-100 , 100):
  for j in range(-100 , 100):
    if(math.pow(i , 5) - math.pow(j , 5) == x):
      print(i , " " , j)
      break

Submission status: Runtime Error

Solution code:
X=int(input())
while(True):
    k=breaknum=0
    for n in range(-118,120):
        x=n**5-(n-k)**5
        if X==x:
            print(n**5)
            breaknum=-1
            break
    k+=1
    if breaknum=-1:
        break

Submission status: Runtime Error

Solution code:
import math

X = input()

for A in range( 10 ** 9 ) :
  B = math.pow( (math.pow( A, 5 ) - X ) , (-5))
  
  if B == math.floor ( B ):
    break

print( A, B )

Submission status: Runtime Error

Solution code:
x=int(input())
i=0
flg=0
while not flg:
    i+=1
    if (i**5 + x)**(1/5)%1==0:
        print(int((i**5 + x)**(1/5)),i)
        flg=1
    elif x>=-(-i)**5:
		if ((-i)**5 + x)**(1/5)%1==0:
        	print(int(((-i)**5 + x)**(1/5)),-i)
        	flg=1

Submission status: Runtime Error

Solution code:
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect

def LI(): return [int(x) for x in sys.stdin.readline().split()]


def I(): return int(sys.stdin.readline())


def LS(): return [list(x) for x in sys.stdin.readline().split()]


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]


def LIR(n):
    return [LI() for i in range(n)]


def SR(n):
    return [S() for i in range(n)]


def LSR(n):
    return [LS() for i in range(n)]


sys.setrecursionlimit(1000000)
mod = 1000000007


def solve():
    n, m = LI()
    h = LI()
    li = LIR(m)
    flag_list = [False] * n
    for i in range(m):
        if h[li[i][0]-1] > h[li[i][1]-1]:
            flag_list[li[i][1]-1] = True
        elif h[li[i][0]-1] < h[li[i][1]-1]:
            flag_list[li[i][0]-1] = True
        else:
            flag_list[li[i][0]-1] = True 
            flag_list[li[i][1]-1] = True
    print(flag_list.count(False))

    return


if __name__ == "__main__":
    solve()

Submission status: Runtime Error

Solution code:
    import math
    x = int(input())
    def make_divisors(n):
        divisors = []
        for i in range(1, int(n**0.5)+1):
            if n % i == 0:
                divisors.append(i)
                if i != n // i:
                    divisors.append(n//i)
        divisors.sort()
        return divisors
    divisors_list = make_divisors(x)
    T = 0
    for i in range(len(divisors_list)):
        for j in range(5000):
            temp = abs((divisors_list[i]+j-2500)**5-(j-2500)**5)
            if temp==x:
                T = 1
                ansl = [(divisors_list[i]+j-2500),(-j+2500)]
                break
        if T == 1:
            break
    if ansl[0]**5-ansl[1]**5==x:
        print(ansl[0],ansl[1])
    else:
        print(ansl[1],ansl[0])

Submission status: Runtime Error

Solution code:
x=int(input())

b=0
while(True):
    bi=b**5
    ai=x+bi
    aj=int(ai**(1/5))
#    print(ai,aj,bi,b)
    if((aj**5)==ai):
        print(aj,b)
        break
    b*=-1

    bi=b**5
    ai=x+bi
    aj=int(ai**(1/5))
#    print(ai,aj,bi,b)
    if((aj**5)==ai):
        print(aj,b)
        break
    b*=-1

    b+=1

Submission status: Runtime Error

Solution code:
X = int(input())

#A = -118
for A in range(-118, 120, 1):
  t = abs(int(A**5 - X))
  t_root = t**(1/5)
  if t_root.is_integer():
    B = int(t_root)
    break
  #A += 1
if A**5 + B**5 == X:
  print("{} {}".format(A, B*-1))
else:
  print("{} {}".format(A, B))

Submission status: Runtime Error

Solution code:
X = int(input())

#A = -118
for A in range(-118, 120, 1):
  t = abs(int(A**5 - X))
  t_root = t**(1/5)
  if t_root.is_integer():
    B = int(t_root)
    if A**5 + B**5 == X or A**5 - B**5 == X:
      break
  #A += 1
if A**5 + B**5 == X:
  print("{} {}".format(A, B*-1))
else:
  print("{} {}".format(A, B))

Submission status: Runtime Error

Solution code:
X=int(input())

a=0
b=0

while True:
    hantei_p=X+b**5
    hantei_n=X-b**5

    if hantei_p**0.2==int(hantei_p**0.2):
       a=int(hantei_p**0.2)
       print("{} {}".format(a,b))
       break
    if hantei_n**0.2==int(hantei_n**0.2):
       a=int(hantei_n**0.2)
       print("{} {}".format(a,-b))
       break
    
    b +=1

Submission status: Runtime Error

Solution code:
#166d
x = int(input())
for i in range(-118,119):
    for j in range(-118,119):
        if i**5-j**5==x:
            a = i
            b = j
            break
        
print(a,b)

Submission status: Runtime Error

Solution code:
#166d
x = int(input())
for i in range(-118,119):
    for j in range(-118,119):
        print(i,j)
        if i**5-j**5==x:
            a = i
            b = j
            break
        
print(a,b)

Submission status: Runtime Error

Solution code:
#166d
x = int(input())
for i in range(-73,73):
    for j in range(-73,73):
        if i**5-j**5==x:
            a = i
            b = j
            break
        
print(a,b)

Submission status: Runtime Error

Solution code:
#166d
x = int(input())
for i in range(-73,73):
    for j in range(-73,73):
        print(i,j)
        if i**5-j**5==x:
            a = i
            b = j
            break
        
print(a,b)

Submission status: Runtime Error

Solution code:
import math
import sys

X = int(input())

is_even = X%2==0

i = -1
while True:
    B = math.pow(i, 5)

    if X-B > 0:
        ans = math.pow(X-B, 0.2)
        if ans.is_integer():
            print(int(ans), -i)
            sys.exit()

    ans = math.pow(X+B, 0.2)
    if ans.is_integer():
        print(int(ans), i)
        sys.exit()

    i = i-1

Submission status: Runtime Error

Solution code:
import math
import sys

X = int(input())

is_even = X%2==0

i = -1
while True:
    B = math.pow(i, 5)
    if B.is_integer() is False:
        continue

    ans = math.pow(X-B, 0.2)
    if ans.is_integer():
        print(int(ans), -i)
        sys.exit()

    ans = math.pow(X+B, 0.2)
    if ans.is_integer():
        print(int(ans), i)
        sys.exit()

    i = i-1

Submission status: Runtime Error

Solution code:
X = int(input())

for A in range(100):
    for B in range(-50, 50):
        if A**5-B**5 == X:
            print(A, B)
			exit()

Submission status: Runtime Error

Solution code:
def get_answer():
  x = int(input())
  
  is_get = False
  for a in range(1000000000):
    if is_get:
      break
    for b in range(-1*a, a, 1):
      if x == a**5 - b**5:
        is_get = True
        break
        
  print(f"{a-1} {b}")

if __name__ = "__main__":
  get_answer()

Submission status: Runtime Error

Solution code:
x = int(input())
a = 1
b = (x-a**5)**(1/5)
while b-int(b) != 0:
    a+=1
    b = (a**5-x)**(1/5)
print(a,int(b))

Submission status: Runtime Error

Solution code:
X = int(input())
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

for i in range(len(make_divisors(X))):
    A = make_divisors(X)[i]
    for j in range(-63,118):
        if (A+j)**5-j**5==X:
            a = j + A
            b = j
            break
        else:
            continue
        break
    else:
        continue
    break
print(a,b)

Submission status: Runtime Error

Solution code:
X = int(input())
Ans = []
for i in range(-10, 11):
  for j in range(-10, 11):
    ab = i**5 - j **5
    if ab == X:
      Ans.append([i, j])
ans = Ans[0]
print(ans[0], ans[1])

Submission status: Runtime Error

Solution code:
import collections
 
x = int(raw_input())
def f(a):
	h = {}
	for t in range(1000):
		h[t ** 5] = t
	for t in range(1, 1000):
		h[- t ** 5] = -t
	for k in h:
		if (h[k] - a) in h:
			return h[k], h[h[k]-a]
 
u,v = f(x)
print '{} {}'.format(u, v)

Submission status: Runtime Error

Solution code:
import collections
 
x = int(raw_input())
def f(a):
	h = {}
	for t in range(121):
		h[t ** 5] = t
	for t in range(1, 121):
		h[- t ** 5] = -t
	for k in h:
		if (h[k] - a) in h:
			return h[k], h[h[k]-a]
 
u,v = f(x)
print '{} {}'.format(u, v)

Submission status: Runtime Error

Solution code:
import collections

x = int(raw_input())
def f(a):
	"""
	
	h = {}
	for t in range(75):
		h[t ** 5] = t
	for t in range(1, 75):
		h[- t ** 5] = -t
	print h
	"""
	h = {0: 0, 1: 1, -32768: -8, -6436343: -23, -2073071593: -73, -17210368: -28, -1419857: -17, 1048576: 16, 45435424: 34, -164916224: -44, 418195493: 53, 1453933568: 68, -656356768: -58, 1350125107: 67, 3125: 5, 7776: 6, -254803968: -48, 32768: 8, 459165024: 54, 2476099: 19, -32: -2, 90224199: 39, 844596301: 61, 759375: 15, 1419857: 17, -20511149: -29, -16807: -7, -459165024: -54, 371293: 13, 79235168: 38, 5153632: 22, 248832: 12, 1252332576: 66, -1934917632: -72, 14348907: 27, -52521875: -35, -777600000: -60, -2219006624: -74, -4084101: -21, -1048576: -16, 7962624: 24, -79235168: -38, -992436543: -63, -1564031349: -69, -537824: -14, -550731776: -56, 503284375: 55, 33554432: 32, 28629151: 31, 130691232: 42, 39135393: 33, 3200000: 20, 59049: 9, -115856201: -41, 312500000: 50, 1024: 4, 32: 2, -3200000: -20, 69343957: 37, 1680700000: 70, 205962976: 46, 345025251: 51, -161051: -11, 17210368: 28, 1804229351: 71, -11881376: -26, -33554432: -32, 229345007: 47, 282475249: 49, 243: 3, -714924299: -59, 9765625: 25, 100000: 10, 254803968: 48, 184528125: 45, 550731776: 56, -184528125: -45, -9765625: -25, 714924299: 59, -243: -3, -282475249: -49, -229345007: -47, -1804229351: -71, 161051: 11, -345025251: -51, 1889568: 18, -1073741824: -64, 11881376: 26, 60466176: 36, -916132832: -62, -69343957: -37, -1453933568: -68, -1680700000: -70, 916132832: 62, 992436543: 63, 1160290625: 65, 115856201: 41, -248832: -12, -312500000: -50, -59049: -9, -601692057: -57, -1160290625: -65, -39135393: -33, -100000: -10, -28629151: -31, 1073741824: 64, 164916224: 44, -503284375: -55, 1564031349: 69, -24300000: -30, -1024: -4, -102400000: -40, 4084101: 21, -130691232: -42, 52521875: 35, -14348907: -27, 601692057: 57, 2219006624: 74, -1889568: -18, -147008443: -43, 656356768: 58, -380204032: -52, -371293: -13, -1252332576: -66, 380204032: 52, 16807: 7, -5153632: -22, 20511149: 29, 1934917632: 72, -759375: -15, -844596301: -61, -90224199: -39, 147008443: 43, -2476099: -19, -7962624: -24, -7776: -6, -3125: -5, -1350125107: -67, -205962976: -46, -60466176: -36, -418195493: -53, 24300000: 30, 777600000: 60, 2073071593: 73, 537824: 14, 102400000: 40, -45435424: -34, 6436343: 23, -1: -1}

	for k in h:
		if (h[k] - a) in h:
			return h[k], h[h[k]-a]

u,v = f(x)
print '{} {}'.format(u, v)

Submission status: Runtime Error

Solution code:
import collections

x = int(raw_input())
def f(a):
	h = {}
	for t in range(75):
		h[t ** 5] = t
	for t in range(1, 75):
		h[- t ** 5] = -t
	for k in h:
		if (h[k] - a) in h:
			return h[k], h[h[k]-a]

u,v = f(x)
print '{} {}'.format(u, v)

Submission status: Runtime Error

Solution code:
x = int(input())
eps = 1e-9
a = 1
while a**5 <= x:
    diff = a**5-x
    if diff < 0:
        diff = abs(diff)
        sign = True
    else:
        sign = False
    if abs(diff**0.2 - round(diff**0.2)) < eps:
        b = round(round(diff**0.2))
        if sign:
            b = -b
        break
    a += 1
print(a,int(b))

Submission status: Runtime Error

Solution code:
import collections

x = int(raw_input())
def f(a):
	arr = map(lambda x:(x ** 5,x), range(-65,65))
	for u in arr:
		for v in arr:
			if v[0] - u[0] == a:
				return (v[1],u[1])

u,v = f(x)
print '{} {}'.format(u, v)