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: Wrong Answer

Solution code:
#保証されている
#分解するとa<10**3となる...??

x=int(input())

for b in range(10**4):
    a = int((x+b**5)**(1/5))
    for i in range(a-100,a+100):
        if i**5+b**5==x:
            print(i,-b)
            exit()
for b in range(10**4):
    a2=(x-b**5)
    if a2<0:
        continue
    a = int(a2**(1/5))
    
    for i in range(a-100,a+100):
        if i**5-b**5==x:
            print(i,b)
            exit()
    #if b==55:
        #print(i,b,a**5-b**5,x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

import itertools

x = int(input())
all_a = [a ** 5 for a in range(-64, 64)]

for comb in itertools.combinations(all_a + all_a, 2):
    if comb[0] - comb[1] == x:
        a = int(math.pow(abs(comb[0]), 1 / 5))
        b = int(math.pow(abs(comb[1]), 1 / 5))

        if comb[0] < 0:
            a *= -1
        if comb[1] < 0:
            b *= -1

        print(a, b)
        exit()

Submission status: Wrong Answer

Solution code:
import itertools
x = int(input())

for v in itertools.permutations(range(-100,100),2):
    if (v[0])**5 - (v[1])**5 == x:
        print(v[0], v[1])
        break

Submission status: Wrong Answer

Solution code:
X = int(input())

for i in range(100):
    for j in range(100):
        if i ** 5 + j ** 5 == X:
            print(i, -j)
            exit()
            
        if i ** 5 + j ** 5 > X:
            break

Submission status: Wrong Answer

Solution code:
x=int(input())

x-=1
y=x**(1.0/5)

print(int(y),-1)

Submission status: Wrong Answer

Solution code:
import sys
input=lambda: sys.stdin.readline().rstrip()
x=int(input())
A=[int(i) for i in range(41)]
Ans=[]
for a in A:
  for b in A:
    if a+b**5==x and not Ans:
      Ans=[a,-b]
    if a**5-b**5==x and not Ans:
      Ans=[a,b]
print(*Ans)

Submission status: Wrong Answer

Solution code:
x=int(input())
import math
for a in range(70):
    if a**5 >= x :
        B=a**5-x
        b = math.pow(B, 1.0/5.0)
        #print(b)
        if b.is_integer()==True:
            print(a,b)
            break
    else:
        B=x-a**5
        b=math.pow(B, 1.0/5.0)
        #print(b)
        if b.is_integer()==True:
            b=int(b)
            print(a,-b)
            break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(1000000000)
import math
from math import gcd
def lcm(a, b): return a * b // gcd(a, b)
from itertools import count, permutations, chain
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok

def get_inv(n, modp):
    return pow(n, modp-2, modp)

def factorials_list(n, modp):    # 10**6
    fs = [1]
    for i in range(1, n+1):
        fs.append(fs[-1] * i % modp)
    return fs

def invs_list(n, fs, modp):     # 10**6
    invs = [get_inv(fs[-1], modp)]
    for i in range(n, 1-1, -1):
        invs.append(invs[-1] * i % modp)
    invs.reverse()
    return invs

def comb(n, k, modp):
    num = 1
    for i in range(n, n-k, -1):
        num = num * i % modp
    den = 1
    for i in range(2, k+1):
        den = den * i % modp
    return num * get_inv(den, modp) % modp

def comb_from_list(n, k, modp, fs, invs):   
    return fs[n] * invs[n-k] * invs[k] % modp

#

class UnionFindEx:
    def __init__(self, size):
        #正なら根の番号、負ならグループサイズ
        self.roots = [-1] * size
    def getRootID(self, i):
        r = self.roots[i]
        if r < 0:   #負なら根
            return i
        else:
            r = self.getRootID(r)
            self.roots[i] = r
            return r
    def getGroupSize(self, i):
        return -self.roots[self.getRootID(i)]
    def connect(self, i, j):
        r1, r2 = self.getRootID(i), self.getRootID(j)
        if r1 == r2:
            return False
        if self.getGroupSize(r1) < self.getGroupSize(r2):
            r1, r2 = r2, r1
        self.roots[r1] += self.roots[r2]    #サイズ更新
        self.roots[r2] = r1
        return True

