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:
def main():
    x = int(input())

    for a in range(-100, 101):
        b = 0
        mi = False
        if a ** 5 - x < 0:
            b = ((a ** 5 - x)*(-1)) ** 0.2
            mi = True

        else:
            b = (a ** 5 - x) ** 0.2

        if b.is_integer():
            b = int(b) * (-1) if mi else int(b)
            print(a, b)
            exit()


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X=int(input())

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

Submission status: Wrong Answer

Solution code:
X = int(input())


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

    # divisors.sort()
    return divisors


div = sorted(make_divisors(X))

# print(div)
if len(div) == 1:
    A_B = 1
else:
    A_B = div[1]
R = X // A_B
# print(R)
# print(make_divisors(R))

for a in range(100):
    if a ** 4 - a ** 3 + a ** 2 - a + 1 == R:
        print(a, -1)
        break

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(10**2):
  b=(i**5-x)**(1/5)
  if is_integer_num(b)==True:
    print(i,int(b))

Submission status: Wrong Answer

Solution code:
x = int(input())
#(a-b)(a**4 + a**3 * b + a**2 * b**2 + a * b**3 + b**4) = x を満たすa,b を出力
i = int(x**(1/5))
for root_range in range(-i,i+1):
    r = x + (root_range**5)
    r_root = r**(1/5)
    if r_root == int(r_root):
        print(int(r_root), root_range)
        break

Submission status: Wrong Answer

Solution code:
import math

x = int(input())

a = 0
a5 = 0
while a5 < x:
    a += 1
    a5 = a**5

a -= 1

print(a**5 - x)

if a**5 - x < 0:
    b = -1 * math.pow(abs(a**5 - x), 1/5)
else:
    b = math.pow(abs(a**5 - x), 1/5)

print(a,int(b))

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[b2],-i)
        break

Submission status: Wrong Answer

Solution code:
X = int(input())
import math,sys
p = int(math.sqrt(X))+1

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

for i in make_divisors(X):
    for j in range(p,-p,-1):
        if i**5 - j**5 ==X:
            print(i,j)
            sys.exit()

Submission status: Wrong Answer

Solution code:
X = int(input())
A = 0
B = 0
answer = 0
while answer != X:
    answer = A ** 5 - B ** 5
    if answer < X:
        A += 1
    if answer > X:
        B -= 1
        A -= 1
    print(A,B,answer)

Submission status: Wrong Answer

Solution code:
x = int(input())


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

Submission status: Wrong Answer

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

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, boundary + 1):
            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()

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)
  if x+b5 in s:
    print(table[x+b5],i)

Submission status: Wrong Answer

Solution code:
X = int(input())

A = int(pow(X,1/5))
B = A**5 - X
 
print(int(A),int(B))

Submission status: Wrong Answer

Solution code:
x = int(input())

root = int(x**(0.2))

flag = 0
for i in range(root - 100, root + 100):
    for j in range(-40, root):
        if i!=j:
            if x%(i-j) == 0:
                if i**5-j**5 == x:
                    print(i, j)
                    flag = 1
                    break
    if flag:
        break

Submission status: Wrong Answer

Solution code:
import sys
X = int(input())
S = int(X ** (1/5) + 1)

for i in range(100):
    for j in range(100):
        a = i ** 2
        b = j ** 2
        c = i * j
        if (i - j) * (a * (a ** 2 + c + b) + b * (c + b)) == X:
            print(i,j)
            sys.exit()
        elif (i + j) * (a * (a ** 2 - c + b) + b * (-c + b)) == X:
            print(i,-j)
            sys.exit()

Submission status: Wrong Answer

Solution code:
import math
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)
K=len(divisors)

AA=0
BB=0
for y in range(0,K):
	KKK=0
	A=0
	while KKK<X:
		A=A+1
		KKK=A**5-(A-divisors[y])**5
	if KKK==X:
		AA=A
		BB=A-divisors[y]
print(AA,BB)

Submission status: Wrong Answer

Solution code:
import math
x=int(input())
end=0
for i in range(1,63):
    check1=int(math.pow( i+1, 5 )*100000)/100000
    check2=int(math.pow(i-1,5)*100000)/100000
    if check2<x<check1:
        m=x
        m=m-pow(i,5)
        if m<0:
            m=-m
            end=1
        b=int(math.pow(m,1/5)*100000)/100000
        out=int(b)
        if out<b<out+1:
            end=0
        if out==b:
            break
if x>pow(i,5):
    out=-out
