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:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
X = INT()

# #nを素因数分解したリストを返す
# def prime_decomposition(n):
#   i = 2
#   table = []
#   while i * i <= n:
#     while n % i == 0:
#       n /= i
#       table.append(i)
#     i += 1
#   if n > 1:
#     table.append(n)
#   return table
def divisor(n): #nの約数を全て求める
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table

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








# for d in D:
#     ab = d
#     Z = ab // d
#     print(ab, Z)
#     # print((X ** (1/5)))
#     for b in range(int(sqrt(X)) + 1):
#         a = ab - b
#         if a**5-b**5 == X:
#             print("a, b:", a, b)



# for d in divisor(X):
#     ab = d
#     z = X // d
#     for a in range(10 ** 9):
#         b = a - d
#         dot = 
    # for b in range():

Submission status: Wrong Answer

Solution code:
x = int(input())

for i in range(100):
    for j in range(-100,100):
        if i ** 5 - j** 5 == x:
            print(i,j)
            exit()

Submission status: Wrong Answer

Solution code:
x=int(input())
value=0
index=0
hashmap=dict()
while value<int(5e9)+1:
    value=pow(index,5)
    hashmap[value]=index
    index+=1
#print(hashmap)    

for i in range(1,100):
    b1=x+int(pow(i,5))
    b2=x+int(pow(-i,5))
    if hashmap.get(b1)!=None:
        print(hashmap[b1],i)
        break
    if hashmap.get(abs(b2))!=None:
        print(hashmap[abs(b2)],-i)
        break

Submission status: Wrong Answer

Solution code:
def f(a,b):
    return a**5 - b**5

x = int(input())
for a in range(-3,3):
    for b in range(-3,3):
        if f(a,b) == x:
            print(a,b)  
            quit()

Submission status: Wrong Answer

Solution code:
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

x=n0()
if float.is_integer(x**(1/5)):
    print(int(x**(1/5)),0)
else:
    k=1
    while True:
        y1=k**5-x
        if y1>=0:
            if float.is_integer(y1**(1/5)):
                print(k,int(y1**(1/5)))
                break
        else:
            if float.is_integer((-y1)**(1/5)):
                print(k,-int((-y1)**(1/5)))
                break
        y2=(-k)**5-x
        if y2>=0:
            if float.is_integer(y2**(1/5)):
                print(-k,int(y2**(1/5)))
                break
        else:
            if float.is_integer((-y2)**(1/5)):
                print(-k,-int((-y2)**(1/5)))
                break
                
        k+=1

Submission status: Wrong Answer

Solution code:
n = int(input())
nn = int(pow(n,1/2))
for i in range(0,nn):
    cheak = i ** 5 - n
    if cheak < 0:
        b = -1 * pow(abs(i ** 5 - n), 1/5)
    else:
        b = pow((i ** 5 - n), 1/5)
    if type(b) is float:
        if float.is_integer(b):
            print(i,int(b))
            break

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
y = int(math.pow(x, 1/5))
z = x - (y)**5 
print(y, int(math.pow(z, 1/5)))

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())
OK = 1
for a in range(99):
    if OK == 0:
        break
    for b in range(-99,99):
        if a**5-b**5==x:
            print(a,b)
            OK -= 1
            break

Submission status: Wrong Answer

Solution code:
x = int(input())

for a in range(-120, 120):
    for b in range(-120, 120):
        if a ** 5 - b ** 5 == x:
            print(a, b)

Submission status: Wrong Answer

Solution code:
n = int(input())
nn = int(pow(n,1/4))
for i in range(-nn,nn):
    cheak = i ** 5 - n
    if cheak < 0:
        b = -1 * pow(abs(i ** 5 - n), 1/5)
    else:
        b = pow((i ** 5 - n), 1/5)
    if type(b) is float:
        if float.is_integer(b):
            print(i,int(b))
            break

Submission status: Wrong Answer

Solution code:
x=int(input())
value=0
index=0
hashmap=dict()
while value<int(1e18)+1:
    value=index**5
    hashmap[value]=index
    index+=1
#print(hashmap)    
 
for i in range(1,64):
    b1=x+ i**5
    b2=x+(-i)**5
    if hashmap.get(b1)!=None:
        print(hashmap[b1],i)
        break
    if hashmap.get(abs(b2))!=None:
        print(hashmap[abs(b2)],-i)
        break

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
# a != b