Yes = 'Yes'
No = 'No'


def main():
    X = ii()
    for a in range(-70, 70):
        b5 = a**5 - X
        b = meg(lambda v: v**5<=b5, -100, 100)
        if b**5==b5:
            print(a, b)
            return

main()

Submission status: Wrong Answer

Solution code:
import sys
X = int(input())
MAX = 2*(10**9)
MOD = 10**9+7
M = [i for i in range(0, 75)]
def function(a, b):
  c = (a-b)%MOD
  return c * ((a**4)%MOD + (a**3)%MOD * b + (a**2)%MOD * (b**2)%MOD + a * (b**3)%MOD + (b**4)%MOD)
for i in M:
  for j in M:
    for m in [-1, 1]:
      for n in [-1, 1]:
        if function(i*m, j*n)%MOD == (X)%MOD:
          print(i*m, j*n)
          sys.exit(0)

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = []
for i in range(1,int(pow(n,1/2))+1):
  if n % i == 0:
    arr.append(i)
res = []
for i in range(len(arr)):
  for j in range(-arr[i]-1,int(pow(n,1/2)+1)):
    if (j + arr[i])**5 - j**5 == n:
      res = [j,j+arr[i]]
      break
print(*res)

Submission status: Wrong Answer

Solution code:
x = int(input())
ans = [i**5 for i in range(65)]
for i in ans:
    for j in ans:
        if i - j == x:
            print(ans.index(i), ans.index(j))
            exit()
        if i + j == x:
            print(ans.index(i), -ans.index(j))
            exit()

Submission status: Wrong Answer

Solution code:
from sys import stdin
X = int(stdin.readline().strip())

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 = make_divisors(X)
for i in range(len(divisors)):
  gap = divisors[i]
  other = X // gap
  for a in range(10^5):
    b = a - gap
    if (a**4 + (a**3)*b + (a**2)*(b**2) + a*(b**3) + b**4)==other:
      print(a, b)
      break
    a = a*(-1)
    b = a - gap
    if (a**4 + (a**3)*b + (a**2)*(b**2) + a*(b**3) + b**4)==other:
      print(a, b)
      break

Submission status: Wrong Answer

Solution code:
import math

x = int(input())

for i in range(1, 10 ** 2 + 11):
    for j in range(-10 ** 2 - 11, 10 ** 2 + 11):
        if i <= j:
            continue
        if i ** 5 - j ** 5 == x:
            print(i, j)
            exit()

Submission status: Wrong Answer

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

    for a in range(-100, 100):
        for b in range(-100, 100):
            if a**5 - b**5 == X:
                return f'{a} {b}'
    return None

print(d_i_hate_factorization())

Submission status: Wrong Answer

