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: Accepted

Solution code:
#!/usr/bin/env python3

import sys

input = sys.stdin.buffer.readline

x = int(input())


def find(x):
    for a in range(-300, 300):
        for b in range(-300, 300):
            if a ** 5 - b ** 5 == x:
                return [a, b]


a, b = find(x)
print(a, b)

Submission status: Accepted

Solution code:
x=int(input())

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

Submission status: Accepted

Solution code:
x = int(input())

f = False
for a in range(0, 3000):
    for b in range(-3000, 3000):
        if a**5-b**5==x:
            print("{0} {1}".format(a, b))
            f = True
            break
    if f:
        break

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

import sys

input = sys.stdin.buffer.readline

x = int(input())


def find(x):
    for a in range(-300, 300):
        for b in range(-300, 300):
            b = -b
            if a ** 5 - b ** 5 == x:
                return [a, b]


a, b = find(x)
print(a, b)

Submission status: Accepted

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

  def search(x: int) -> (int, int):
    for a in range(-1000, 1001):
      for b in range(-1000, 1001):
        if a ** 5 - b ** 5 == x:
          return (a, b)
    return (-2000, -2000)

  a, b = search(X)
  print(f'{a} {b}')

if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
X=int(input())

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

Submission status: Accepted

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
    else:
        continue
    break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())
d= 10**3
list = [0]*d
for i in range(d):
  list[i] = i**5
for i in range(d):
  for j in range(i,d):
    if list[j]-list[i] == X:
      print(j,i)
      break
    elif list[i]+list[j] == X:
      print(j,-i)
      break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
import sys

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


def main():
    x = ni()
    xmod10 = x%10
    for a in range(-125, 125):
        for b in range(-125, 125):
            if (a-b)%10 == xmod10:
                if pow(a,5) - pow(b,5) == x:
                    print(a,b)
                    return
    print("Erorr")
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def rrange(start, stop, step=1):
    return range(start, stop + 1, step)


X = int(input())

for A in rrange(-118, 119):
    for B in rrange(-118, 119):
        if A**5 - B**5 == X:
            print(A, B)
            exit(0)

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

Solution code:
import sys
X = int(input())
for A in range(-120, 121):
    for B in range(-120, 121):
        if A ** 5 - B ** 5 == X:
            print(*[A, B])
            sys.exit()

Submission status: Accepted

Solution code:
x = int(input())
flag = False
for a in range(-200, 200):
  for b in range(-200, 200):
    n = a**5 - b**5
    if n == x:
      print(f'{a} {b}')
      flag = True
      break
  if flag:
    break

Submission status: Accepted

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)
            exit()

Submission status: Accepted

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

Submission status: Accepted

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

AB_max = 0
abs_X = abs(X)

for i in range(10**9):
  if ( i**5-(i-1)**5 > 10**9 ):
    AB_max = i
    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: Accepted

Solution code:
X = int(input())

for a in range(-500, 500):
  for b in range(-500, 500):
    Y = a ** 5 - b ** 5
    if Y == X:
      A = a
      B = b
      break
      
print(A, B)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

for i in range(-130,131):
  for j in range(-130,131):
    if X == i**5 - j**5:
      print(i,j)
      exit()

Submission status: Accepted

Solution code:
def main():
    x = int(input())
    res = 0
 
    for i in range(-200, 200):
        for j in range(-200, 200):
            if i**5 - j**5 == x:
                res = [i, j]
                break
        if res:
            break
    
    print(res[0], res[1])
                
 
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
x = int(input())
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: Accepted

Solution code:
X = int(input())
lim = 120
for i in range(lim):
    for j in range(-lim, lim):
        if pow(i, 5) - pow(j, 5) == X:
            print(str(i)+" "+str(j))
            exit()

Submission status: Accepted

Solution code:
def check(a, b):
    return pow(a,5) - pow(b,5)

n = int(input())
a = 0
for i in range(0,120):
    for j in range(-119,i):
      if a == 0:
        if n == check(i,j):
          print(i,j)
          a = 1

Submission status: Accepted

Solution code:
def solve():
   x = int(input())
   for a in range(-500,500):
      for b in range(-500,500):
         n = a**5 - b**5
         if n == x:
            print(a,end=" ")
            print(b)
            return
solve()

Submission status: Accepted

Solution code:
import sys

x = int(input())
tmp= 0
a = 0
b = 0

for i in range(-120,120):
    for j in range(-120,120):
        tmp = i**5 - j**5
        if tmp == x:
            print(i,j)
            sys.exit()

Submission status: Accepted

Solution code:
def resolve():
    x = int(input())

    for i in range(150):
        for j in range(-149, 150):
            if i ** 5 - j ** 5 == x:
                print(i, j)
                return
resolve()

Submission status: Accepted

Solution code:
X = int(input())
for A in range(-200,200):
    for B in range(-200,200):
        if pow(A,5)-pow(B,5)==X:
            print(A,B)
            break
    else:
        continue
    break