a5 = []
for i in range(100):
    a5.append(i ** 5)

b5 = []
for j in range(100):
    b5.append(j ** 5)

ans_a = 0
ans_b = 0

for a in a5:
    for b in b5:
        if a - b == X:
            print("%d %d" % (a5.index(a), b5.index(b)))
            sys.exit()
        elif a + b == X:
            print("%d %d" % (b5.index(b), (a5.index(a)) * (-1)))
            sys.exit()

Submission status: Wrong Answer

Solution code:
def abc166_d():
  x = int(input())
  for i in range(-126, 127):
    for j in range(-126, 127):
      if i**5 + j**5 == x:
        print('{} {}'.format(i, j))
        return

abc166_d()

Submission status: Wrong Answer

Solution code:
n = int(input())
nn = int(pow(n,1/4))
for i in range(-nn,nn):
    cheak = i ** 5 - n
    if cheak < 0:
        b = -1 * pow(abs(i ** 5 - n), 1/5)
    else:
        b = pow(abs(i ** 5 - n), 1/5)
    if type(b) is float:
        if float.is_integer(b):
            break

print(i,int(b))

Submission status: Wrong Answer

Solution code:
x=int(input())
value=0
index=0
hashmap=dict()
while value<int(1e18)+1:
    value=pow(index,5)
    hashmap[value]=index
    index+=1
#print(hashmap)    

for i in range(1,64):
    b1=x+int(pow(i,5))
    b2=x+int(pow(-i,5))
    if hashmap.get(b1)!=None:
        print(hashmap[b1],i)
        break
    if hashmap.get(abs(b2))!=None:
        print(hashmap[abs(b2)],-i)
        break

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
X = INT()

# #nを素因数分解したリストを返す
# def prime_decomposition(n):
#   i = 2
#   table = []
#   while i * i <= n:
#     while n % i == 0:
#       n /= i
#       table.append(i)
#     i += 1
#   if n > 1:
#     table.append(n)
#   return table
def divisor(n): #nの約数を全て求める
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table

D = divisor(X)

for d1 in D:
    for a in range(-10**4, 10**4):
        b = d1 - a
        d2 = X // d1
        if a**5-b**5 == X:
            print(a, b)
            exit()









# for d in D:
#     ab = d
#     Z = ab // d
#     print(ab, Z)
#     # print((X ** (1/5)))
#     for b in range(int(sqrt(X)) + 1):
#         a = ab - b
#         if a**5-b**5 == X:
#             print("a, b:", a, b)



# for d in divisor(X):
#     ab = d
#     z = X // d
#     for a in range(10 ** 9):
#         b = a - d
#         dot = 
    # for b in range():

Submission status: Wrong Answer

Solution code:
import numpy as np

x = int(input())
flag = 0
for i in range(1, int(np.sqrt(x))+1):
    if x % i == 0:
        k = int(x / i)
        if k < 31:
            for c in range(100):
                a = c
                b = a - i
                d = a**4 + (a**3)*b + (a**2)*(b**2) + a*(b**3) + b**4
                if d == k:
                    flag += 1
                    break
            if flag != 1:
                for c in range(100):
                    a = c
                    b = a - k
                    d = a**4 + (a**3)*b + (a**2)*(b**2) + a*(b**3) + b**4
                    if d == i:
                        flag += 1
                        break
        else:
            for c in range(1, 10):
                a = c
                b = a - i
                d = a**4 + (a**3)*b + (a**2)*(b**2) + a*(b**3) + b**4
                if d == k:
                    flag += 1
                    break
            if flag != 1:
                for c in range(10):
                    a = c
                    b = a - k
                    d = a**4 + (a**3)*b + (a**2)*(b**2) + a*(b**3) + b**4
                    if d == i:
                        flag += 1
                        break
        if flag == 1:
            break
print(a, b)

Submission status: Wrong Answer

Solution code:
n = int(input())
nn = int(pow(n,1/5)) + 2
for i in range(-nn,nn):
    cheak = i ** 5 - n
    if cheak < 0:
        b = -1 * pow(abs(i ** 5 - n), 1/5)
    else:
        b = pow(abs(i ** 5 - n), 1/5)
    if type(b) is float:
        if float.is_integer(b):
            break