Solution code:
X = int(input())
i = 1
ok = False
while i * i <= X and not ok:
  if X % i == 0:
    for x in (i, X//i):
      A = -100
      while A <= 100:
        if A**5-(A-x)**5 == X:
          print(A, A-x)
          ok = True
          break
        A += 1
      if ok:
        break
  i += 1

Submission status: Wrong Answer

Solution code:
x=int(input())
num=[]
for i in range(101):
    num.append(i**5)

for j in range(100):
    for k in range(j+1,101):
        if num[k]-num[j]==x:
            print(k,j)
            exit()
        elif num[k]+num[j]==x:
            print(k,-1*j)
            exit()

Submission status: Wrong Answer

Solution code:
import sys
input=lambda: sys.stdin.readline().rstrip()
x=int(input())
A=[int(i) for i in range(1,41)]
Ans=[]
for a in A:
  for b in A:
    if a+b**5==x and not Ans:
      Ans=[a,-b]
    if a**5-b**5==x and not Ans:
      Ans=[a,b]
print(*Ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
for i in range(int(pow(n,1/5))+1):
	a=i
	b=-1*(n-pow(a,5))

	c=int(pow(abs(b),1/5))
	if b<0:
		c=-c
	if c*c*c*c*c==b:
		print(a,c)
		exit()

Submission status: Wrong Answer

Solution code:
import sys
def input():
    return sys.stdin.readline().rstrip('\n')


def calc(X):
    N = 64
    C = [i ** 5 for i in range(N + 1)]
    for i in range(N + 1):
        for j in range(N + 1):
            if C[i] - C[j] == X:
                return "{0} {1}".format(i, j)
            elif C[i] + C[j] == X:
                return "{0} {1}".format(i, -j)
    

X = int(input())
print(calc(X))

Submission status: Wrong Answer

Solution code:
x=int(input())

a=[0]#x^5 list
for i in range(1,201):
    a.append(i**5)

I=0
J=0
b=0
for i in range(0,201):
    for j in range(0,201):
        if a[j]-a[i]==x:
            I=i
            J=j
            b=1
            break
    if b==1:
        break

for i in range(0,201):
    for j in range(0,201):
        if a[j]+a[i]==x:
            I=i
            J=-j
            b=1
            break
    if b==1:
        break
print(I,J)

Submission status: Wrong Answer

Solution code:
X = int(input())
L = [0 for _ in range(101)]
for i in range(101):
    L[i] = i * i * i * i * i
flg = False
for i in range(101):
    for j in range(101):
        if L[i] - L[j] == X:
            print(i, j)
            flg = True
        elif L[i] + L[j] == X:
            print(i, -j)
            flg = True
        if flg:
            break
    if flg:
        break

Submission status: Wrong Answer

Solution code:
s = int(input())
j= -1
for i in range(0, s):
    if i**5-j**5 ==s:
        print(i, -1)
        break

Submission status: Wrong Answer

Solution code:
import itertools
x=int(input())
a=list(range(-100,100))
l=itertools.permutations(a, 2)
for i in l:
  if i[0]**5-i[1]**5==x:
    print(i[0],i[1])
    break

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

Solution code:
X = int(input())
for a in range(10**8):
    tmp = (a**5 - X) ** (1/5)
    if type(tmp) is complex:
        tmp = (-a**5 + X) ** (1/5)
        if tmp.is_integer():
            print(a,-int(tmp))
            exit()
    elif tmp.is_integer():
        print(a,int(tmp))
        exit()

Submission status: Wrong Answer

Solution code:
import math
X = int(input())
N = int(X**(1/5))
for a in range(N+10):
    M = X-(a**5)
    if M < 0:
        continue
    M **= 1/5
    M = int(M)+10
    for b in reversed(range(M)):
        if a**5 + b**5 == X:
            print(a,-b)
            exit()

Submission status: Wrong Answer

Solution code:
#保証されている
#分解するとa<10**3となる

x=int(input())

for b in range(10**3):
    a = int((x+b**5)**(1/5))
    for i in range(a-100,a+100):##
        if i**5+b**5==x:
            print(i,-b)
            exit()
for b in range(10**3):
    a2=(x-b**5)
    if a2<0:
        continue
    a = int(a2**(1/5))
    
    for i in range(a-100,a+100):
        if i**5-b**5==x:
            print(i,b)
            exit()
    #if b==55:
        #print(i,b,a**5-b**5,x)

Submission status: Wrong Answer

Solution code:
#create date: 2020-05-03 21:20

import sys
stdin = sys.stdin

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))



def main():
    x = ni()
    for a in range(-100,100):
        for b in range(-100, 100):
            if a**5 - b**5 == x:
                print("{} {}".format(a, b))
                quit()


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
X = int(input())
for A in range(1, 5001):
  for B in range(-5001, 5001):
    if(A**5 - B**5 == X):
      print(A, B)
      break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

X = int(input())

for i in range(int(X**0.2)+1):
    tmp = (X-i**5)**0.2
    if tmp%1 == 0:
        print(i,-int(tmp))
        exit()

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
for i in range(-100,101):
	for j in range(-100,101):
		a5 = pow(i , 5)
		b5 = pow(j, 5)
		if a5 - b5 == x:
			exit(print(i , j))

Submission status: Wrong Answer

Solution code:
from sys import stdin
import sys
import math

X = int(input())

x = int(math.sqrt(X) + 1)

# ａ⁵－ｂ⁵＝(ａ－ｂ)(ａ⁴＋ａ³ｂ＋ａ²ｂ²＋ａｂ³＋ｂ⁴)
# a - b >= 1


for a in range(65):
    r = X - a ** 5
    if r < 0:
        break
    b5 = 0
    for b in range(65):
        b5 = b ** 5
        if b5 == r:
            #print("%d %d" % (-a, b))
            print("%d %d" % (b, -a))
            sys.exit()
        if b5 > r:
            break

