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,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={'#':1,'.':0},boundary=1):
#h,w,g,sg=GGI(h,w,search=['S','G'],replacement_of_found='.',mp_def={'#':1,'.':0}) # sample usage
    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
#sys.setrecursionlimit(10**7)
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)

## return prime factors of N as dictionary {prime p:power of p}
## within 2 sec for N = 2*10**20+7
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


## return the list of prime numbers in [2,N], using eratosthenes sieve
## within 2sec for N = 1.2*10**7
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

## retrun LCM of numbers in list b
## within 2sec for no of B = 10*5  and  Bi < 10**6
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
#    show('d',y)
    for i in range(int(x**0.2)-3,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
        #show((l,r),(mid+y,mid),(mid+y)**5-mid**5)
        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
        #show((l,r),(mid+y,mid),(mid+y)**5-mid**5)
        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)
        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#continue
        else:
            print(*k)
            exit()

Submission status: Wrong Answer

Solution code:
X = int(input())


lst = []

i = 0
v = 0
while v <= X:
    v = pow(i, 5)
    lst.append((v, i))
    lst.append((-v, -i))
    i += 1


for a, i in lst:
    for b, j in lst:
        if a - b == X:
            print(i, j)
            exit()

Submission status: Wrong Answer

Solution code:
import math

X = int(input())

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

if X == 1:
    print('0 -1')
    exit()

# X >= 2
L = factorization(X)
# print(L)

# seq = []
# for f, n in L:
#     seq.extend([f] * n)

m = math.floor(X ** (1/5))
for f, n in L:
    a = m
    b = a - f
    while b >= -m:
        if a ** 5 - b ** 5 == X:
            print('{} {}'.format(a, b))
            exit()
        a -= 1
        b -= 1

Submission status: Wrong Answer

Solution code:
import math

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

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

for i in range(a - 100, a + 100):
    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

Submission status: Wrong Answer

Solution code:
X=int(input())

def judgef(n):
    if n>0:
        a=n**(0.2)
        b=int(n**(0.2))
    else:
        n=0-n
        a=n**(0.2)
        b=int(a**(0.2))
    if abs(a-b)<0.00000000000001:
        return True
    else:
        return False

B=0

while True:
    C=X+B**5
    D=X-B**5
    if judgef(C):
        A=C**(0.2)
        break
    elif judgef(D):
        A=C**(0.2)
        B=0-B
        break
    B+=1

print(int(A),'',B)

Submission status: Wrong Answer

Solution code:
X=int(input())
ans1=0
ans2=0
for a in range(-(10*9),10*9):
    for b in range(-(10*9),-10*9):
        if a**5-b**5==X:
            ans1=a
            ans2=b
            break
print(ans1,ans2)

Submission status: Wrong Answer

Solution code:
a = int(input())
for i in range(-1,1000,1):
    for j in range(-1,1000,1):
        if a == ((i**5) - (j**5)):
            print(i, j)
            break;
    else:
        continue
    break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())

AA = 0
BB = 0

for A in range(200):
    for B in range(200):
        if X == (A ** 5) - (B ** 5):
            AA = A
            BB = B

if AA == 0 and BB == 0:
    for A in range(200):
        if X == (A ** 5) + 1:
            AA = A
            BB = -1

print(AA,BB)

Submission status: Wrong Answer

Solution code:
X = int(input())
A = -10
B = -10
for A in range(-10, 100):
    for B in range(-10, 100):
        if(A ** 5) - (B ** 5) != X:
            continue
        print(A, B)
        break

Submission status: Wrong Answer

Solution code:
import math

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True
    
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
    
x=int(input())

if is_prime(x):
    for i in range(118):
        a = i+1
        b = i
        n = a**5 - b**5
        if n == x:
            print('{} {}'.format(a,b))

else:
    divisors = make_divisors(x)
    for d in divisors:
        #print(d)
        for i in range(-20,118):
            a = i+d
            b = i
            n = a**5 - b**5
            #print(i, n)
            if n == x:
                print('{} {}'.format(a,b))
                import sys
                sys.exit()
            if n > 10**9:
                break