print(i,end=' ')
print(out)

Submission status: Wrong Answer

Solution code:
X = int(input())

for b in range(X):
    a = X + b ** 5
    a = pow(a, 1.0 / 3.0)
    if a.is_integer():
        A, B = int(a), b
        break
    a = X - b ** 5
    if a < 0:
        continue
    a = pow(a, 1.0 / 3.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())

X_kok = X ** -5
print(4 ** -2)
X_kok_tamsayi = int(X_kok)
# ikisi de 0 dan buyuk

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

Submission status: Wrong Answer

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

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


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

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:
        for i in range(118):
            a = i+d
            b = i
            n = a**5 - b**5
            if n > 10**9:
                break
            if n == x:
                print('{} {}'.format(a,b))

Submission status: Wrong Answer

Solution code:
X = int(input())
N1 = 0
N2 = 0

A = [0] * 100
for i in range(100):
    A[i] = (i-50)**5

for i in range(100):
    for j in range(100):
        if A[i] - A[j] == X:
            N1 = i-50
            N2 = j-50
            break

print(N1,N2)

Submission status: Wrong Answer

Solution code:
X = int(input())

def factorization(n):
    arr = [1]
    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)

    if temp!=1:
        arr.append(temp)

    arr.append(n)

    return arr
    
fact_ls = factorization(X)

flg = False
for f in fact_ls:
    for b in range(-999, 1000):
        a = b + f
        if (a ** 5 - b ** 5) == X:
            A = a
            B = b
            flg = True
            break
    if flg:
        break
else:
    A = 0
    B = 0

print(A, B)

Submission status: Wrong Answer

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

    i = 0
    while True:
        j = i ** 5
        a1, a2 = x + j, x - j

        p = a1 ** (1 / 5)
        if int(p) == p:
            p = int(p)
            print(p, j)
            break
        if a2 >= 0:
            p = a2 ** (1 / 5)
            if int(p) == p:
                p = int(p)
                print(p, -1 * j)
                break
        else:
            p = abs(a2) ** (1 / 5) * -1
            if int(p) == p:
                p = int(p)
                print(p, -1 * j)
                break
        i += 1


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

i = 0
while True:
    a = i
    b = (np.abs(a**5 - x))**(1/5)
    if (a**5-x) < 0 :
        b = -b
    if b.is_integer():
        print(a,int(b))
        break
    
    a = -i
    b = (np.abs(a**5 - x))**(1/5)
    if (a**5-x) < 0 :
        b = -b
    if b.is_integer():
        print(a,int(b))
        break
    i += 1

Submission status: Wrong Answer

Solution code:
x = int(input())
a = 0
b = 0

for a_ in range(3):
    _ = a_**5 - x
    b_ = _**0.2
    if a_**5 - b_**5 ==x:
        a = a_
        b = _
        
print(a, b)

Submission status: Wrong Answer

Solution code:
X = int(input())

#x^5-y^5=(x-y)(x^4+x^3y+x^2y^2+xy^3+y^4)

#for x in range(1, 121):
#  if ((x**5) - ((x-1)**5)) >= 1000000000:
#    print(x)

for a in range(0, 121):
  for b in reversed(range(-122, 120)):
    if b**5 == a**5-X:
      print(a, b)
      break

Submission status: Wrong Answer

Solution code:
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

S = int(input())
l = factorization(S)

if len(l) == 1:
    l.append([0,0])
    f = l[0][0] * l[0][1]
    s = l[1][0] * l[1][1]
    print(f, s)

f = l[0][0]*l[0][1]
s = l[1][0]*l[1][1]


for i in range(-s, s):
    for j in range(-s, s):
        if i - j == f and i**4+i**3*j+i**2*j**2+i*j**3+j**4 == s:
            print(i, j)
            exit()

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
            
            d = X // d
            while (B + d) ** 5  < B ** 5 + X:
                B += 1
            if (B + d) ** 5 == B ** 5 + X:
                print("{} {}".format(B + d, B))
                return



if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
X = int(input())

for a in range(100):
    for b in range(100):
        if a ** 5 - b ** 5 == X:
            print(f"{a} {b}")
            exit()
        elif (-a) ** 5 - b ** 5 == X:
            print(f"{-a} {b}")
            exit()
        elif a ** 5 - (-b) ** 5 == X:
            print(f"{a} {-b}")
            exit()
        elif (-a) ** 5 - (-b) ** 5 == X:
            print(f"{-a} {-b}")
            exit()