Submission status: Wrong Answer

Solution code:
X=int(input())
dict=[]
for i in range(100):
    for j in range(100):
        if i**5-j**5==X:
            print(i,j)
            exit()
        if i**5+j**5==X:
            print(i,-1*j)
            exit()

Submission status: Wrong Answer

Solution code:
x = int(input())
for a in range(-x,x):
    f = 0
    for b in range(-x,x):
        if abs(a**5-b**5)==x:
            print(a,b)
            f = 1
            break
    if f:
        break

Submission status: Wrong Answer

Solution code:
import sys
X = int(input())
MAX = 2*(10**9)
MOD = 10**9+7
M = [i for i in range(0, 100)]
def function(a, b):
  return (a-b)*(a**4 + (a**3) * b + (a**2) * (b**2) + a * (b**3) + b**4)
for i in M:
  for j in M:
    for m in [-1, 1]:
      for n in [-1, 1]:
        if function(i*m, j*n)%MOD == (X)%MOD:
          print(i*m, j*n)
          sys.exit(0)

Submission status: Wrong Answer

Solution code:
x=int(input())
f=False
for a in range(-100,100):
    for b in range(-100,100):
        v=a**5+b**5
        if v==x:
            f=True
            break
        elif v>x:
            break
    if f:
        break
print(str(a) + " " + str(b))

Submission status: Wrong Answer

Solution code:
X = int(input())
n = 1
while(X > n**5):
    n += 1
up = n**5
down = (n-1)**5
for i in range(n):
    test = up - i**5
    if(X == test):
        print(n,i)
        exit()
for i in range(n):
    test = down + i**5
    if(X == test):
        print(n-1,-i)
        exit()

Submission status: Wrong Answer

Solution code:
#coding: utf-8
from math import ceil, floor
X = int(input())
a = floor(X**(1/5))
while True:
    if (a**5 - X) < 0:
        pass
    elif int((a**5 - X)**(1/5)) == (a**5 - X)**(1/5):
        print(a, int((a**5 - X)**(1/5)))
        exit()
    a += 1

Submission status: Wrong Answer

Solution code:
import itertools

X = int(input())

s = set()
for i in range(0, 101):
    s.add(i**5)
    s.add(-i**5)

for comb in itertools.combinations(s, 2):
    if comb[0] - comb[1] == X:
        print(comb[0], comb[1])
        break
    if comb[1] - comb[0] == X:
        print(comb[1], comb[0])
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

Solution code:
X = int(input())

for i in range(10**2):
    for j in range(-10**3,10**3):
        if i**5 - j**5 ==X:
            print(i,j)
            break

Submission status: Wrong Answer

Solution code:
x=int(input())
if x==1:
    print(0,-1)
    exit()
def prime_factorize(n):
    a=[]
    while n%2==0:
        a.append(2)
        n//=2
    f=3
    while f**2<=n:
        if n%f==0:
            a.append(f)
            n//=f
        else:
            f+=2
    if n!=1:
        a.append(n)
    return(a)
li=list(set(prime_factorize(x)))
for i in range(len(li)):
    j=li[i]
    k=li[i]-1
    while pow(k,5)-pow(k-j,5)<=x:
        if pow(k,5)-pow(k-j,5)==x:
            print(k,k-j)
            exit()
        else:
            k+=1
    continue

Submission status: Wrong Answer

Solution code:
import sys
X = int(input())
MAX = 2*(10**9)
MOD = 10**9+7
M = [i for i in range(0, 75)]
def function(a, b):
  return (a-b)*(a**4 + (a**3) * b + (a**2) * (b**2) + a * (b**3) + b**4)
for i in M:
  for j in M:
    for m in [-1, 1]:
      for n in [-1, 1]:
        if function(i*m, j*n)%MOD == (X)%MOD:
          print(i*m, j*n)
          sys.exit(0)

Submission status: Wrong Answer

Solution code:
from sys import stdin
import sys
import math

X = int(input())

x = int(math.sqrt(X) + 1)

# ａ⁵－ｂ⁵＝(ａ－ｂ)(ａ⁴＋ａ³ｂ＋ａ²ｂ²＋ａｂ³＋ｂ⁴)
# a - b >= 1