Submission status: Wrong Answer

Solution code:
x=int(input())
a = int( x**(1/5) )
b = int( x**(1/5) )
for i in range(-10**3,10**3):
    for j in range(-10**2,10**2):
        if (a+i)**5-(b+j)**5==x:
            print(a+i,b+j)
            exit()

Submission status: Wrong Answer

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

X = int(readline().rstrip())

# Bがマイナスの場合
lim = int(X ** 0.2) + 1
for A in range(0, lim):
    for B in range(0, lim):
        v = (A ** 5) + (B ** 5)
        if v == X:  
            print(A, -B)
            exit()

# Bががプラスの場合
for A in range(0, X+1):
    B5 = (A ** 5) - X
    B = B5 ** 0.2
    if B.real.is_integer():
        print(A, int(B))
        exit()

Submission status: Wrong Answer

Solution code:
x = int(input())

a = int(x**(1/5))
b = -150

flag = 0
if flag == 0:
    for i in range(a,a+300):
        for j in range(b,b+300):
            if i**5 - j**5 == x:
                print(i,j)
                flag = 1
                break

if flag == 0:
    b = 0
    for i in range(a,a-300):
        for j in range(b,b-300):
            if i**5 - j**5 == x:
                print(i,j)
                break

Submission status: Wrong Answer

Solution code:
from math import pow
X = int(input())
print(int(pow(X-1, 1.0/5.0)), -1)

Submission status: Wrong Answer

Solution code:
x = int(input())
ans_i = 0
ans_j = 0
for i in range(-100, 100):
    j = -100
    while x > j ** 5:
        if i ** 5 - j ** 5 == x:
            ans_i = i
            ans_j = j
            j = x + 1
            break
        else:
            j += 1
print(ans_i, ans_j)

Submission status: Wrong Answer

Solution code:
x = int(input())
import math
def is_prime(n):
    if n == 1:
        return True
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
if is_prime(x) == True:
    i = 0
    while True:
        if (i + 1) ** 5 - i ** 5 == x:
            ans = [i + 1, i]
            break
else:
    l = prime_factorize(x)
    l = list(set(l))
    k = 0
    ans = 0

Submission status: Wrong Answer

Solution code:
x = int(input())

a = (x - 1) ** (1 / 5)
if a.is_integer():
    print(int(a), -1)

a = (x + 1) ** (1 / 5)
if a.is_integer():
    print(int(a), -1)

Submission status: Wrong Answer

Solution code:
X=int(input())

def ans():
  for x in range(-10,20):
    for y in range(-10,20):
      if X==(x**5-y**5):
         print('{} {}'.format(x,y))
         return x,y
      
ans()

Submission status: Wrong Answer

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

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
a = [0]*60
b = [0]*61
for i in range(-60,0):
    a[i+60]=i**5
for i in range(0,61):
    b[i]=i**5
    
ans =[0]*2
X=int(input())
for i in range(60):
    for j in range(61):
        if b[j] - a[i] == X:
            ans[0] = j
            ans[1] = i-60
            print(*ans)
            sys.exit()
for i in range(60):
    for j in range(61):
        if b[j] + a[i] == X:
            ans[0] = j
            ans[1] = i-60
            print(*ans)
            sys.exit()
for i in range(61):
    for j in range(61):
        if b[j] - b[i] == X:
            ans[0] = j-60
            ans[1] = i-60
            print(*ans)
            sys.exit()
for i in range(60):
    for j in range(60):
        if a[j] - a[i] == X:
            ans[0] = j
            ans[1] = i
            print(*ans)
            sys.exit()

Submission status: Wrong Answer