Submission status: Wrong Answer

Solution code:
x = int(input())

for i in range(int((x)**(1/5))+1):#c
    for j in range(int((x)**(1/5))+1):#a
        if i**5 + j**5 == x:
            b = -i
            a = j
            print(a,b)
            break
    else:
        continue
    break

Submission status: Wrong Answer

Solution code:
x = int(input())

cands = [(i**5,i) for i in range(-99,100)]

for a,i in cands:
  for b,j in cands:
    if a-b == x:
      print(i,j)
      exit()

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

X = int(read())
A = np.array([pow(i, 5) for i in range(100)])

for i, B_f in enumerate(A):
    for sig in [1, -1]:
        diff = A - (sig * B_f)
        if (diff == X).any():
            A_f = X + (sig * B_f)
            AA = A.tolist().index(A_f)
            B = A.tolist().index(B_f)
            print(AA, sig * B)
            sys.exit()

Submission status: Wrong Answer

Solution code:
def sovle_odd(X):
    max = 50
    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 = 50
    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())
f = [-992436543, -916132832, -844596301, -777600000, -714924299, -656356768, -601692057, -550731776, -503284375, -459165024, -418195493, -380204032, -345025251, -312500000, -282475249, -254803968, -229345007, -205962976, -184528125, -164916224, -147008443, -130691232, -115856201, -102400000, -90224199, -79235168, -69343957, -60466176, -52521875, -45435424, -39135393, -33554432, -28629151, -24300000, -20511149, -17210368, -14348907, -11881376, -9765625, -7962624, -6436343, -5153632, -4084101, -3200000, -2476099, -1889568, -1419857, -1048576, -759375, -537824, -371293, -248832, -161051, -100000, -59049, -32768, -16807, -7776, -3125, -1024, -243, -32, -1, 0, 1, 32, 243, 1024, 3125, 7776, 16807, 32768, 59049, 100000, 161051, 248832, 371293, 537824, 759375, 1048576, 1419857, 1889568, 2476099, 3200000, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176, 69343957, 79235168, 90224199, 102400000, 115856201, 130691232, 147008443, 164916224, 184528125, 205962976, 229345007, 254803968, 282475249, 312500000, 345025251, 380204032, 418195493, 459165024, 503284375, 550731776, 601692057, 656356768, 714924299, 777600000, 844596301, 916132832, 992436543]

for i in range(126):
    for j in range(126):
        if f[i] - f[j] == x:
            print(i - 63, j - 63)
            exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
i = 0
while i**5 < x and (i + 1)**5 < x:
    i += 1
flag = 0
for j in range(i + 1):
    if flag:
        break
    tmp1 = j ** 5
    start, end = 0, x - tmp1
    while start <= end:
        middle = (start + end)//2
        if tmp1 + middle ** 5 > x:
            end = middle - 1
        elif tmp1 + middle ** 5 == x:
            flag = 1
            print(j, -middle)
            break
        else:
            start = middle + 1

Submission status: Wrong Answer

Solution code:
import sys
X = int(input())
S = int(X ** (1/5) + 1)

for i in range(10):
    for j in range(10):
        a = i ** 2
        b = j ** 2
        c = i * j
        if (i - j) * (a * (a ** 2 + c + b) + b * (c + b)) == X:
            print(i,j)
            sys.exit()
        elif (i + j) * (a * (a ** 2 - c + b) + b * (-c + b)) == X:
            print(i,-j)
            sys.exit()

Submission status: Wrong Answer

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

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