for a in range(65):
    r = X - a ** 5
    if r < 0:
        break
    b5 = 0
    for b in range(65):
        b5 = b ** 5
        if b5 == r:
            print("%d %d" % (-a, b))
            sys.exit()
        if b5 > r:
            break

Submission status: Wrong Answer

Solution code:
x = int(input())
for a in range(5000):
    for b in range(5000):
        if a ** 5 - b ** 5 == x:
            print(a, b)
            break
        if a ** 5 - ((-b) ** 5) == x:
            print(a, b)
            break
        #print(a, b, a ** 5 - b ** 5)
        #print(a, (-b), a ** 5 - ((-b) ** 5))

Submission status: Wrong Answer

Solution code:
def resolve():
    x = int(input())
    y = x ** 0.2
    yfloor = int(y)
    yfloor5 = yfloor ** 5
    for i in range(0, -yfloor - 1, -1):
        if yfloor5 - i ** 5 == x:
            print(yfloor, i)
            return
    yceil = yfloor + 1
    yceil5 = yceil ** 5
    for i in range(yceil + 1):
        if yceil5 - i ** 5 == x:
            print(yceil, i)
            return


if __name__ == '__main__':
    resolve()

Submission status: Wrong Answer

Solution code:
x = int(input())
a = int((x + 1) ** (1/5))
print(str(a)+' '+str(-1))

Submission status: Wrong Answer

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

def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct

def main():
    X = int(readline())
    if X == 1:
        print(0, -1)
        return
    fct = factorize(X)
    if len(fct) == 1:
        fct.append(1)
    f1 = fct[0]
    f2 = fct[1]
    ai = math.ceil(f1/2)
    bi = ai - f1
    for i in range(X):
        if ai**4+ai**3*bi+ai**2*bi**2+ai*bi**3+bi**4 == f2:
            print(ai, bi)
            return
        ai += 1
        bi -= 1


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())
import math

n = math.floor( N**(1/5) )

for i in range(0,n+1):
  for j in range(0,n+1):
    
    if i ** 5 + j **5 == N:
      break
      
print(int(i),int(j))

Submission status: Wrong Answer

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)

    #divisors.sort(reverse=True)
    return divisors

d = make_divisors(x)
for i in d:
    for a in range(1, 100):
        b = a-i
        if a**5-b**5 == x:
            print(a, b)
            exit()

Submission status: Wrong Answer

Solution code:
import itertools
X = int(input().strip())

data = {}
for v in range(-63, 64):
    data[v] = pow(v, 5)

for a, b in itertools.product(data.items(), data.items()):
    if a[1] - b[1] == X:
        print(a[0], b[0])
        break

Submission status: Wrong Answer

Solution code:
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

x = ii()
dp = [0]*101
for i in range(1,101):
    dp[i] = i**5
from bisect import bisect_left as bl
'''index  =  bl(list,num)'''
for i in range(1,100):
    index = bl(dp,dp[i]+x)
    if index == 101:
        continue
    if dp[index] == dp[i] +x:
        print(index,i)
        exit()

for i in range(1,100):
    index = bl(dp,-dp[i]+x)
    if index == 101:
        continue
    if dp[index] == -dp[i] +x:
        print(index,-i)
        exit()

Submission status: Wrong Answer

Solution code:
X = int(input())

FIVES = [(x+1) ** 5 for x in range(200)]

for ki,vi in enumerate(FIVES):
    for kj,vj in enumerate(FIVES):
        if ki > kj and vi - vj == X:
            print(ki+1,kj+1)
            exit()
        if ki < kj and vj - vi == X:
            print(kj+1,ki+1)
            exit()
        if vi + vj == X:
            print(ki+1,-(kj+1))
            exit()

Submission status: Wrong Answer

Solution code:
import math

X = int(input())

inX = math.ceil(X**(1/5))
for i in reversed(range(inX+1)):
    for j in range(64):
        if i**5 - (-j)**5 == X:
            print(i, -j)
            exit()

Submission status: Wrong Answer

Solution code:
X=int(input())

judge=False