Submission status: Accepted

Solution code:
def main(x):
  for i in range(-120,120):
    for j in range(-120,120):
      if(i**5-j**5 == int(x)):
        print(str(i)+" "+str(j))
        return
 
if __name__ == '__main__':
  main(input())

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

X = ii()

lim = 10**3
for a in range((-1)*lim, lim+1):
    for b in range((-1)*lim, lim+1):
        if a**5 -b**5 == X:
            print(a, b)
            exit()

Submission status: Accepted

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)
            exit(0)

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
f = True
for i in range(200):
    for j in range(200):
        if f:
            if i > j:
                if i**5 + j**5 == x:
                    print(i,-j)
                    f = False
                    break
                elif i**5 - j**5 == x:
                    print(i,j)
                    f = False
                    break
            else:
                continue
        else:
            break

Submission status: Accepted

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(1000):
    a5.append(i ** 5)

b5 = []
for j in range(1000):
    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" % (a5.index(a), -1 * b5.index(b)))
            sys.exit()

Submission status: Accepted

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)
      exit(0)

Submission status: Accepted

Solution code:
import sys
def f(x):
    N = 1000
    for a in range(-N, N+1):
        A = a**5
        B = A-x
        for j in range(-N, N+1):
            if j ** 5 == B:
                print(a, j)
                return 
x, = map(int, input().split())
f(x)

Submission status: Accepted

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

Submission status: Accepted

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 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: Accepted

Solution code:
X =int(input())
for i in range(-118, 120):
  for j in range(-118, 120):
    if i**5 - j**5 == X:
      ans = "{} {}".format(i,j)
      
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

X = int(input())

def dfs(a, b):
    if (a**5 - b**5) == X:
        print(a, b)
        exit()
    if(a**5 - b**5) > X:
        dfs(a-1, b)
        dfs(a, b-1)
    else:
        dfs(a+1, b)
        dfs(a, b+1)
   
def solve():
    for a in range(-120, 120):
        for b in range(-120, 120):
            if a**5 - b**5 == X:
                print(a, b)
                exit()

#dfs(1, 1)
solve()

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

Solution code:
#!python3

iim = lambda: map(int, input().rstrip().split())

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

    if X == 1:
        print(1, 0)
        return

    ii = 2 if X % 2 else 1

    N = 10**9

    for x in range(1, N, ii):
        if X % x:
            continue
        for i in range(N):
            j = i - x

            ij = i**5 - j**5
            diff = ij - X
            if diff == 0:
                print(i, j)
                return
            elif j > 0 and diff > 0:
                break




if __name__ == "__main__":
    resolve()

Submission status: Accepted

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: Accepted

Solution code:
# Problem D - I hate Factorization

# input
X = int(input())

# count
ans = [0, 0]
for a in range(-500, 500):
    for b in range(-500, 500):
        if a**5 - b**5 == X:
            ans[0] = a
            ans[1] = b
            break

# output
print(" ".join(list(map(str , ans))))

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

Solution code:
x = int(input())

n = 200
a = [i for i in range(-n, n)]
a5 = [pow(i, 5) for i in range(-n, n)]
for i in range(2*n):
    for j in range(2*n):
        if a5[i] - a5[j] == x:
            print(f"{a[i]} {a[j]}")
            exit()

Submission status: Accepted

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,1000):
    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: Accepted

Solution code:
x = int(input())
for a in range(1000):
    for b in range(1000):
        if a**5 - b**5 == x:
            print(f"{a} {b}")
            break
        elif a**5 - (-b)**5 == x:
            print(f"{a} {-b}")
            break
    else:
        continue
    break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

for i in range(10000):
    for j in range(1000):
        if i**5 - j**5 == x:
            print(i,j)
            quit()
            break
        if i**5 - (-j)**5 ==x:
            print(i,-j)
            quit()
            break

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

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,1000):
    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: Accepted

Solution code:
x = int(input())

poypoyo = 'po'
for i in range(10000):
    for j in range(10000):
        if i**5 - j**5 == x:
            print(i,j)
            quit()
            break
        if i**5 - (-j)**5 ==x:
            print(i,-j)
            quit()
            break
        po = 'po'
        poypoyo += po

Submission status: Accepted

Solution code:
x = int(input())

poypoyo = 'po'
for i in range(1000):
    for j in range(1000):
        if i**5 - j**5 == x:
            print(i,j)
            quit()
            break
        if i**5 - (-j)**5 ==x:
            print(i,-j)
            quit()
            break
        po = 'po'
        poypoyo += po

Submission status: Accepted

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]
#r.sort()
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)))
      exit()
    if i+j ==x:
      print("%d -%d" % (int(i**0.2),int(j**0.2)))
      exit()

Submission status: Accepted

Solution code:
X = int(input())
def ans(X):
  for a in range(-118, 120, 1):
    for b in range(-119, 119, 1):
      if a ** 5 - b ** 5 == X:
        return print(a, b)
ans(X)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