Solution code:
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 i in divisors:
    for a in range(divisors[len(divisors)//2]):
        b=a-i
        if a**4+(a**3)*b+(a**2)*(b**2)+a*(b**3)+b**4==x/i:
            print(str(a)+" "+str(b))
            exit()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
n = int(input())
list_5 = []
a = 0
b = 0
for _ in range(-100,100):
    list_5.append(_**5)
for i in range(-100,100):
    if (n + list_5[i]) in list_5:
        b = i  
        a = list_5.index(n + list_5[i])
print(a-100, b-100)

Submission status: Wrong Answer

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

A=int(X**(1/5))
Bp=0
Bm=0
B=(A**5-X)

print(A,B)

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
a = round(math.pow(x,1/5))
a_five = a**5
if a_five-x < 0:
    b = int(math.pow((a_five-x)*-1,1/5))
    b *= -1
else:
    b = int(math.pow(a_five-x,1/5))
print(a)
print(b)

Submission status: Wrong Answer

Solution code:
def fifthRoot(y):
  yy=y
  s=1
  if y<0:
    yy=-y
    s=-1
  l=0
  r=yy
  while True:
    m=(l+r)//2
    if l**5==yy:
      return s*l
    if r**5==yy:
      return s*r
    if m**5==yy:
      return s*m
    if m**5>yy:
      r=m
    else:
      l=m
    if l==m or r==m:
      return
def main():
  x=int(input())
  for i in range(10**9):
    y=fifthRoot(x-i**5)
    print(i,x-i**5,y)
    if y is not None:
      return (i,-y)
    y=fifthRoot(x+i**5)
    print(-i,x+i**5,y)
    if y is not None:
      return (-i,-y)
print(*main())

Submission status: Wrong Answer

Solution code:
import math
from itertools import combinations as c
x=int(input())
if x==1:
    print("0 -1")
else:
    ans=int(math.log(x)/math.log(5))
    c=list(c(range(1,ans+1),2))
    count=0
    for i,j in c:
        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

Submission status: Wrong Answer

Solution code:
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a


n = int(input())
A = [1] + prime_factorize(n) + [n]
# print(A)
k = len(A)

a = 1
b = 1
for elem in A:
    for a in range(elem):
        b = a - elem
        if a**4 + a**3 * b + a**2 * b**2 + a * b**3 + b**4 == n / elem:
            print(a, b)
            break

Submission status: Wrong Answer

Solution code:
x = int(input())
for a in range(-1000,1001):
    b = int(pow(a,5))+x
    if b<0:
        continue
    b = pow(b,1/5)
    if b==int(b):
        if int(pow(a,5) - int(pow(b,5))) == x:
            print(a,int(b))
        else:
            print(int(b),a)
        break

Submission status: Wrong Answer

Solution code:
x = int(input())

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


for number in factorization(x):
  for a in range(number[0]**number[1]):
    b = a - number[0]
    if a**5 - b**5 == x:
      print(a,b)
      break
    elif a**5 - (-b)**5==x:
      print(a,-b)
      break

Submission status: Wrong Answer

Solution code:

x=int(input())
value=0
index=0
hashmap=dict()
while value<int(1e9)+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))
#    print(b1,b2)
    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:
x=int(input())
List=[]

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

A,B=0,0
Flag=0
for i in range(1,int(x**0.5)+1):
    if (x%i==0):
        List=make_divisors(i)
        for j in List:
            if ((j+i)**5-j**5==x):
                B=j
                A=B+i
                Flag=1
                break
            if ((-j+i)**5+j**5==x):
                B=-j
                A=B+i
                Flag=1
                break
        if (Flag==1):
            break
            
print(A,B)

Submission status: Wrong Answer

Solution code:
import itertools

X = int(input())
nums = []
for i in range(12):
  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)))

Submission status: Wrong Answer

Solution code:
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(i,j)
            flag = True
            break
        if L[j] + L[i] == X :
            ret ='{} {}'.format(-i,j)
            flag = True
            break
print(ret)

Submission status: Wrong Answer

Solution code:
x=int(input())
n=int(10**9**(1/5))
gojou=[0]*(n+1)
for i in range(n+1):
    gojou[i]=i**5

for i in range(n+1):
    for j in range(n+1):
        if gojou[i]-gojou[j]==x:
            print(i,j)
            break
        elif gojou[i]+gojou[j]==x:
            if i**5 - (-j)**5 == x:
                print(i,-j)
                break
    else:
        continue
    break

Submission status: Wrong Answer

Solution code:


def sovle_odd(X):
    max = 1000
    for A in range(1,max, 2):
        for B in range(max):
            AX = A*A*A*A*A
            BX = B*B*B*B*B

            C = AX-BX
            #if AX-BX == X:
            if C == X:
                print(A, B)
                return
            #if BX-AX == X:
            if -C == X:
                print(B, A)
                return
            C = -AX - BX
            #if -AX - BX:
            if C == X:
                print(-A, B)
                return
            #if AX + BX:
            if -C == X:
                print(A, -B)
                return

def solve_even(X):
    max = 2000
    for A in range(0,max, 2):
        for B in range(0, max, 2):
            AX = A*A*A*A*A
            BX = B*B*B*B*B

            C = AX-BX
            if C == X:
                print(A,B)
                return
            elif -C == X:
                print(B,A)
                return
            
            C = -AX - BX
            if C==X:
                print(-A,B)
                return
            elif -C==X:
                print(A, -B)
                return

def solve():
    X = int(input())
    
    if X%2==1: # X odd case
        sovle_odd(X)
    else: # X even case
        solve_even(X)

solve()

Submission status: Wrong Answer

Solution code:
X=int(input())
for B in range(-10**5,10**5):
    if type((X+B**5)**0.2)!=complex:
        if (X+B**5)**0.2==int((X+B**5)**0.2):
            print(int((X+B**5)**0.2), B)
            break

Submission status: Wrong Answer