print(i,int(b))

Submission status: Wrong Answer

Solution code:
X = int(input())
a = -120
while True:
    b = a ** 5 - X
    if b < 0:
        b = -abs(b) ** (1 / 5)
    else:
        b = b ** (1 / 5)
    if b.is_integer():
        print(a, int(b))
        break
    a += 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(a,b)

Submission status: Wrong Answer

Solution code:
X = int(input())

a = 0
while True:
    a += 1
    if a**5 > X:
        A1 = (a-1)**5
        A2 = a**5
        break

B1 = -(X - A1)
B2 = -(X - A2)

b=0
c=0
d=0
e=0

if B1 < 0:
    while True:
        b -= 1
        if B1 == b**5:
            print(a-1, b)
            break
        elif b**5 < B1:
            break
elif B1 >= 0:
    while True:
        c += 1
        if B1 == c**5:
            print(a-1, c)
            break
        elif c**5 > B1:
            break
elif B2 < 0:
    while True:
        d -= 1
        if B2 == d**5:
            print(a-1, d)
            break
        elif d**5 < B2:
            break
elif B2 >= 0:
    while True:
        e += 1
        if B2 == e**5:
            print(a-1, e)
            break
        elif e**5 > B2:
            break

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
 
X = int(input())

AB_max = 0
abs_X = abs(X)

for i in range(10**9):
  if ( i**5 > abs_X ):
    AB_max = i+1
    break

#print(AB_max)

for i in range(AB_max+1):
  for j in range(AB_max+1):
    
    A = i**5
    B = j**5
    
    if ( A-B==X ):
      print(i,j)
      break
    elif ( A-(-B)==X ):
      print(i,-j)
      break
    elif ( (-A)-B==X ):
      print(-i,j)
      break
    elif ( (-A)-(-B)==X ):
      print(-i,-j)
      break
      
  else:
    continue
  break

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
sqrt_x = int(math.sqrt(x))
for i in range(1, sqrt_x):
    if(x % i == 0):
        X = i
        Z = x/i
        Y = math.sqrt(1/3*(-7*X + math.sqrt(52*X*X*X*X+48*Z)))
        a = round((X+Y)/2)
        b = round((X-Y)/2)
        if(a*a*a*a*a - b*b*b*b*b == x):
            print(a, b)
            exit()

Submission status: Wrong Answer

Solution code:
x=int(input())
for i in range(-118, 120):
  if x-pow(i, 5)>=0:
    if round(pow((x-pow(i, 5)), 0.2), 14).is_integer():
      b=int(pow((x-pow(i, 5)), 0.2))
      print(i, -b)
      break
  else:
    if round(pow(-(x-pow(i, 5)), 0.2), 14).is_integer():
      b=int(pow(-(x-pow(i, 5)), 0.2))
      print(i, b)
      break

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
c = range(-1000, 1000)
for b in range(-1000, 1000):
    tmp = pow(b, 5)
    tmp += x
    a = tmp ** 0.2
    if a in c:
        print(int(a), int(b))
        exit()

Submission status: Wrong Answer

Solution code:
from math import ceil, sqrt
import sys
x = int(input())
# x = a**5 - b**5
# a**5 - b**5 = (a − b)(a**4 + a**3b + a**2b**2 + ab**3 + b**4)
def get_factors(n):
  set_factors = {n}
  q = n
  for i in range(1, ceil(sqrt(n))):
    if q%i == 0:
      set_factors.add(i)
      q = q//i
    if q<=1: return set_factors
  return set_factors
all_factors = get_factors(x)
def test_factor(factor):
  upper = sys.maxsize
  lower = 0
  condition = True
  while condition:
    condition = upper>lower+1
    a = (upper+lower)//2
    if a**5-(a-factor)**5 < x:
      lower = a
    elif a**5-(a-factor)**5 == x:
      return (a, a-factor)
    else:
      upper = a
  return None
for factor in all_factors:
  result = test_factor(factor)
  if result!=None:
    print(result[0], result[1])
    break

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
c = range(-1000, 1000)
for b in range(-1000, 1000):
    tmp = pow(b, 5)
    tmp += x
    a = tmp ** 0.2
    if type(a) == complex:
        continue
    if a in c:
        print(int(a), int(b))
        exit()