for i in range(-100,101):
    for j in range(-100,101):
        if pow(i,5)-pow(j,5)==X:
            print(i,j)
            judge=True
            break
    if judge:
        break

Submission status: Wrong Answer

Solution code:
x = int(input())

tmp = x+(-1)**5
print(int(tmp**(1/5)), -1)

Submission status: Wrong Answer

Solution code:
X=int(input())
n5=[]
n=0
mx=10**10
while True:
    m=n**5
    n5.append(m)
    if m>mx: break
    n+=1

for i,a in enumerate(n5):
    for j,b in enumerate(n5):
        if a-b==X: print(i,j); exit()
        elif a+b==X: print(i,-j); exit()
        elif -a-b==X: print(-i,j); exit()
        elif -a+b==X: print(-i,-j); exit()

Submission status: Wrong Answer

Solution code:
X = int(input())


for i in range(-100,101):
    for j in range(-100,101):
        if i ** 5 - j ** 5 == X:
            print("{} {}".format(i,j))
            exit()
        else:
            continue

Submission status: Wrong Answer

Solution code:
x = int(input())

for i in range(10**2):
    for j in range(10**2):
        a = i**5 - j**5
        if a == x:
            print(i,j)
            exit()
        b = i**5 + j**5
        if b == x:
            print(i,j*(-1))
            exit()

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
for i in range(1,101):
	for j in range(-100,101):
		a5 = pow(i , 5)
		b5 = pow(j, 5)
		if a5 - b5 == x:
			exit(print(i , j))

Submission status: Wrong Answer

Solution code:
import sys
x = int(input())
result = [1,1]
for i in range(-100,100):
    for j in range(-100,100):
        if x == pow(i, 5)-pow(j, 5):
            result = [i, j]
            print(*result)
            sys.exit()
print(*result)

Submission status: Wrong Answer

Solution code:
X = int(input())
for a in range(10**5):
    tmp = (a**5 - X) ** (1/5)
    if type(tmp) is complex:
        tmp = (-a**5 + X) ** (1/5)
        if tmp.is_integer():
            print(a,-int(tmp))
            exit()
    elif tmp.is_integer():
        print(a,int(tmp))
        exit()

Submission status: Wrong Answer

Solution code:
X = int(input())
k = 0
for i in range(1,10**4+1):
    if i**5 >= X:
        k = i
        break

for l in range(k):
    a = k-l
    for b in range(a):
        if a**5 - b**5 == X:
            print(a,b)
            break
        elif a**5 + b**5 == X:
            print(a,-b)
            break

Submission status: Wrong Answer

Solution code:
import sys,math,copy,queue,itertools,bisect,collections
from heapq import *
sys.setrecursionlimit(10**7)
LI = lambda : [int(x) for x in sys.stdin.readline().split()]
NI = lambda : int(sys.stdin.readline())
INF = 10**18
MOD = 10**9 + 7
DD = ((1,0),(-1,0),(0,1),(0,-1))

