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

Solution (Python):
x=int(input())
d=[]
for i in range(1,int(x**(0.5))+1):
    if x%i==0:
        d.append(i)
        d.append(int(i/x))
for m in d:
    a=0
    f=0
    for b in range(-5*(10)**2,5*(10)**2,1):
        a=m+b
        if a**5-b**5==x:
            print(a,b)
            exit()

Solution (Python):
yes = False

x = int(input())
for i in range(-1000,1000+1):
    for j in range(-1000,1000+1):
        if i**5-j**5 == x:
            print(str(i)+" "+str(j))
            yes = True
            break
    if yes:
        break

Solution (Python):
x = int(input())
OP = [+1, -1]
for a in range(1000):
    for b in range(a + 1):
        for op1 in OP:
            for op2 in OP:
                if (op1 * a)**5 - (op2 * b)**5 == x:
                    print(op1 * a, op2 * b)
                    exit()

Solution (Python):
from itertools import combinations_with_replacement
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

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

    ab = [i**5 for i in range(10**3)]

    C = combinations_with_replacement(ab, 2)
    for a, b in C:
        if a + b == x:
            print(int(pow(b, 0.2)), -int(pow(a, 0.2)))
            break
        
        if b - a == x:
            print(int(pow(b, 0.2)), int(pow(a, 0.2)))
            break


if __name__ == "__main__":
    main()

Solution (Python):
x = int(input())
c = []
d = []

for i in range(-1000,1000):
    a = int(i**5)
    c.append(a)
    d.append(i)

for j in range (len(c)):
    for k in range (len(c)):
        if c[j]-c[k] == x:
            s = str(d[j])
            t = str(d[k])
            break

print(s + ' ' + t)

Solution (Python):
import sys,bisect,string,math,time,functools,random
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
from itertools import permutations,combinations,groupby
def Golf():*a,=map(int,open(0))
def I():return int(input())
def S_():return input()
def IS():return input().split()
def LS():return [i for i in input().split()]
def LI():return [int(i) for i in input().split()]
def LI_():return [int(i)-1 for i in input().split()]
def NI(n):return [int(input()) for i in range(n)]
def NI_(n):return [int(input())-1 for i in range(n)]
def StoLI():return [ord(i)-97 for i in input()]
def ItoS(n):return chr(n+97)
def LtoS(ls):return ''.join([chr(i+97) for i in ls])
def GI(V,E,ls=None,Directed=False,index=1):
    org_inp=[];g=[[] for i in range(V)]
    FromStdin=True if ls==None else False
    for i in range(E):
        if FromStdin:
            inp=LI()
            a,b,c=(inp+[1])[:3]
            org_inp.append(inp)
        else:
            index=0
            a,b,c=(ls[i]+[1])[:3]
        if index==1:a-=1;b-=1
        aa=(a,c);bb=(b,c);g[a].append(bb)
        if not Directed:g[b].append(aa)
    return g,org_inp