Submission status: Wrong Answer

Solution code:
r=[59049,243,1,3125,1024,16807,32768,7776,0,32, \
371293,161051,100000,537824,1419857,1048576,1889568,248832,2476099,759375, \
20511149,11881376,7962624,9765625,4084101,3200000,5153632,14348907,17210368,6436343, \
33554432,60466176,28629151,69343957,79235168,52521875,24300000,45435424,90224199,39135393, \
229345007,254803968,184528125,102400000,130691232,147008443,205962976,164916224,282475249,115856201, \
601692057,418195493,459165024,380204032,312500000,345025251,714924299,503284375,550731776,656356768, \
1160290625,1350125107,916132832,1564031349,844596301,1252332576,1453933568,777600000,992436543,1073741824, \
2706784157,2887174368,3077056399,1934917632,2373046875,2535525376,2219006624,2073071593,1804229351,1680700000, \
3939040643,4437053125,4182119424,3276800000,3707398432,5277319168,5584059449,3486784401,4704270176,4984209207, \
7339040224,8587340257,6240321451,5904900000,6590815232,6956883693,7737809375,8153726976,9509900499,9039207968, \
10000000000,12762815625,11040808032,14693280768,15386239549,11592740743,14025517307,13382255776,12166529024,10510100501, \
20113571875,16105100000,17623416832,22877577568,21003416576,18424351793,21924480357,23863536599,19254145824,16850581551, \
33038369407,28153056843,27027081632,24883200000,30517578125,35723051649,34359738368,25937424601,31757969376,29316250624, \
46525874176,51888844699,41615795893,43204003424,40074642432,38579489651,44840334375,37129300000,48261724457,50049003168, \
57735339232,61917364224,71008211968,64097340625,68641485507,55730836701,66338290976,53782400000,73439775749,59797108943, \
75937500000,101621504799,78502725751,83841135993,92389579776,95388992557,89466096875,81136812032,98465804768,86617093024, \
118636749824,129891985607,108175616801,137858491849,122298103125,133827821568,115063617043,111577100832,104857600000,126049300576, \
146211169851,141985700000,159494694624,154963892093,173726604657,150536645632,168874213376,164130859375,178689902368,183765996899, \
199690286432,194264244901,188956800000,205236901143,216699865625,222620278176,210906087424,241162079949,234849287168,228669389707, \
312079600999,254194901951,274794888224,289254654976,296709280757,267785184193,304316815968,260919263232,281950621875,247609900000]
x=int(input())
for i in r:
  for j in r:
    if i-j ==x:
      print("%d %d" % (int(i**0.2),int(j**0.2)))
    if i+j ==x:
      print("%d -%d" % (int(i**0.2),int(j**0.2)))

Submission status: Wrong Answer

Solution code:
x = int(input())

for a in range(-200, 200):
    for b in range(-200, 200):
        if a**5 - b**5 == x:
            print(a, b)
            break

Submission status: Wrong Answer

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

print(a,b)

Submission status: Wrong Answer

Solution code:
n = int(input())
nn = int(pow(n,1/5)) + 1
for i in range(-nn,nn):
    cheak = i ** 5 - n
    if cheak < 0:
        b = -1 * pow(abs(i ** 5 - n), 1/5)
    else:
        b = pow(abs(i ** 5 - n), 1/5)
    if type(b) is float:
        if float.is_integer(b):
            break

print(i,int(b))

Submission status: Wrong Answer

Solution code:
X = int(input())
for a in range(0, 10**2):
    for b in range(0, 10**2):
        if X == a**5 - b**5:
            print(a, b)
            exit()
        elif X == a**5 + b**5:
            print(a, -b)
            exit()
        elif X == -a**5 - (10**4 - b)**5:
            print(-a, 10**4 - b)
            exit()

Submission status: Wrong Answer

Solution code:
# 競プロの数学は高校数学みたいな泥臭いのが多い
# めんどくさがってA,Bの範囲を計算しなかったのが原因
# なんなら大雑把にみて -500~500でもいけてる
flag = 0
X = int(input())
for i in range(1000):
    if flag == 1:
        break
        for j in range(1000):
            a = i-500
            b = j-500
            if X == a**5-b**5:
                print(a, end=" ")
                print(b)
                flag =  1
                break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
 