Solution code:
import sys

X = int(input())
for i in range(-118, 120):
    for j in range(-119, 119):
        if i ** 5 - j ** 5 == X:
            print(i, j)
            sys.exit(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

x = int(input())
for i in range(-120, 120):
    for j in range(-120, 120):
        if x == (i**5 - j**5):
            print(i, j)
            sys.exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import exit
x = int(input())
for a in range(-200, 201):
	for b in range(-200, 201):
		if a**5 - b**5 == x:
			print(a, b)
			exit()

Submission status: Accepted

Solution code:
X=int(input())

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

Submission status: Accepted

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]
r.sort()
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)))
      exit()
    if i+j ==x:
      print("%d -%d" % (int(i**0.2),int(j**0.2)))
      exit()

Submission status: Accepted

Solution code:
X=int(input())
sig=[[1,1],[1,-1],[-1,1],[-1,-1]]
f=False
for i in range(200):
    for j in range(200):
        for s in sig:
            A=s[0]*i
            B=s[1]*j
            if A**5-B**5==X:
                f=True
                break
        if f:
            break
    if f:
        break
print(A,B)

Submission status: Accepted

Solution code:
X=int(input())
flag=0

for a in range(2**11):
  for b in range(-2**10,2**10):
    if a**5==X+b**5:
      print(str(a),str(b))
      flag=1
      break
  if flag:
    break

Submission status: Accepted

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

Submission status: Accepted

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)
            exit()

Submission status: Accepted

Solution code:
def resolve():
    X = int(input())
    for a in range(-1000, 1000):
        for b in range(-1000, 1000):
            if (a**5 - b**5 == X):
                print(a, b)
                exit()
if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
# 競プロの数学は高校数学みたいな泥臭いのが多い
# めんどくさがってA,Bの範囲を計算しなかったのが原因
# なんなら大雑把にみて -500~500でもいけてる
flag = 0
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)
            flag =  1
            break
    if flag == 1:
        break

Submission status: Accepted

Solution code:
X = int(input())
for a in range(0, 121):
    for b in range(0, 121):
        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: Accepted

Solution code:
x = int(input())

for i in range(-118, 120):
    for j in range(-119,119):
        if (i**5) - (j**5) == x:
            print(f'{i} {j}')
            exit()

Submission status: Accepted

Solution code:
x = int(input())

a = [0] * 400

for i in range(-200, 200):
    a[i+200] = i**5

for i in range(400):
    for j in range(400):
        if a[i] - a[j] == x:
            break
    else:
        continue
    break

i = i - 200
j = j - 200

print("{} {}".format(i, j))

Submission status: Accepted

Solution code:
import sys

def input():
    return sys.stdin.readline().strip()

def main():
    X = int(input())
    for A in range(-118,120):
        for B in range(-119,119):
            if A**5 - B**5 == X:
                print(A,B)
                exit()

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

x = int(input())

for i in range(-118, 119+1):
    for j in range(-119, 118+1):
        if i**5 -  j**5 == x:
            print(i, j)
            sys.exit(0)

Submission status: Accepted

Solution code:
X=int(input())
import sys
for i in range(120):
    for j in range(-120,120):
        if i**5-j**5-X==0:
            print(i,j)
            sys.exit()

Submission status: Accepted

Solution code:
x = int(input())
for b in range(1000):
    for a in range(1000):
        if a ** 5 - b ** 5 == x:
            print('{} {}'.format(a, b))
            exit()
        if (-a) ** 5 - b ** 5 == x:
            print('{} {}'.format(-a, b))
            exit()
        if a ** 5 - (-b) ** 5 == x:
            print('{} {}'.format(a, -b))
            exit()
        if (-a) ** 5 - (-b) ** 5 == x:
            print('{} {}'.format(-a, -b))
            exit()

Submission status: Accepted

Solution code:
X=int(input())

for i in range(-200,200):
    for j in range(-200,200):
        j *= -1
        if X == (i**5-j**5):
            print(i, j)
            exit()

Submission status: Accepted

Solution code:
import sys

X = int(input())

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

Submission status: Accepted

Solution code:
x = int(input())

is_true = False
for i in range(1000):
    for j in range(-1000, 1000):
        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: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())
# = map(int, input().split())
# = list(map(int, input().split()))
A = [i**5 for i in range(200)]
B = [i**5 for i in range(200)]
# = [list(map(int, input().split())) for i in range(N)]

for i in range(200):
    for j in range(200):
        if A[i] + B[j] == X:
            print(int(A[i]**(1/5)), int(B[j]**(1/5)*(-1)))
            exit()
        if A[i] - B[j] == X:
            print(int(A[i]**(1/5)), int(B[j]**(1/5)))
            exit()

Submission status: Accepted

Solution code:
X = int(input())

T = [(e - 150) ** 5 for e in range(300)]

for A in range(300):
  for B in range(300):
    if T[A] - T[B] == X:
      print(f'{A - 150} {B - 150}')
      exit()