def GGI(h,w,search=None,replacement_of_found='.',mp_def={'

    mp=[boundary]*(w+2);found={}
    for i in range(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[boundary]+[mp_def[j] for j in s]+[boundary]
    mp+=[boundary]*(w+2)
    return h+2,w+2,mp,found
def TI(n):return GI(n,n-1)
def bit_combination(k,n=2):
    rt=[]
    for tb in range(n**k):
        s=[tb//(n**bt)%n for bt in range(k)];rt+=[s]
    return rt
def show(*inp,end='\n'):
    if show_flg:print(*inp,end=end)

YN=['YES','NO'];Yn=['Yes','No']
mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase

input=lambda: sys.stdin.readline().rstrip()

class Comb:
    def __init__(self,n,mo=10**9+7):
        self.fac=[0]*(n+1)
        self.inv=[1]*(n+1)
        self.fac[0]=1
        self.fact(n)
        for i in range(1,n+1):
            self.fac[i]=i*self.fac[i-1]%mo
            self.inv[n]*=i
            self.inv[n]%=mo
        self.inv[n]=pow(self.inv[n],mo-2,mo)
        for i in range(1,n):
            self.inv[n-i]=self.inv[n-i+1]*(n-i+1)%mo
        return
    
    def fact(self,n):
        return self.fac[n]
        
    def invf(self,n):
        return self.inv[n]

    def comb(self,x,y):
        if y<0 or y>x:
            return 0
        return self.fac[x]*self.inv[x-y]*self.inv[y]%mo

class Tree:
    def __init__(self,inp_size=None,init=True):
        if init:
            self.stdin(inp_size)
        return

    def stdin(self,inp_size=None):
        if inp_size==None:
            self.size=int(input())
        else:
            self.size=inp_size
        self.edges,_=GI(self.size,self.size-1)
        return
    
    def listin(self,ls):
        self.size=len(ls)+1
        self.edges,_=GI(self.size,self.size-1,ls)
        return

    def __str__(self):
        return  str(self.edges)

    def dfs(self,x,func=lambda prv,nx,dist:prv+dist,root_v=0):
        q=deque()
        q.append(x)
        v=[-1]*self.size
        v[x]=root_v
        while q:
            c=q.pop()
            for nb,d in self.edges[c]:
                if v[nb]==-1:
                    q.append(nb)
                    v[nb]=func(v[c],nb,d)
        return v

    def EulerTour(self,x,func=lambda prv,nx,dist:prv+dist,root_v=0):
        q=deque()
        q.append((-1,x))
        v=[None]*self.size
        v[x]=root_v
        et=[]
        while q:
            cb,ce=q.pop()
            et.append(ce)
            for nb,d in self.edges[ce]:
                if v[nb]==None:
                    q.append((nb,ce))
                    q.append((ce,nb))
                    v[nb]=func(v[ce],nb,d)
        vid=[[-1,-1]for i in range(self.size)]
        for i,j in enumerate(et):
            if vid[j][0]==-1:
                vid[j][0]=i
            else:
                vid[j][1]=i
        return v,et,vid
    
    def LCA_init(self,depth,et):
        self.st=SegTree(self.size*2-1,func=min,ide=inf)
        for i,j in enumerate(et):
            self.st.update(i,j)
        self.LCA_init_stat==True
        return
    
    def LCA(self,root,x,y):
        if self.LCA_init_stat==False:
            depth,et,vid=self.EulerTour(root)
            self.LCA_init(depth,et)
        return self.st.query(x,y+1)



def primeFactor(N):
    i,n=2,N
    ret={}
    d,sq=2,99
    while i<=sq:
        k=0
        while n%i==0:
            n,k,ret[i]=n//i,k+1,k+1
        if k>0 or i==97:
            sq=int(n**(1/2)+0.5)
        if i<4:
            i=i*2-1
        else:
            i,d=i+d,d^6
    if n>1:
        ret[n]=1
    return ret




def PrimeNumSet(N):
    Max = int(N**0.5)
    seachList = [i for i in range(2,N+1)]
    primeNum = []
    while seachList:
        if seachList[0] <= Max:
            break
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    return primeNum



def LCM(b,mo=10**9+7):
    prs=PrimeNumSet(max(b))
    M=dict(zip(prs,[0]*len(prs)))
    for i in b:
        dc=primeFactor(i)
        for j,k in dc.items():
            M[j]=max(M[j],k)
    
    r=1
    for j,k in M.items():
        if k!=0:
            r*=pow(j,k,mo)
            r%=mo
    return r

show_flg=False
show_flg=True

def func(y):
    global x

    for i in range(int(x**0.2)-10**4,int(x**0.2)+10**5):
        if (i)**5-(i-y)**5==x:
            return i,i-y
    
    l,r=0,10**18+1
    while r-l>1:
        mid=(l+r)//2
        
        if (mid+y)**5-mid**5==x:
            return mid+y,mid
        if (mid+y)**5-mid**5>=x:
            r=mid
        else:
            l=mid
    
    l,r=-10**18,0
    while r-l>1:
        mid=(l+r)//2
        
        if (mid+y)**5-mid**5==x:
            return mid+y,mid
        if (mid+y)**5-mid**5>=x:
            l=mid
        else:
            r=mid
        
    return -1


x=I()

for i in range(int(x**0.2)-3,int(x**0.2)+3):
    if i**5==x:
        print(i,0)
        exit()

for i in range(1,int(x**0.5)+1+1):
    if x%i==0:
        
        k=func(i)
        if k==-1:
            0
        else:
            print(*k)
            exit()

        k=func(x//i)
        if k==-1:
            0
        else:
            print(*k)
            exit()

Solution (Python):
X = int(input())
A = 1
while True:
    if X > A ** 5:
        S = X - A ** 5
        B = S ** (1 / 5) * (-1)
    else:
        S = A ** 5 - X
        B = S ** (1 / 5)
    if A ** 5 - int(B) ** 5 == X:
        break
    A += 1
print(A, int(B))

Solution (Python):
X = int(input())
A = 1
while True:
    if X > A ** 5:
        S = X - A ** 5
        B = S ** (1 / 5) * (-1)
    else:
        S = A ** 5 - X
        B = S ** (1 / 5)
    if A ** 5 - int(B) ** 5 == X:
        break
    A += 1
print(A, int(B))

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

Solution (Python):
def main():
    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()


if __name__ == '__main__':
    main()

Solution (Python):
x = int(input())


i = 0
a, b = 0, 0
while i**5 < x:
    i += 1
mx = i
for k in range(2 * (mx + 1)):
    for j in range(-k, k + 1):
        if k**5 - j**5 == x:
            a, b = k, j
print(a, b)

Solution (Python):
X=int(input())

div=[]
for i in range(1, int(X**0.5)+1):
        if X % i == 0:
            div.append(i)
            if i != X // i:
                div.append(X//i)

for k in div:
    x=X//k
    b=(-k)//2
    while True:
        f=((b+k)**5-b**5)//k
        if f==x:
            print(b+k,b)
            exit()
        if f>x:
            
            break
        b-=1
    b=(-k)//2
    while True:
        f=((b+k)**5-b**5)//k
        if f==x:
            print(b+k,b)
            exit()
        if f>x:
            
            break
        b+=1

Solution (Python):
x=int(input())
a=[]
for i in range(220):
  a.append(i**5)
for i in range(220):
  y=a[i]-x
  if y in a:
    print(i,a.index(y))
    break
  elif -y in a:
    print(i,-a.index(-y))
    break

Solution (Python):
import math
X = int(input())

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

    divisors.sort()
    return divisors
    
divisors = make_divisors(X)
ans_A = 0
ans_B = 0
break_loop = False
for n in divisors:
    if X % 5 == n % 5:
        if X - n ** 5 != 0:
            B_cand = make_divisors(abs(X - n ** 5))
            for B in B_cand:
                A = B + n
                if A ** 5 - B ** 5 == X:
                    ans_A = A
                    ans_B = B
                    break_loop = True
                    break
                B = -B
                A = B + n
                if A ** 5 - B ** 5 == X:
                    ans_A = A
                    ans_B = B
                    break_loop = True
                    break
        else:
            ans_A = 0
            ans_B = -n
            break_loop = True
            break
    if break_loop:
        break

print(ans_A, ans_B)

Solution (Python):


x = int(input())

a = int(x**(1/5))
b = int(abs(x-a**5)**(1/5))
i = 1
while True:
    if a**5 - b**5 != x and a**5 - (-b)**5 != x:
        if a**5 - x > (a+1)**5 - x:
            a += i
            b = int(abs(x-a**5)**(1/5))
            if a**5 - b**5 == x:
                print(a,b)
                break
            elif a**5 - (-b)**5 == x:
                print(a,-b)
                break
            else:
                pass
        else:
            a -= 1
            b = int(abs(x-a**5)**(1/5))
            if a**5 - b**5 == x:
                print(a,b)
                break
            elif a**5 - (-b)**5 == x:
                print(a,-b)
                break
            else:
                pass
    elif a**5 - b**5 == x:
        print(a,b)
        break

    else:
        print(a,-b)
        break

Solution (Python):
X = int(input())

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

Solution (Python):
x = int(input())
for a in range(10**3):
    for b in range(10**3):
        if (a**5 - b**5 == x):
            print(a, b)
            exit()
        elif (-a**5 - b**5 == x):
            print(-a, b)
            exit()
        elif (a**5 + b**5 == x):
            print(a, -b)
            exit()
        elif -a**5 + b**5 == x:
            print(-a, -b)
            exit()

Solution (Python):
def main():
  from itertools import combinations
  x = int(input())
  ls = [0]
  a = 0
  b = 0
  if x == 1:
    print(0, -1)
    exit()
  for i in range(1, 200):
    ls.append(i**5)
    ls.append(-i**5)
  ls.sort()
  for b in ls:
    if x + b in ls:
      a = x + b  
      break
  if a < 0:
    print(-1*int(pow(-a, 0.2)), end=' ')
  else:
    print(int(pow(a, 0.2)), end=' ')
  if b < 0:
    print(-1*int(pow(-b, 0.2)), end=' ')
  else:
    print(int(pow(b, 0.2)), end=' ')
  


if __name__ == '__main__':
  main()

Solution (Python):
import math

l = []
ans = []
x = int(input())

a = int( (x) ** (1/5) )

for i in range(a - 1000, a + 1000):
    l.append(i)

for i in range(1,len(l)):
    for j in range(len(l)):
        tmp = math.pow(l[j],5) - math.pow(l[i],5)
        if tmp == x:
            print(l[j],l[i])
            break
    else:
        continue
    break

Solution (Python):
x = int(input())

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

    divisors.sort()
    return divisors

ans = None
d_ls = make_divisors(x)
for d in d_ls:
    for a in range(0, 1000):
        b = a-d
        c = a**5-b**5
        if c==x:
          ans = (a, b)
          break
    if ans is not None:
      break
print(ans[0], ans[1])

Solution (Python):
import collections
X = int(input())

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

Solution (Python):
X=int(input())
import sys

for a in range(10**6):
    A=a**5
    if A-X>=0:
        l,r=max(a-119,0),a
        for b in range(10):
            m=(l+r)//2
            B=m**5
            if A-B-X>0:
                l=m
            elif A-B-X<0:
                r=m
            else:
                print(a,m)
                sys.exit()
    else:
        l,r=0,64
        for b in range(10):
            m=(l+r)//2
            B=m**5
            if A+B-X>0:
                r=m
            elif A+B-X<0:
                l=m
            else:
                print(a,-m)
                sys.exit()

Solution (Python):
def ff(n):
    if(n==0): return [0]
    if(n==1): return [1]
    ans=set([1,n])
    i=2
    while(i*i<=n):
        if(n%i==0):
            ans.add(n//i)
            ans.add(i)
        i+=1
    return ans

x=int(input())
fx=ff(abs(x))
A=-1000000
B=-1000000
for f in fx:
    if(A!=-1000000 and B!=1000000): break
    for i in range(-10000,10000):
        b,a=i,i+f
        z=a**5-b**5
        if(z==abs(x)):
            A=a
            B=b
            break
if(x<0): A,B=B,A
print(A,B)

Solution (Python):
X = int(input())
L = list()
i = 0
while True:
    if i ** 5 > 10 ** 11:
        break
    L.append(i ** 5)
    i += 1
flag = False
ret = ''
for i in range(len(L)):
    if flag:
        break
    for j in range(i+1, len(L)):
        if L[j] - L[i] == X :
            ret ='{} {}'.format(j,i)
            flag = True
            break
        if L[j] + L[i] == X :
            ret ='{} {}'.format(j,-i)
            flag = True
            break
print(ret)

Solution (Python):
import itertools

X = int(input())
nums = []
for i in range(121):
  nums.append(i**5)

comb = itertools.combinations(nums, 2)
ans = 0

for c in comb:
  a,b = c
  if c[0]+c[1] == X:
    print(int(a**(1/5)),int(-b**(1/5)))
  elif -c[0]+c[1] == X:
    print(int(-a**(1/5)),int(-b**(1/5)))
  elif c[0]-c[1] == X:
    print(int(a**(1/5)),int(b**(1/5)))
  elif -c[0]-c[1] == X:
    print(int(-a**(1/5)),int(b**(1/5)))

Solution (Python):
import math

X = int(input())

def decompose(n):
	result = []
	half = math.floor(math.sqrt(n))
	i = 2
	while i <= half:
		if n % i == 0:
			result.append(i)
			n //= i
			half = math.floor(math.sqrt(n))
		else:
			i += 1
	if n > 1:
		result.append(n)
	return result

facts = decompose(X)

fact_table = {}
for f in facts:
	if f not in fact_table:
		fact_table[f] = 1
	else:
		fact_table[f] += 1

facts = list(fact_table.items())
facts.sort()

def bisearch_smallest(f, s, e = None):
	if e == None:
		e = s - 1
		s = 0
	else:
		e -= 1
	
	while s < e:
		m = (s + e) // 2
		if f(m):
			e = m
		else:
			s = m + 1
	
	if s == e and f(s):
		return s
	else:
		return -1

def find(num, n):
	if n >= len(facts):
		m = bisearch_smallest(lambda A: 5 * A ** 4 - 5 * (A - num) ** 4 >= 0, 0, 10 ** 9)
		i = bisearch_smallest(lambda A: A ** 5 - (A - num) ** 5 <= X, 0, m + 1)
		j = bisearch_smallest(lambda A: A ** 5 - (A - num) ** 5 >= X, m - 1, 10 ** 9)
		
		if i ** 5 - (i - num) ** 5 == X:
			return i, i - num
		if j ** 5 - (j - num) ** 5 == X:
			return j, j - num
	else:
		f, c = facts[n]
		for i in range(c + 1):
			ret = find(num, n + 1)
			if ret != None:
				return ret
			num *= f
	return None

A, B = find(1, 0)


print(A, B)

Solution (Python):
from __future__ import print_function

import sys
sys.setrecursionlimit(500000)

import re
import array
import copy
import functools
import operator

import math
import string
import fractions
from fractions import Fraction

import collections
import itertools
import bisect

import random
import time

import heapq
from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace
from queue import PriorityQueue as pq
from queue import Queue

from itertools import accumulate

from collections import deque
from collections import Counter

from operator import mul
from functools import reduce

input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return


















def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom

def check(a,b,x):
    a=round(a)
    return a**5 - b**5 == x

def fifthroot(n):
    for i in range(int(n**(1/5)+1)) :
        if i**5==n:
            return i
    return -1

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

        
        
        
        
        
    
    
    for a in range(1,10**9):
        if x - a**5 < 0:
            break
        
        b=fifthroot(x - a**5)
        if b!=-1:
            eprint("b<0")
            print(a,-int(b))
            return

    for b in range(1,10**9):
        if fifthroot(x + b**5)!=-1:
            eprint("b>=0")
            a=fifthroot(x + b**5)
            print(a,b)
            return

if __name__ == '__main__':
    main()

Solution (Python):
import numpy as np

n=1000
X = int(input())

a = np.array(range(n))
ex = np.full(n, 5)

m = a*n+a.reshape(n,1)

b = np.power(a, ex)

plus = b + b.reshape(n,1)
minus = b - b.reshape(n,1)

plus = plus==X
minus = minus==X

if np.count_nonzero(plus):
  c = m[plus][0]
  ans = int(c/n), -int(c%n)
else:
  c = m[minus][0]
  ans = int(c/n), int(c%n)
  
print(ans[0], ans[1], sep=' ')

Solution (Python):


def main():
    x = int(input())
    for i in range(1000):
        for j in range(0, i+1):
            y = i ** 5 - j ** 5
            z = i ** 5 + j ** 5
            if x == y:
                a = i
                b = j
                break
            elif x == z:
                a = i
                b = -j
                break
    print(a, b)


if __name__ == '__main__':
    main()

Solution (Python):


import numpy


def abc166(X):
    B = 0


    while True:
        
        B = -B
        A5 = X + B ** 5
        A = int(numpy.sign(A5) * numpy.power(numpy.abs(1.0 * A5), 1/5))

        if A5 == A ** 5:
            break

        
        B = -B
        A5 = X + B ** 5
        A5 = X + B ** 5
        A = int(numpy.sign(A5) * numpy.power(numpy.abs(1.0 * A5), 1/5))

        if A5 == A ** 5:
            break

        B += 1

    
    print(A, B)

if __name__ == '__main__':
    
    
    
    
    X = int(input())
    abc166(X)

Solution (Python):
x = int(input())
for a in range(1,1001):
    for b in range(-1001, 1001):
        if a**5 - b**5 == x:
            print("{} {}".format(a,b))
            exit()

Solution (Python):
X = int(input())
temp = []
N = 200
for i in range(-N, N):
    temp.append(i**5)

ok = []
flag = False


for i in range(2 * N):
    if flag:
        break
    for j in range(2 * N):
        if flag:
            break
        if temp[i] + temp[j] == X:
            ok = [temp[i], temp[j]]
            flag = True


ans = [0, 0]
mai = 1
if ok[0] == 0:
    ans[0] = 0
else:
    if ok[0] < 0:
        mai = -1
        ok[0] *= -1
    ans[0] = int(ok[0]**0.2)
    ans[0] = ans[0] * mai * -1

mai = 1
if ok[1] == 0:
    ans[1] = 0
else:
    if ok[1] < 0:
        mai = -1
        ok[1] *= -1
    ans[1] = int(ok[1]**0.2)
    ans[1] *= mai

print(str(ans[1]) + " " + str(ans[0]))

Solution (Python):
from collections import defaultdict as dd
from sys import exit
from operator import mul
from functools import reduce


x = int(input())
X = x

if x == 1:
    print(0, -1)
    exit()

dic = dd(int)
for i in range(2, int(x**0.5) + 3):
    while x % i == 0:
        x //= i
        dic[i] += 1
if x != 1:
    dic[x] = 1



def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom

def serch(dif):
    target = X // dif
    for b in range(-1000, 1000):
        if 5 * b**4 + 10 * dif * b**3 + 10 * dif**2 * b**2 + 5 * dif**3 * b + dif**4 == target:
            print(-(b), -b-dif)
            exit()
    return None

pattern = [1]
for key in dic.keys():
    temp = []
    for num in range(dic[key] + 1):
        for i in pattern:
            temp.append(i * key**num)
    pattern = temp


for num in pattern:
    serch(num)



"""
b = -1
dif = 3
print(5 * b**4 + 10 * dif * b**3 + 10 * dif**2 * b**2 + 5 * dif**3 * b + dif**4)
"""

Solution (Python):
import numpy as np
x=int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors
d=make_divisors(x)
for i in range(len(d)):
  d.append(-d[i])
flag=False

for i in d:
  if flag==True:
    break
  tui=x//i
  ans=np.roots([5,10*i,10*i**2,5*i**3,i**4-tui])
  for j in ans:
    if flag==True:
      break
    if j.imag==0:
      a=i+round(j.real)
    if a**5-(round(j.real))**5==x:
      print(int(a),int(round(j.real)))
      flag=True
      break

Solution (Python):
X = int(input())
for a in range(0, 10**3):
    for b in range(0, 10**3):
        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()

Solution (Python):
x = int(input())
y = []
count1 = 0
flag = 0
for i in range(0, 130):
  y.append(i*i*i*i*i)
for i in y:
  if i == x:
    print("0 -" + str(count1))
    flag = 1
    break;
  count1 += 1
count1 = 0
for i in y:
  if flag == 1:
    break;
  count2 = 0
  for j in y[:count1]:
    y2 = i + j
    y3 = i - j
    if y2 == x:
      print(str(count1) + " -" + str(count2))
      flag = 1
      break;
    if y3 == x:
      print(str(count1) + " " + str(count2))
      flag = 1
      break;
    count2 +=1
  count1 += 1

Solution (Python):
x = int(input())
for a in range(10**3):
    for b in range(10**3):
        if a**5 - b**5 == x:
            print(a, b)
            exit()
        if a**5 + b**5 == x:
            print(a, -b)
            exit()

Solution (Python):
from math import floor,ceil,sqrt
import fractions
import collections
import itertools
from collections import deque
X=int(input())
l=[]
for i in range(1,ceil(sqrt(X))+1):
    if X%i==0:
        l.append(i)
        l.append(X//i)
l=list(set(l))
l2=l
for i in range(len(l)):
    l2.append(-l[i])

"""
for i in l:
    y=X//i
    print(i,y)
    if 60*y-35*pow(i,4)>=0:
        x=60*y-35*pow(i,4)
        print(sqrt(x))
        if sqrt(60*y-35*pow(i,4)).is_integer()==True:
            print(-10*pow(i,2)+sqrt(60*y-35*pow(i,4)))
            print(-10 * pow(i, 2) - sqrt(60 * y - 35 * pow(i, 4)))
            if (-10*pow(i,2)+sqrt(60*y-35*pow(i,4)))%15==0:
                ab=(-10*pow(i,2)+sqrt(60*y-35*pow(i,4)))//15
                if pow(i,2)-4*ab>=0:
                    if (-i+sqrt(pow(i,2)-4*ab)).is_integer()==True:
                        if (-i+sqrt(pow(i,2)-4*ab))%2==0:
                            b=(-i+sqrt(pow(i,2)-4*ab))//2
                            a=i-b
                            print(int(a),int(b))
                            break
                    elif (-i-sqrt(pow(i,2)-4*ab)).is_integer()==True:
                        if (-i-sqrt(pow(i,2)-4*ab))%2==0:
                            b=(-i-sqrt(pow(i,2)-4*ab))//2
                            a=i-b
                            print(int(a),int(b))
                            break
            elif (-10*pow(i,2)-sqrt(60*y-35*pow(i,4)))%15==0:
                ab=(-10*pow(i,2)-sqrt(60*y-35*pow(i,4)))//15
                if pow(i,2)-4*ab>=0:
                    if (-i+sqrt(pow(i,2)-4*ab)).is_integer()==True:
                        if (-i+sqrt(pow(i,2)-4*ab))%2==0:
                            b=(-i+sqrt(pow(i,2)-4*ab))//2
                            a=i-b
                            print(int(a),int(b))
                            break
                    elif (-i-sqrt(pow(i,2)-4*ab)).is_integer()==True:
                        if (-i-sqrt(pow(i,2)-4*ab))%2==0:
                            b=(-i-sqrt(pow(i,2)-4*ab))//2
                            a=i-b
                            print(int(a),int(b))
                            break
"""
l2.sort()
if len(l)!=0:
    for i in l2:
        x=X//i
        
        n=(x-pow(i,4))/(pow(i,2)+1)
        
        if (5*pow(i,4)+20*x)>=0:
            if sqrt((5*pow(i,4)+20*x)).is_integer()==True:
                
                m=int(sqrt((5*pow(i,4)+20*x)))
                if (-5*i*i+m)%10==0:
                    y=(-5*i*i+m)//10
                    
                    if pow(i,2)+4*y>=0:
                        if sqrt(pow(i,2)+4*y).is_integer()==True:
                            z=int(sqrt(pow(i,2)+4*y))
                            if (-i+z)%2==0:
                                b=(-i+z)//2
                                a=i+b
                                print(a,b)
                                break
                            elif (-i - z) % 2 == 0:
                                b = (-i - z) // 2
                                a = i + b
                                print(a, b)
                                break
                elif (-5*i*i-m)%10==0:
                    y=(-5*i*i+m)//10
                    
                    if pow(i,2)+4*y>=0:
                        if sqrt(pow(i,2)+4*y).is_integer()==True:
                            z=int(sqrt(pow(i,2)+4*y))
                            if (-i+z)%2==0:
                                b=(-i+z)//2
                                a=i+b
                                print(a,b)
                                break
                            elif (-i - z) % 2 == 0:
                                b = (-i - z) // 2
                                a = i + b
                                print(a, b)
                                break

Solution (Python):
X = int(input())
Ahashtable = {}
Bhashtable = {}
i = 0

while True:
    x = i ** 5
    Ahashtable[x - X] = i
    Bhashtable[x + X] = i
    Bhashtable[-x + X] = -i
    if x in Ahashtable:
        print(Ahashtable[x], i)
        break
    if -x in Ahashtable:
        print(Ahashtable[-x], -i)
        break
    if x in Bhashtable:
        print(i, Bhashtable[x])
        break
    if -x in Bhashtable:
        print(i, Bhashtable[-x])
        break
    i += 1

Solution (Python):


import sys
import math

DEBUG = False

def read(t):
    return t(sys.stdin.readline().rstrip())


def read_list(t, sep = " "):
    return [t(s) for s in sys.stdin.readline().rstrip().split(sep)]


def dprint(*args, **kwargs):
    if DEBUG:
        print(*args, **kwargs)
    return

def enumerate_factor(x):
    i = 1
    factors = []
    while i * i <= x:
        if x % i == 0:
            factors.append(i)
            if x // i != i:
                factors.append(x // i)
        i += 1
    return factors

def main():
    x = read(int)
    
    boundary = math.ceil(math.pow(x, 1/5))
    for factor in enumerate_factor(x):
        f = math.ceil(math.pow(factor, 1/5))
        for b in range(-boundary * 10, boundary * 10):
            a = b + factor
            if a**5 - b**5 == x:
                print(f"{a} {b}")
                return
            a = b - factor
            if a**5 - b**5 == x:
                print(f"{a} {b}")
                return

if __name__ == "__main__":
    main()

Solution (Python):
import sys
x = int(input())
divisors = []
for i in range(1, int(x**0.5)+1):
    if x % i == 0:
        divisors.append(i)
        if i != x // i:
            divisors.append(x//i)
for j in divisors:
  for a in range(10000):
    b = a - j
    if a * a * a * a * a - b * b * b * b * b == x:
      print(a, b)
      sys.exit(0)