X = int(input())

AB_max = 0
abs_X = abs(X)

for i in range(10**9):
  if ( i**5 > abs_X ):
    AB_max = i
    break

#print(AB_max)

for i in range(0, AB_max+1):
  for j in range(0, AB_max+1):
    
    A = i**5
    B = j**5
    
    if ( A-B==X ):
      print(i,j)
      break
    elif ( A-(-B)==X ):
      print(i,-j)
      break
    elif ( (-A)-B==X ):
      print(-i,j)
      break
    elif ( (-A)-(-B)==X ):
      print(-i,-j)
      break
      
  else:
    continue
  break

Submission status: Wrong Answer

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


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

    B = 0
    while True:
        A = (X + B**5)
        A = A**(1/5) if A > 0 else -(-A)**(1/5)
        if not isinstance(A, complex) and A.is_integer():
            A = int(A)
            break
        B *= -1
        A = (X + B**5)
        A = A**(1/5) if A > 0 else -(-A)**(1/5)
        if not isinstance(A, complex) and A.is_integer():
            A = int(A)
            break
        B *= -1
        B += 1
        if B > 120:
            break

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
x = int(input())

is_true = False
for i in range(100):
    for j in range(-100, 100):
        key = i ** 5 - j ** 5
        if x == key:
            print(i, j)
            is_true = True
            break
    if is_true:
        break

#     key = (i ** 5) - x

#     if key % (5 ** 5) == 0:
#         print(i, key / (5 ** 5))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x=int(input())
import sys
for i in range(-119,118+1):
  for j in range(-118,119+1):
    if i**5-j**5==x:
      print(i,'',j)
      sys.exit()

Submission status: Wrong Answer

Solution code:
# 競プロの数学は高校数学みたいな泥臭いのが多い
# めんどくさがってA,Bの範囲を計算しなかったのが原因
# なんなら大雑把にみて -1000~1000でもいけてる
X = int(input())
for i in range(1000):
    for j in range(1000):
        a = i-500
        b = j-500
        if X == a**5-b**5:
            print(a, end=" ")
            print(b)
            break

Submission status: Wrong Answer

Solution code:
import sys

hoge = []
for i in range(100):
    if i**5 > 10**9:
        hoge.append(i**5)
        break
    hoge.append(i**5)
    
x = int(input())
for i, h_2 in enumerate(hoge):
    for j, h_1 in enumerate(hoge[i:]):
        if (h_1- h_2 == x):
            print(i, hoge.index(h_1))
            sys.exit()
        if (h_1+h_2 == x):
            print(i, - hoge.index(h_1))
            sys.exit()
        if (h_2 - h_1== x):
            print(-i, j)
            sys.exit()
        if (-h_2 - h_1== x):
            print(-i, - hoge.index(h_1))
            sys.exit()

Submission status: Wrong Answer

Solution code:
x=int(input())
import sys
for i in range(-119,118+1):
  for j in range(-118,119+1):
    if i**5-j**5==x:
      print(i,j)
      sys.exit()

Submission status: Wrong Answer

Solution code:
X=int(input())

N=120
for i in range(N):
  for j in range(N):
    if i**5-j**5==X:
      print(i,j)
      break
    elif -i**5-j**5==X:
      print(-i,j)   
      break 
    elif i**5+j**5==X:
      print(i,-j)
      break
    elif -i**5+j**5==X:
      print(-i,j)
      break 
  else:
    continue
  break

Submission status: Wrong Answer

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

for b in range(-1000, 1000):
    tmp = pow(b, 5)
    tmp += x
    a = tmp ** 0.2
    if type(a) == complex:
        continue
    if math.ceil(a) == a and math.floor(a) == a:
        print(int(a), int(b))
        exit()

Submission status: Wrong Answer

Solution code:
import math

x = int(input())

res = {}

for a in range(-200, 200):
    for b in range(-200, 200):
        temp = math.pow(a, 5) - math.pow(b, 5)
        res[temp] = (a, b)

print(res[x])

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
 
X = int(input())

AB_max = 0
abs_X = abs(X)