else:
    def make_divisors(n):
        divisors = []
        for i in range(2, 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(x)
    for i in l:
        for j in range((i+1)-(i+1)//2+1):
            if j**5 - (-(i-j)) ** 5 == x:
                print(j, -(i-j))
                exit()

Submission status: Wrong Answer

Solution code:
X = int(input())
d = int(X**(1/5))+2	
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(i,j)
      break
    elif list[i]+list[j] == X:
      print(i,-j)
      break

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np

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())
if X == 1:
  print(1,0)
  sys.exit()

tmp = prime_factorize(X)
Xp = tmp[0]
# Xpp = X/Xp
#a_1 = 5
#a_2 = - 10*Xp
#a_3 =  10*Xp*Xp
#a_4 = - 5*Xp*Xp*Xp
#a_5 =  Xp*Xp*Xp*Xp - Xpp

Xpp = X
a_1 = 5*Xp
a_2 = - 10*Xp*Xp
a_3 =  10*Xp*Xp*Xp
a_4 = - 5*Xp*Xp*Xp*Xp
a_5 =  Xp*Xp*Xp*Xp*Xp - Xpp

ANS = np.roots([a_1, a_2, a_3, a_4, a_5])

for ans in ANS:
  if ans.imag == 0.0:
    A = int(ans.real)
    if A == ans.real:
      B = A - Xp
      if A*A*A*A*A - B*B*B*B*B == X:
        print(A,B)
        sys.exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
n = 10*10

def blp(dp,num):
    l = 0
    r = len(dp)-1
    while l <= r:
        mid = (l+r)//2
        if num == dp[mid]:return mid
        elif num >= dp[mid]:l = mid+1
        else:r = mid-1
    return 0

def bln(dp,num):
    l = 0
    r = len(dp)-1
    while l>=r:
        mid = (l+r)//2
        if num == dp[mid]:return mid
        elif num >= dp[mid]:r = mid+1
        else:l = mid-1
    return 0
            
ap = [i**5 for i in range(n)]
an = [-(i**5) for i in range(n)]

for b in range(-n,n):
    num = x + b**5
    a = max(blp(ap,num),bln(an,num))
    if a:print(a,b) ; break

Submission status: Wrong Answer

Solution code:
import math

N = int(input())


B = -1
A = math.pow(N-1, 1/5)



if(int(A)==A):
  print(int(A),B)
else:
  A = -1
  B = math.pow(N-1, 1/5)
  print(A,int(B))

Submission status: Wrong Answer

Solution code:
x = int(input())

lower = -1
upper = -1
for i in range(100000000):
    pow5 = pow(i, 5)
    if lower == -1 and pow5 >= x:
        lower = i - 1

    if lower != -1 and upper == -1 and pow5 - pow(i-1, 5) >= x:
        upper = i
        break

for a in range(lower-1, upper+1):
    a5 = pow(a, 5)
    for b in range(-upper-1, upper+1):
        if a5 - pow(b, 5) == x:
            print(a, b)
            exit(0)

# 0, 0
print(0, 0)

Submission status: Wrong Answer

Solution code:
x=int(input())
ans=0
for A in range(10):
    for B in range(-1,10):
        ans=(A**5)-(B**5)
        if ans==x:
            print(A,B)
        break
    if ans==x:
        break

Submission status: Wrong Answer

Solution code:
x = int(input())
y = []
count1 = 0
flag = 0
for i in range(0, 70):
  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

Submission status: Wrong Answer

Solution code:
x = int(input())
start = int(pow(x,0.2))
for i in range(-start,start+1):
    k = pow(x + pow(i,5),0.2)
    k = round(k,8)
    #print(i,k)
    if pow(int(k),5) - pow(i,5) == x:
        print(int(k),i)
        exit()

Submission status: Wrong Answer

Solution code:
X = int(input())

def factorization(n):
    arr = [1]
    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)

    if temp!=1:
        arr.append(temp)

    arr.append(n)

    return arr
    
fact_ls = factorization(X)

flg = False
for f in fact_ls:
    for b in range(-999, 1000):
        a = b + f
        if (a ** 5 - b ** 5) == X:
            A = a
            B = b
            flg = True
            break
    if flg:
        break
else:
    A = 0
    B = 0

print(fact_ls)
print(A, B)

Submission status: Wrong Answer

Solution code:
X = int(input())

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

for a in range(10000, -10000, -1):
    b = -(X - a**5)**0.2
    # print('b a', b, a)
    if type(b) == complex:
        if b.imag != 0:
            continue
        print(a, int(b.real))
        exit()
    elif b.is_integer():
        print(a, int(b))
        exit()

for b in range(10000, -10000, -1):
    a = (X + b**5)**0.2
    # print('b a', b, a)
    if type(a) == complex:
        if a.imag != 0:
            continue
        print(int(a.real), b)
        exit()
    elif a.is_integer():
        print(int(a), b)
        exit()

Submission status: Wrong Answer

Solution code:
X = int(input())

#x^5-y^5=(x-y)(x^4+x^3y+x^2y^2+xy^3+y^4)

#for x in range(1, 121):
#  if ((x**5) - ((x-1)**5)) >= 1000000000:
#    print(x)

for a in range(0, 121):
  for b in reversed(range(-121, 120)):
    if b**5 == a**5-X:
      print(a, b)
      break

Submission status: Wrong Answer

Solution code:
x = int(input())