X = NI()
m = []
for i in range(1,int(math.sqrt(X))+1):
    if X % i == 0:
        m.append(i)
        m.append(X//i)
for i in m:
    a = i - 1
    f = a**4 - a**3 + a**2 - a + 1
    if i * f == X:
        print(a,-1)
        break

Submission status: Wrong Answer

Solution code:
from math import sqrt, log, pow
num = [i**5 for i in range(-100, 500)]
X = int(input())
c = 0
for i in range(len(num)):
    a = num[i]
    for j in range(i+1):
        if a - num[j] == X:
            print(i-1, j-1)
            exit()

Submission status: Wrong Answer

Solution code:
def main():
    X = int(input())
    l = [pow(i, 5, 10**20) for i in range(51)]
    for vi, i in enumerate(l):
        for vj, j in enumerate(l):
            if i + j == X:
                print(vi, -vj)
                return
            elif i - j == X:
                print(vi, vj)
                return
            elif j - i == X:
                print(-vi, -vj)
                return
main()

Submission status: Wrong Answer

Solution code:
X = int(input())

x = -1 * pow(10, 5)
y = pow(10, 5)

for B in range(x, y):
  A = pow(X + pow(B, 5), 0.2) 
  if type(A) != complex:
    if int(A) == A:
      print(int(A), B)
      quit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x=int(input())
for a in range(0,64):
    for b in range(0,64):
        a5=a**5
        b5=b**5
        if(a5-b5)==x:
            print(a,b)
            exit()
        if(a5+b5==x):
            print(a,-b) 
            exit()

Submission status: Wrong Answer

Solution code:
def main():
    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()
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
x = int(input())
for i in range(100000000):
    if i**5-x>0: y = (i**5-x)**(1/5)
    else: y = -((x-i**5)**(1/5))
    if y%1==0:
        print(i, int(y))
        break

Submission status: Wrong Answer

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

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

    if x % 2 == 0:
        print(int((x-1)**(1/5)), 0)
    else:
        print(int((x-1)**(1/5)), -1)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    import sys
    sys.setrecursionlimit(10**6)
    input = sys.stdin.readline
    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()


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
N=int(input())


for i in range(-63,63):
    for j in range(-63,63):
        if i**5-j**5==N:
            print(i,j)
            sys.exit(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())

inX = int(X**(1/5))
for i in reversed(range(inX+1)):
    for j in range(64):
        if i**5 - (-j)**5 == X:
            print(i, -j)
            exit()

Submission status: Wrong Answer

Solution code:
can=[0]
for i in range(1,65):
    can.append(pow(i,5))
    can.append(-pow(i,5))
can.sort()

x=int(input())

end=False
for i in range(len(can)):
    for q in range(len(can)):
        if can[i]-can[q]==x:
            print(i-64,q-64)
            end=True
            break
    if end:
        break
else:
    print("None")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

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

Submission status: Wrong Answer

Solution code:
five_powers = []
x = 0
while x ** 5 < 10 ** 9:
    five_powers.append(x)
    x += 1
x = int(input())
n = len(five_powers)
flag = False
for i in range(n):
    for j in range(n):
        a = five_powers[i]
        b = five_powers[j]
        if a ** 5 - b ** 5 == x:
            print('{} {}'.format(a, b))
            flag = True
            break
        if a ** 5 + b ** 5 == x:
            print('{} {}'.format(a, -1 * b))
            flag = True
            break
    if flag: break

Submission status: Wrong Answer

Solution code:
from math import sqrt, log, pow
num = [i**5 for i in range(-1, 121)]
X = int(input())
c = 0
for i in range(len(num)):
    a = num[i]
    for j in range(i+1):
        if a - num[j] == X:
            print(i-1, j-1)
            exit()

Submission status: Wrong Answer

Solution code:
X=int(input())

judge=False

for i in range(1,100):
    for j in range(-100,i+1):
        if pow(i,5)-pow(j,5)==X:
            print(i,j)
            judge=True
            break
    if judge:
        break

Submission status: Wrong Answer

Solution code:
def main(d):
    t=0
    for i in range(-10**2,10**2):
        if t==0:
            for j in range(-10**2,10**2):
                if i**5-j**5==d:
                    print(i,j)
                    t+=1
                    break
d=int(input())
main(d)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
"""
aを10^3くらいまででいいよね
"""
x = int(input())
# a>0 b>0のとき
for i in range(10**3):
    for j in range(i+1,10**3):
        if j ** 5 - i ** 5 == x:
            print(i,j)
            exit()
# a>0, b<0のとき
for i in range(10**2):
    for j in range(10**2):
        if i**5 + j**5 == x:
            print(i,-j)
            exit()

Submission status: Wrong Answer

Solution code:


r=[]
for i in range(128):
    A=i-63
    for j in range(128):
        B=j-63
        r.append((A**5-B**5,A,B))
r.sort()

target=int(input())
lwbd = 0
upbd = len(r)

while lwbd<upbd:
    middle = lwbd + (upbd-lwbd)//2
    if(r[middle][0]==target):
        break
    elif r[middle][0]>target:
        upbd = middle -1
    else:
        lwbd = middle +1
print(r[middle][1],r[middle][2])

Submission status: Wrong Answer

Solution code:
x=int(input())

dic={}

a=set([])
for i in range(101):
    a.add(i**5)
    dic[i**5]=i
    a.add(-1*i**5)
    dic[-1*i**5]=i*(-1)

#print(dic)

for item1 in a:
    for item2 in a:
        if item1 - item2==x:
            print(dic[item1],dic[item2])
            exit()