for i in range(10**9):
  if ( i**5 >= abs_X ):
    AB_max = i
    break

#print(AB_max)

for i in range(0, AB_max+1):
  for j in range(0, AB_max+1):
    
    A = i**5
    B = j**5
    
    if ( A-B==X ):
      print(i,j)
      break
    elif ( A+B==X ):
      print(i,-j)
      break
    elif ( -A-B==X ):
      print(-i,j)
      break
    elif ( -A+B==X ):
      print(-i,-j)
      break
      
  else:
    continue
  break

Submission status: Wrong Answer

Solution code:
X = int(input())
N = 200
for i in range(N):
    for j in range(N):
        if i**5 - j**5 == X:
            print(i, j)
            exit()
        if (-i)**5 - j**5 == X:
            print(i, j)
            exit()
        if i**5 - (-j)**5 == X:
            print(i, j)
            exit()
        if (-i)**5 - (-j)**5 == X:
            print(i, j)
            exit()

Submission status: Wrong Answer

Solution code:
from math import ceil, sqrt
import sys
x = int(input())
# x = a**5 - b**5
# a**5 - b**5 = (a − b)(a**4 + a**3b + a**2b**2 + ab**3 + b**4)
def get_factors(n):
  set_factors = {n}
  q = n
  for i in range(1, ceil(sqrt(n))):
    if q%i == 0:
      set_factors.add(i)
      q = q//i
    if q<=1: return set_factors
  return set_factors
all_factors = get_factors(x)
def test_factor(factor):
  upper = sys.maxsize
  lower = 0
  condition = True
  while condition:
    a = (upper+lower)//2
    if a**5-(a-factor)**5 < x:
      lower = a
    elif a**5-(a-factor)**5 == x:
      return (a, a-factor)
    else:
      upper = a
    condition = upper>lower+1
  return None
for factor in all_factors:
  result = test_factor(factor)
  if result!=None:
    print(result[0], result[1])
    break

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

Solution code:
X = int(input())

for b in range(-10**6, 10**6):
    a5 = abs(b**5 + X)
    a = pow(a5, 1 / 5)

    if a5 < 0:
        a = -a

    if not a.is_integer():
        continue

    a = int(a)
    if a**5 - b**5 == X:
        print(a, b)
        exit()

Submission status: Wrong Answer

Solution code:
x=int(input())
for a in range(-500,500,1):
    for b in range(-500,500,1):
        if x==pow(a,5)-pow(b,5):
            print(a,b)

Submission status: Wrong Answer

Solution code:
n = int(input())
nn = int(pow(n,1/5)) + 1
for i in range(-nn,nn):
    b = pow(i ** 5 - n, -5)
    if type(b) is float:
        if float.is_integer(b):
            break

print(i,int(b))

Submission status: Wrong Answer

Solution code:
X = int(input())
flag = 0
for i in range(-118, 119):
    for j in range(-118, 119):
        if(i ** 5 - j ** 5 == X and flag == 0):
            print(i, j)
            flag += 1

Submission status: Wrong Answer

Solution code:
import sys
import itertools
X = int(input())
N = 100
ABs = []
for i in range(N):
    ABs.append(i**5)
    
for i in range(N):
    for j in range(N):
        if ABs[i]-ABs[j] == X:
            print(i,j)
            sys.exit()
        elif ABs[i]+ABs[j] == X:
            print(i,-j)
            sys.exit()

Submission status: Wrong Answer

Solution code:
a=int(input())
ok=False
for i in range(-120,120):
    for j in range(-120,120):
        if i**5+j**5==a:
            print(i,j)
            ok=True
            break
    if ok:
        break

Submission status: Wrong Answer

Solution code:
x = int(input())

for a in range(10**4):
    for b in range(10**4):
        if(a**5 + b**5 == x):
            print(a, -b)
            break
        elif(a**5 - b**5 == x):
            print(a, b)
            break
    else:
        break

Submission status: Wrong Answer

Solution code:
import sys
import itertools
X = int(input())
N = 10
ABs = []
for i in range(N):
    ABs.append(i**5)
    
for i in range(N):
    for j in range(N):
        if ABs[i]-ABs[j] == X:
            print(i,j)
            sys.exit()
        elif ABs[i]+ABs[j] == X:
            print(i,-j)
            sys.exit()