def f(a, b):
    return a**4+a**3*b+a**2*b**2+a*b**3+b**4


for a in range(-10**5, 10**5):
    b = a+1
    if f(a, b) == x:
        print(a, b)
        break

Submission status: Wrong Answer

Solution code:
x = int(input())

for i in range(185):
    for j in range(187):
        if ((i-118)**5)-((j-67)**5) == x:
            print(i,j)
            exit()

Submission status: Wrong Answer

Solution code:
X = int(input())
A = [(i**5) for i in range(0, 1000)]
res = []
for i in range(len(A)):
  a = A[i]
  for j in range(len(A)):
    b = -A[j]
    cal = a - b
    if cal == X:
      print(i, -j)
      exit()

Submission status: Wrong Answer

Solution code:
#!python3.8
# -*- coding: utf-8 -*-
# abc166/abc166_d
import sys
import math

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [i2s() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    X = i2n()
    for A in range(0, X+1):
        B_5 = A**5 - X
        if B_5 == 0:
            print(A, 0)
            return
        sign = 1
        if B_5 < 0:
            sign = -1
            B_5 *= -1
        B = B_5**0.2
        if type(B) == float and  B.is_integer():
            print(A, int(sign * B))
            return
    return

main()

Submission status: Wrong Answer

Solution code:
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate, product, combinations_with_replacement
import sys
import bisect
import string
import math
import time


def I(): return int(input())


def S(): return input()


def MI(): return map(int, input().split())


def MS(): return map(str, input().split())


def LI(): return [int(i) for i in input().split()]


def LI_(): return [int(i)-1 for i in input().split()]


def StoI(): return [ord(i)-97 for i in input()]


def ItoS(nn): return chr(nn+97)


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


def debug(table, *args):
    ret = []
    for name, val in table.items():
        if val in args:
            ret.append('{}: {}'.format(name, val))
    print(' | '.join(ret), file=sys.stderr)


yn = {False: 'No', True: 'Yes'}
YN = {False: 'NO', True: 'YES'}
MOD = 10**9+7
inf = float('inf')
IINF = 10**10
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']

show_flg = False
# show_flg = True

def factorization(n):
    if n <= 1:
        return []

    ret = []
    while n > 2 and n % 2 == 0:
        ret.append(2)
        n //= 2
    i = 3
    while i <= math.sqrt(n):
        if n % i == 0:
            ret.append(i)
            n //= i
        else:
            i += 2
    ret.append(n)
    return ret


def main():
    X = I()

    for B in range(-10**6, 10**6):
        T = X + B**5
        V = T ** (1/5)
        # print(V.real, V.imag)
        if V.real.is_integer() and V.imag == 0:
            print(int(T ** (1/5)), B)
            return



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
x = int(input())
n = 10*7

def blp(dp,num):
    l = 0
    r = len(dp)-1
    while l <= r:
        mid = (l+r)//2
        if num == dp[mid]:return mid
        elif num >= dp[mid]:l = mid+1
        else:r = mid-1
    return 0

def bln(dp,num):
    l = 0
    r = len(dp)-1
    while l>=r:
        mid = (l+r)//2
        if num == dp[mid]:return mid
        elif num >= dp[mid]:r = mid+1
        else:l = mid-1
    return 0
            
ap = [i**5 for i in range(n)]
an = [-(i**5) for i in range(n)]

for b in range(-n,n):
    num = x + b**5
    a = max(blp(ap,num),bln(an,num))
    if a:print(a,b) ; break

Submission status: Wrong Answer

Solution code:
x=int(input())
l=[]
for i in range(1,int(x**0.5)+1):
  if x%i==0:
    l.append(i)
    l.append(x//i)
for i in l:
  for j in range(int(x**0.2)+1,0,-1):
    A=j
    B=j-i
    if A<B:
      break
    if A**5-B**5==x:
      print(A,B,sep=' ')
      exit()

Submission status: Wrong Answer

Solution code:
x = int(input())


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

Submission status: Wrong Answer

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))
import math

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 sorted(divisors)



X = ii()
'''
a = make_divisors(X)
ind = bisect.bisect_left(a, X**0.2)

for num in a[:ind+1]:
    for i in range(num):
        j = num - i
        if i**5 + j**5 == X:
            print(i, (-1)*j)
            exit()
'''
num = int(X**0.2)+1
for i in range(num):
    #tmp = i**5
    b = (X - i**5)**0.2
    if math.floor(b) == b:
        print(i, (-1)*int(b))
        exit()