Solution code:
def test2(x):
    t = int(pow((x//2),0.2))
    if(pow(t,5) == x//2):
        print(t,-t)
        return()
    else:
        j = -int(pow(x,0.2))
        i = int(pow((x + pow(j,5)),0.2))

        print(i,j)
        return()
# for i in range(1,100000):
#     test(i)
#     test2(i)


x = int(input())
test2(x)

Submission status: Wrong Answer

Solution code:
a = int(input())
for i in range(-10,1000,2):
    for j in range(-10,1000,3):
        if a == ((i**5) - (j**5)):
            print(i, j)
            break;
    else:
        continue
    break

Submission status: Wrong Answer

Solution code:
def pow1(x, n):
    if n == 0: return 1
    value = pow1(x, int(n / 2))
    value *= value
    if n % 2 == 1: value *= x
    return value
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

X = int(input())
a=prime_factorize(X)
for j in range(len(a)):
    for i in range (20000):
        if pow1(i-6000,5)-pow1(i-6000-a[j],5)==X:
            ans1=i-6000
            ans2=i-6000-a[j]
            print(ans1,ans2)
            break

Submission status: Wrong Answer

Solution code:
X = int(input())

for b in range(X):
    a = X + b ** 5
    a = pow(a, 1.0 / 5.0)
    if a.is_integer():
        A, B = int(a), b
        break
    a = X - b ** 5
    if a < 0:
        a = -a
        a = pow(a, 1.0 / 5.0)
        if a.is_integer():
            A, B = int(-a), -b
    else:
        a = pow(a, 1.0 / 5.0)
        if a.is_integer():
            A, B = int(a), -b

if X == 1:
    print(1, 0)
else:
    print(A, B)

Submission status: Wrong Answer

Solution code:
X = int(input())
A = -10
B = -10
for A in range(-10, 100):
    for B in range(-10, 100):
        if(A ** 5) - (B ** 5) != X:
            continue
        print(A, B)
        break
    break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())

for i in range(-X,X):
    B = i ** 5 -X
    if B < 0:
        C = (-B) ** (1/5)
        flg = 1
    else:
        C = B ** (1/5)
        flg = 0
    if C.is_integer():
        if flg == 0:
            print(i,int(C))
            exit()
        else:
            print(i,-int(C))
            exit()

Submission status: Wrong Answer

Solution code:
x=int(input())
a=0
b=0
for i in range(-x,x):
  for j in range(i,x):
    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())

A=[]
B=[]

for i in range(64):
    A.append(X+(i+1)**5)
    B.append(X-(i+1)**5)

ans1=0
ans2=0

for i in range(65):
    if i**5 in A:
        ans1=i+1
        ans2=A.index(i**5)
        break
    elif i**5 in B:
        ans1=i+1
        ans2=-B.index(i**5)
        break

print(ans1,ans2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
from math import ceil, sqrt
def input(): return sys.stdin.readline().strip()


def main():
    X = int(input())
    x = int(X ** (1/5))
    if x == X ** (1/5):
        print("{} {}".format(x, 0))
        return
    
    for B in range(1, x + 1):
        A = (X - B**5) ** (1/5)
        if A < B: break
        if int(A) == A:
            print("{} {}".format(int(A), -B))
            return
    
    y = sqrt(X)
    if int(y) == y:
        upper = int(y) + 1
    else:
        upper = ceil(y)

    for d in range(1, upper):
        #print("d={}".format(d))
        if X % d == 0:
            B = 1
            while (B + d) ** 5  < B ** 5 + X:
                B += 1
            if (B + d) ** 5 == B ** 5 + X:
                print("{} {}".format(B + d, B))
                return
            
            e = X // d
            while (B + e) ** 5  < B ** 5 + X:
                B += 1
            if (B + e) ** 5 == B ** 5 + X:
                print("{} {}".format(B + e, B))
                return



if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
s = set()
table= {}
for i in range(100):
  s.add(i**5)
  table[i**5] = i
 
x = int(input())
for i in range(100):
  b5 = i**5
  if x-b5 in s:
    print(table[x-b5],-i)
    break
  if x+b5 in s:
    print(table[x+b5],i)
    break

Submission status: Wrong Answer

Solution code:
X=int(input())

def judgef(n):
    if n>0:
        a=n**(0.2)
        b=int(n**(0.2))
    else:
        n=0-n
        a=n**(0.2)
        b=int(a**(0.2))
    if abs(a-b)<0.0000000001:
        return True
    else:
        return False

B=0

while True:
    C=X+B**5
    D=X-B**5
    if judgef(C):
        A=C**(0.2)
        break
    elif judgef(D):
        A=C**(0.2)
        B=0-B
        break
    B+=1

print(int(A),'',B)

Submission status: Wrong Answer

Solution code:
import math
from collections import Counter
x = int(input())
import math
from collections import Counter
y = x
prime = [x]
prime_count = Counter()
for i in range(2, math.ceil(math.sqrt(x))+1):
  while x % i == 0:
    x /= i
    prime_count[i] += 1
if x > 1:
  prime_count[int(x)] += 1

prime += [k for k in prime_count.keys()]
prime += [1]
prime = list(set(prime))

for i in range(len(prime)):
  for j in range(len(prime)):
    if (prime[i]+prime[j]) % 2 == 0 and (prime[i]-prime[j])%2==0:
      a = (prime[i]+prime[j]) // 2
      b = ((prime[i]-prime[j])) // 2
    if pow(a, 5) - pow(b, 5) == y:
      print(a, b)
      break

Submission status: Wrong Answer

Solution code:
import math

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

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

for i in range(a - 50, a + 50):
    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

Submission status: Wrong Answer

Solution code:
n=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
l=make_divisors(n)

print(l)
aa=0
bb=0
for i in range(len(l)):
    ll=l[i]
    t=0
    a=0
    while t==0:
        if a**5-(a-ll)**5==n:
            t=2
            aa=a
            bb=a-ll

        elif a>ll and a**5-(a-ll)**5>n:
            t=1

        a+=1

print(str(aa)+" "+str(bb))

Submission status: Wrong Answer

Solution code:
x=int(input())

def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False

for i in range(-10000,10000):
  b=(i**5-x)**(1/5)
  if is_integer_num(b)==True:
    print(i,int(b))
    break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def ff(n):
    if(n==0): return [0]
    if(n==1): return [1]
    ans=set([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)

Submission status: Wrong Answer

Solution code:
X = int(input())

i = 0
y = 0
S = [0]
a = 0
b = 0

while y == 0:
  i = i + 1
  S.append(i**5)
  if abs(S[i-1]-X) <= abs(S[i]-X):
    y = 1
  
for j in range(len(S)):
  if S[i-1] - S[j] == X:
    a = i-1
    b = j
  if S[i-1] + S[j] == X:
    a = i-1
    b = -j

print(a,b)