Submission status: Wrong Answer

Solution code:
x=int(input())
a=0
b=0
for i in range(-500,500):
  for j in range(-100,100):
    if i**5-j**5==x:
      a=i
      b=j
      break
  else:
    continue
  break
print(a,b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())
flg = 0
for i in range(100):
  for j in range(-100, 100):
    a5 = i ** 5
    b5 = j ** 5
    if a5 - b5 == X:
      print('{} {}'.format(i, j))
      flg = 1
  if flg == 1:
    break

Submission status: Wrong Answer

Solution code:
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
 
    if temp!=1:
        arr.append([temp, 1])
 
    if arr==[]:
        arr.append([n, 1])
 
    return arr
X = int(input())
A = []
for i in factorization(X):
  for j in range(0,i[1]+1):
    a = i[0]**j
    b = X//a
    if(a<b):
      A.append([a,b])
    else:
      A.append([b,a])
 
A = list(map(list, set(map(tuple, A))))
flag = 0
for i in A:
  r = list(range(-1000,1000+1))
  for a in r:
    b = a - i[0]
    if a**4 + a**3 * b + a**2 * b**2 + a * b**3 + b**4 == i[1]:
      print(a,b)
      flag = 1
      break
  if flag==1:
    break

Submission status: Wrong Answer

Solution code:

x = int(input())

for i in range(100):
    for j in range(100):
        if pow(i, 5)+pow(j, 5) == x:
            print(i, -j)
            exit()


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


a = 0
for i in make_divisors(x):
    a = i
    b = 0
    while pow(a, 5)-pow(b, 5) < x:
        if pow(a, 5)-pow(b, 5) == x:
            print(a, b)
            exit()
        b += 1
        a += 1

Submission status: Wrong Answer

Solution code:
from math import ceil, sqrt
x = int(input())
# x = a**5 - b**5
# a**5 - b**5 = (a − b)(a**4 + a**3b + a**2b**2 + ab**3 + b**4)
def get_factors(n):
  set_factors = {n}
  q = n
  for i in range(1, ceil(sqrt(n))):
    if q%i == 0:
      set_factors.add(i)
      q = q//i
    if q<=1: return set_factors
  return set_factors
all_factors = get_factors(x)
def test_factor(factor):
  upper = x
  lower = 0
  condition = True
  while condition:
    a = (upper+lower)//2
    if a**5-(a-factor)**5 < x:
      lower = a
    elif a**5-(a-factor)**5 == x:
      return (a, a-factor)
    else:
      upper = a
    condition = upper>lower+1
  return None
for factor in all_factors:
  result = test_factor(factor)
  if result!=None:
    print(result[0], result[1])
    break

Submission status: Wrong Answer

Solution code:
X = int(input())

B = [n**5 for n in range(300)]

A = []

for i in range(300):
    a = i**5- X if i**5 >= X else X-i**5
    A.append(a)

for j in range(300):
    if A[j] in B:
        a = j
        b = B.index(A[j])
        if a**5-b**5 == X:
            print(a,b)
        elif a**+b**5 == X:
            print(a,-b)
        else:
            print(b,a)
        break

Submission status: Wrong Answer

Solution code:
x=int(input())
a=0
b=0
for i in range(-100,100):
  for j in range(-100,100):
    if i**5-j**5==x:
      a=i
      b=j
      break
  else:
    continue
  break
print(a,b)

Submission status: Wrong Answer

Solution code:
#coding: utf-8
from math import ceil, floor
X = int(input())
a = 0
a2 = -a
def sign(v):
    if v < 0:
        return -1
    else:
        return 1
def counter(a):
    v = abs(a)
    for i in range(1, int(v**0.5)+2):
        if v % i == 0:
            if v == i**5:
                return True
    return False
while True:
    a2 = -a
    b = (a**5 - X)
    b2 = (a2**5 - X)
    if counter(b):
        if a**5 - b == X:
            print(a, round(abs(b)**(1/5))*sign(b))
            quit()
    if counter(b2):
        if a2 ** 5 - b2 == X:
            print(a2, round(abs(b)**(1/5))*sign(b2))
            quit()
    a += 1

Submission status: Wrong Answer

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