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:
from itertools import combinations
import numpy as np
X = int(input())
if X == 0:
    print(1, 1)

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

def judge(a, b):
    right = a ** 4 + a ** 3 * b + a ** 2 * b ** 2 + a * b ** 3 + b ** 4
    # print(a, b, a-b, right)
    if (a - b) * right == X:
        return True
    else:
        return False

prime = prime_factorize(X)
cand = []
for r in range(1, len(prime)):
    for i in list(combinations(prime, r)):
        tmp = np.prod(np.array(list(i)))
        if tmp * tmp <= X:
            cand.append(tmp)
cand = set(cand)

for c in cand:
    for a in range(-c, c + 1)[::-1]:
        b = a - c
        if judge(a, b):
            print(a, b)
            exit()

Submission status: Wrong Answer

Solution code:
X = int(input())

# for b in range(65, -64, -1):
for b in range(100000, -100000, -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:
import sys
X=int(input())
Y=int(X**(1/5))
for i in range(Y,((-1)*Y)-1,-1):
  for j in range(Y,((-1)*Y)-1,-1):
    print(i,j)
    if (i**5)-(j**5)==X:
      print(i,j)
      sys.exit()

Submission status: Wrong Answer

Solution code:
import math

x = int(input())

end = math.floor(x**0.2)

for i in range(1, x+1):
    if x % i == 0:
        for a in range(i//2,end,1):
            b = a - i
            if a**5 - b**5 == x:
                print(a, b)
                break

Submission status: Wrong Answer

Solution code:
X = int(input())
res = [0,0]
f = int(pow(X,1/4))

for B in range(-1*abs(f), abs(f)+1):
  A = pow(B**5 + X, 1/5)
  if type(A) == complex:
    continue
  if A == int(A):
    res[0] = int(A)
    res[1] = B
    break
print(res[0],res[1])

Submission status: Wrong Answer

Solution code:
X = int(input())
for a in range(X):
    b = (a**5-X)
    if b >= 0:
        if b**(1/5) == int(b**(1/5)):
            c = b**(1/5)
            if c**5 == b:
                print(a,b)
                exit()
    else:
        b = -1*b
        if b**(1/5) == int(b**(1/5)):
            c = b**(1/5)
            if c**5 == b:
                print(a,-1*b)
                exit()

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

Solution code:
x = int(input())
n = int((10**9)**(1/5))
for a in range(n+10):
    for b in range(n+10):
        if a**5 - b**5 == x: 
            print(a, b)
            exit()
        elif a**5 + b**5 == x:
            print(a, -b)
            exit()
print('error')

Submission status: Wrong Answer

Solution code:
X=int(input())

def ok(B):
    i=1
    B=abs(B)
    while i**5<B:
        i+=1
    return i



A_cand=[]
i=0
while i**5<=10**9:
    A_cand.append(i)
    i+=1

#print(A_cand)
for a in A_cand:
    B_5=a**5-X
    r=ok(B_5)
    if r==abs(B_5):
        print(a,r*(-1 if B_5<0 else 1))
        break

Submission status: Wrong Answer

Solution code:
X = int(input())

def search(x):
    for a in range(1000):
        for b in range(1000):
            a5 = a**5
            b5 = b**5
            if (a5 - b5 == X):
                print(a, b)
                return
            elif (a5 + b5 == X): 
                print(a, -b)
                return
            elif (-a5 + b5 == X):
                print(-a, b)
                return

search(X)

Submission status: Wrong Answer

Solution code:
X = int(input())
A = 0
B = 0

while True:
    B = A**5 - X
    B = abs(B**0.2)
    if isinstance(B, float) and B.is_integer():
        B=int(B)
        break
    A += 1
if A**5-B**5==X:
    print(A,B)
else:
    print(A,-B)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys


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(sys.stdin.readline().rstrip())
divs = make_divisors(X)
for d in divs:
    a = d - 1
    b = -1
    if a ** 5 - b ** 5 == X:
        print(a, b)
        sys.exit()

Submission status: Wrong Answer

Solution code:
X = int(input())

A = 0
B = 0

f = 0

for i in range(200):
    A = -100 + i
    
    if f == 1:
        break
    
    for j in range(200):
        B = -100 + j
        n = A**5 - B**5
        
        if n == X:
            print(A, end=' ')
            print(B)
            f = 1
            break

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import numpy as np
X = int(input())

ans = ""
for i in range(200):
    temp = i ** 5 - X
    if i < temp:
        continue
    else:
        temp_pn = temp // abs(temp)
        if (abs(temp) ** (1 / 5)) % 1 == 0:
            ans = "{} {}".format(i, int(temp_pn * (abs(temp) ** (1 / 5))))
            break
print(ans)

Submission status: Wrong Answer

Solution code:
import math
x=int(input())
for i in range(10**9):
    a=math.pow(x+i,1.0/5.0)
    if a.is_integer()==True:
        print(i,int(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
li = factorization(x)
for i in range(-1000,1000):
    for j in range(i+1,1000):
        for (a,b) in li:
            if j-i == a:
                if j**5-i**5 == abs(x):
                    if x >= 0:
                        print(j,i)
                        exit()
                    else:
                        print(i,j)
                        exit()

Submission status: Wrong Answer

Solution code:
X = int(input())

# for b in range(65, -64, -1):
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())
if x % 2 == 0:
    print(2, 0)
else:
    print(x // 2, -1)

Submission status: Wrong Answer

Solution code:
x = int(input())

flag = False
for a in range(-100, 100):
    for b in range(-100, 100):
        if a ** 5 - b ** 5 == x:
            flag = True
            print(str(a) + " " + str(b))
            break
    if flag:
        break

Submission status: Wrong Answer

Solution code:
x = int(input())

l = []
for i in range(10 ** 9):
    if i ** 5 <= 10 ** 10:
        l.append(i ** 5)
        l.append(-i ** 5)
    else:
        break

for i in range(len(l) - 1):
    for j in range(i, len(l)):
        if l[i] - l[j] == x:
            print(l[i], l[j])
            exit()

Submission status: Wrong Answer

Solution code:
import sys
X = int(input())
# = map(int, input().split())
# = list(map(int, input().split()))
# = [int(input()) for i in range(N)]
# = [list(map(int, input().split())) for i in range(N)]

for i in range(100):
    if i**5 == X:
        print(i, 0)
        sys.exit()

    elif i**5<X:
        underX = i**5
        answerunder = i
    else:
        overX = i**5
        answerover = i
        break

if (X-underX)**(1/5)%1 == 0:
    print(answerunder, int((X-underX)**(1/5)*(-1)))

elif (overX-X)**(1/5)%1 == 0:
    print(answerover, int((overX-X)**(1/5)))

Submission status: Wrong Answer

Solution code:
import sys
X = int(input())
for a in range(-100, 101):
    for b in range(-100, 101):
        if a**5 - b**5 == X:
            print(a, b)
            sys.exit()

Submission status: Wrong Answer

Solution code:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections

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

x = int(input())
a = prime_factorize(x)
li = []
for i in range(-int(x**(1/5))-1,int(x**(1/5))+1):
    li.append(i)
for i in range(len(li)):
    for j in range(len(li)):
        if li[i]**5 - li[j]**5 == x:
            print(li[i],li[j])
            sys.exit()

Submission status: Wrong Answer

Solution code:
x=int(input())
a=int(pow(x, 0.2))
b=-1*int(pow(x-a**5, 5))
print(a, b)

Submission status: Wrong Answer

Solution code:
mod = 10**9+7
import sys
from collections import Counter, defaultdict, deque
from itertools import product, permutations, combinations, combinations_with_replacement
from itertools import accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from math import ceil,floor
from copy import deepcopy
from heapq import heappop,heappush,heapify
import heapq


# l = ['a', 'a', 'a', 'a', 'b', 'c', 'c']
# c = Counter(l)

# d = defaultdict(int)

sys.setrecursionlimit(10 ** 6)

int1 = lambda x: int(x) - 1

# リストの要素を改行を挟んで表示する
p2D = lambda x: print(*x, sep="\n")
# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())

def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())

# 入力全てを整数に変換したものの配列を受け取る
# def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LI(): return list(map(lambda x:int(x), sys.stdin.readline().split()))
def HI(): return list(map(lambda x:int(x)*(-1), sys.stdin.readline().split()))

x = II()
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 = make_divisors(x)
tmp = []
for l in div:
	print(l)
	tmp.append(-1*l)
div += tmp
p = 0
a = None
b = None
while(1):
	for l in div:
		s = p**5 - (p-l)**5
		# print(s)
		if s ==x:
			a=p
			b=p-l
		elif s==(-x):
			b=p-l
			a=p
	if a is not None:
		break
	p += 1
print(a,b)

Submission status: Wrong Answer

Solution code:
#coding: utf-8

import sys

X = int(input())

powers = {}
num = 0
while True:
    powered = pow(num, 5)
    powers[num] = powered
    if powered >= X:
        break
    num += 1
for a in range(num, 0, -1):
    for b in range(0, num):
        poweredA = powers[a]
        poweredB = powers[b]
        if poweredA - poweredB == X:
            print(a, b)
            sys.exit()
        elif poweredA + poweredB == X:
            print(a, -b)
            sys.exit()

Submission status: Wrong Answer

Solution code:
from bisect import bisect_right
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

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

    A = [i**5 for i in range(10**6)]
    for b in A:
        a = x + b
        idx = bisect_right(A, a) - 1
        if A[idx] == a:
            print(int(pow(a, 0.2)), b)
            break
        
        a = x - b
        idx = bisect_right(A, a) - 1
        if A[idx] == a:
            print(int(pow(a, 0.2)), -b)
            break


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math
def main():
    x = int(input())
    tmp = [0] * 71
    for i in range(71):
        tmp[i] = i**5
    for i in range(71):
        a = x+tmp[i]
        if abs(a) in tmp:

            print(int(a**0.2),i)
            return

        a = x - tmp[i]
        if abs(a) in tmp:

            print(int(a**0.2),-i)
            return
            
if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())

res = []
x = n
y = 2
while y*y <= x:
    while x % y == 0:
        res.append(y)
        x //= y
    y += 1
if x > 1:
    res.append(x)

if res:
    for i in range(int(n**.2)+1):
        for j in range(int(n**.2)+1):
            if i - j == res[0]:
                print(i, j)
                exit()
            if i + j == res[0]:
                print(i, -j)
                exit()
else:
    print(1, 0)

Submission status: Wrong Answer

Solution code:
X=int(input())

def ok(B):
    i=1
    B=abs(B)
    while i**5<B:
        i+=1
    return i



A_cand=[]
i=0
while i**5<=X:
    A_cand.append(i)
    i+=1

#print(A_cand)
for a in A_cand:
    B_5=a**5-X
    r=ok(B_5)
    if r==abs(B_5):
        print(a,r*(-1 if B_5<0 else 1))
        break

Submission status: Wrong Answer

Solution code:
from math import pow
from itertools import combinations
x = int(input())

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

def func(a, b):
    return pow(b, 4) + (a * pow(b, 3)) + (pow(a, 2) * pow(b, 2)) + (pow(a, 3) * b) + pow(a, 4)
    
cands = prime_factorize(x) + [1]
ok = False
for c in combinations(cands, len(cands)-1):
    y = 1
    for i in c:
        y *= i
    for a in range(1, y + 1):
        b = a - y
        f = func(a, b)
        if (a - b) * f == x:
            print(a, b)
            ok = True
            break
    if ok:
        break

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
from math import gcd
import time
import sys
from collections import Counter
import itertools
import math
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
start = time.time()
# N, M = map(int, input().split(' '))
X = int(input())

gojou = []
i = 0
saidai = 10**10

while 1:
    temp = i**5
    if temp > saidai:
        break
    gojou.insert(0, [i, temp])
    gojou.insert(0, [i, -temp])
    i += 1

ls = len(gojou)
for i in range(ls):
    for j in range(i, ls):
        if gojou[i][1]-gojou[j][1] == X:
            print(gojou[i][0], gojou[j][0])
            exit()

Submission status: Wrong Answer

Solution code:
# input
X = int( input() )
maxA = 100
pow5 = list()
for aa in range(maxA):
    pow5.append( aa**5 )
    
# calc    
ans = False
for ii in range(maxA):  
    if( ans==False ):
        X1 = X - pow5[ii]
        X2 = X + pow5[ii]
        if( X1 in pow5 ):
            b = - ii
            a = pow5.index( X1 )
            ans = True
        
    if( ans==False ):
        if( X2 in pow5 ):
            b = ii
            a = pow5.index( X2 )
            ans = True

# out
if(ans):
    print( str(a)+' '+str(b) )

Submission status: Wrong Answer

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
import numpy
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
# 約数列挙
def find_divisor(n):
    divisors=[]
    for i in range(1, int(sqrt(n)) + 1):
        if n % i == 0:
            divisors.append(i)
            if i*i!=n:
                divisors.append(n // i)
    return divisors


def main():
    X=I()
    for C in find_divisor(X):
        X_ = X//C
        B = numpy.roots([5,10*C,10*C*C,5*C*C*C,C*C*C*C,-X_])
        B=int(B[0].real)
        A=B+C
        if(A**5-B**5==X):
            print(A,B)
            return 

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import itertools

X = int(input())

u = -64
A = []
while u < 65:
    A.append(u)
    u += 1
AA = list((itertools.product(A, repeat=2)))
for a,b in AA:
    if a**5-b**5 == X:
        print(a,b)
        break

Submission status: Wrong Answer

Solution code:
x = int(input())
print(x // 2)
if x % 2 == 0:
    print(2, 0)
else:
    print(x // 2, -1)

Submission status: Wrong Answer

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

t = np.arange(-100000, 100000, 1)
t = t**2
S = set(t)

for B in range(-100000, 100001, 1):
    if X+B**5 in S:
        print("%d %d"%((X+B**5)**0.2, B))
        break

Submission status: Wrong Answer

Solution code:
from sys import stdin

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

def fn(a, x):
    return 5*a*(a**3 - 2*x*a**2 +2*(x**2)*a - x**3)

X =  int(stdin.readline().rstrip())
factors = factorization(X)

combi = []
combination = 1
for i in range(len(factors)):
    combi.append(factors[i][1])
    combination*=combi[i]+1

aa = [0 for _ in range(len(factors))]
candidate_list = []
for i in range(combination):
    candidate = 1
    for j in range(len(factors)):
        candidate *= factors[j][0]**aa[j]
    candidate_list.append(candidate)

    temp_pos = len(aa)-1

    while(True):
        aa[temp_pos] += 1
        if aa[temp_pos] > combi[temp_pos]:
            aa[temp_pos] = 0
            temp_pos -=1
            continue
        elif temp_pos==0 and aa[temp_pos] > combi[temp_pos] :
            break
        else:
            break




for i in range(len(candidate_list)):
    # 5A(A**3 )
    x = candidate_list[i]
    a=1
    check = (float(X)/float(x) - x**4)**0.25 
    if (float(X)/float(x) - x**4)<=0:
        check=-1
    flag=0
    while(True):
        if fn(a,x) == X/x - x**4:
            flag=1
            print(a, a-x)
            break
        if (a**3 > x**3*2) and check < a:
            break
        a+=1
    if flag==1:
        break
        
print("1 1")

Submission status: Wrong Answer

Solution code:
x = int(input())
a = int((x ** (1/5)))
f = True
if a ** 5 == x:
    print(' '.join([str(a // 1), '0']))
    f = False
b = a
if f:
    while b >= -a:
        if (a ** 5) - (b ** 5) == x:
            print(' '.join([str(a // 1), str(b // 1)]))
            break
        else:
            b -= 1

Submission status: Wrong Answer

Solution code:
x = int(input())

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

pfs = prime_factorize(x)

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

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

Submission status: Wrong Answer

Solution code:
x = int(input())
for i in range(1, 200):
    resid = i ** 5 - x
    for j in range(-200, 200):
        if j**5 == resid:
            print(i, j)
            break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())

for d in range(1, int(x**0.5)+1):
    if x % d == 0:
        for a in range(0,d+1):
            b = a - d
            if a**4 + (a**3)*b + (a**2)*(b**2) + a*(b**3) + b**4 == x/d:
                print(a, b)
                break

Submission status: Wrong Answer

Solution code:
def solve(x):

    b = -100
    a = -1
    while a**5 - b**5 != x:
        a += 1
        b = -100
        while b < 100 :
            if x + b **5 == a**5:
                break
            else:
                b += 1

    return a, b

if __name__ == "__main__":
    x = int(input())
    print(solve(x))

Submission status: Wrong Answer

Solution code:
x = int(input())

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

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

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

# 0, 0
print(0, 0)

Submission status: Wrong Answer

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

for i in range(1000):
    for j in range(1000):
        if i**5 + j**5 ==x:
            print(i,end=" ")
            print(-j)
            sys.exit()

Submission status: Wrong Answer

Solution code:
X = int(input())

for i in range(100001):
    for j in range(100001):
        if i**5 + j**5 ==X:
            x=max(i,j)
            y=min(i,j)
            print(x, y)
            exit()
        if i**5 - j**5 ==X:
            x=max(i,j)
            y=min(i,j)
            print(x, y)
            exit()

Submission status: Wrong Answer

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

i = 0
while True:
    n = abs(i**5 - X)**(1/5)
    if n.is_integer():
        if (i**5 - X) < 0:
            n *= -1
        print(i,int(n))
        break
    i += 1

Submission status: Wrong Answer

Solution code:
from math import pow
from itertools import combinations
x = int(input())

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

def func(a, b):
    return pow(b, 4) + (a * pow(b, 3)) + (pow(a, 2) * pow(b, 2)) + (pow(a, 3) * b) + pow(a, 4)
    
cands = prime_factorize(x) + [1]
ok = False
for c in combinations(cands, min(1, len(cands)-1)):
    y = 1
    for i in c:
        y *= i
    for a in range(1, y + 1):
        b = a - y
        f = func(a, b)
        if (a - b) * f == x:
            print(a, b)
            ok = True
            break
    if ok:
        break

Submission status: Wrong Answer

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

t = np.arange(-100000, 100000, 1)
t = t**2
S = set(t)

for B in range(-100000, 100001, 1):
    if X+B**5 in S:
        print("%d %d"%((X+B**5)**0.2, B))

Submission status: Wrong Answer

Solution code:
mod = 10**9+7
import sys
from collections import Counter, defaultdict, deque
from itertools import product, permutations, combinations, combinations_with_replacement
from itertools import accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from math import ceil,floor
from copy import deepcopy
from heapq import heappop,heappush,heapify
import heapq


# l = ['a', 'a', 'a', 'a', 'b', 'c', 'c']
# c = Counter(l)

# d = defaultdict(int)

sys.setrecursionlimit(10 ** 6)

int1 = lambda x: int(x) - 1

# リストの要素を改行を挟んで表示する
p2D = lambda x: print(*x, sep="\n")
# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())

def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())

# 入力全てを整数に変換したものの配列を受け取る
# def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LI(): return list(map(lambda x:int(x), sys.stdin.readline().split()))
def HI(): return list(map(lambda x:int(x)*(-1), sys.stdin.readline().split()))

x = II()
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 = make_divisors(x)
tmp = []
for l in div:
	print(l)
	tmp.append(-1*l)
div += tmp
p = 0
a = None
b = None
while(1):
	for l in div:
		s = p**5 - (p-l)**5
		# print(s)
		if s ==x:
			a=p
			b=p-l
		elif s==(-x):
			b=l-p
			a=-p
	if a is not None:
		break
	p += 1
print(a,b)

Submission status: Wrong Answer

Solution code:
import sys
import math
sys.setrecursionlimit(10**9)

def main():
    X = int(input())
    for b in range(-10000,10000):
        a = pow(X+b**5,1/5)
        if a.imag == 0:
            a = a.real
            if a.is_integer():
                if int(a**5) - b**5 == X:
                    print(int(a),b)
                    exit()



if __name__ == "__main__":
  main()

Submission status: Wrong Answer

Solution code:
x=int(input())
d={}
for i in range(65):
    b=i**5
    c=(-i)**5
    d[b]=i
    d[c]=-i
for i in range(70):
    y=x+i**5
    try:
        print(d[y],i)
        break
    except:
        None
    z=x-i**5
    try:
        print(d[z],-i)
        break
    except:
        None

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())
for i in range(100):
    for k in range(100):
        if i**5 + k ** 5 == X:
            print("{} {}".format(i,k*-1))
            quit()
        elif i**5 - k**5 == X:
            print("{} {}".format(i,k))
            quit()

Submission status: Wrong Answer

Solution code:
X = int(input())
if X == 0:
    print(0,0)
    exit()
for i in range(0,10100):
    for j in range(0,10100):
        if i!=j and X % abs(i-j) == 0:
            if i**5 - j**5 ==X:
                print(i,j)
                exit()
            if i**5 + j**5 ==X:
                print(i,-j)
                exit()
            if - i**5 - j**5 ==X:
                print(-i,-j)
                exit()

Submission status: Wrong Answer

Solution code:
x = int(input())
for a in range(int(x**(0.2))+1):
  if a**5 >= x:
    b = (a**5 -x)**(0.2)
  else:
    b = -(x-a**5)**(0.2)
  if b == int(b):
    print(a,int(b))
    exit()

Submission status: Wrong Answer

Solution code:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections

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

x = int(input())
a = prime_factorize(x)
li = []
for i in range(-int(x**(1/5)),int(x**(1/5))+1):
    li.append(i)
for i in range(len(li)):
    for j in range(len(li)):
        if li[i]**5 - li[j]**5 == x:
            print(li[i],li[j])
            sys.exit()

Submission status: Wrong Answer

Solution code:
x = int(input())

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

pfs = prime_factorize(x)

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

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

Submission status: Wrong Answer

Solution code:
D = {}
k = 65
x = int(input())
for i in range(-k, k+1):
    D[i] = i**5
for i in range(-k, k+1):
    for j in range(-k, k+1):
        if D[i]-D[j] == x:
            print(i,j)
            exit()

Submission status: Wrong Answer

Solution code:
X = int(input())

for a in range(-100,101) :
    powa = pow(a,5)
    for b in range(-100,101) :
        powb = pow(b,5)
        if (powa + powb == X) :
            print(a,b)
            exit()

Submission status: Wrong Answer

Solution code:
import itertools

X = int(input())

ansL1 = [i for i in range(105)]
ansL2 = [i * (-1) for i in range(1, 105)]
ansL1.extend(ansL2)

L1 = [pow(i, 5)for i in range(105)]
L2 = [pow((-1)*i, 5)for i in range(1, 105)]
L1.extend(L2)

for v in itertools.combinations(L1, 2):
    if v[0] - v[1] == X:
        for i in range(len(L1)):
            if v[0] == L1[i]:
                ans1 = ansL1[i]
            if v[1] == L1[i]:
                ans2 = ansL1[i]
        print(ans1, ans2)
        exit()

Submission status: Wrong Answer

Solution code:
x = int(input())

for a in range(0,1000):
    for b in range(-100, 100):
        if a ** 5 - b ** 5 == x:
            print(a,b)
            break
    else:
        continue
    break

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
X = int(input().strip())


def solve():
    nums = [i ** 5 for i in range(-100, 100)]
    ans = set()
    for A in nums:
        for B in nums:
            if A - B == X:
                a = 0 if A == 0 else int(A / abs(A) * (abs(A) ** 0.2))
                b = 0 if B == 0 else int(B / abs(B) * (abs(B) ** 0.2))
                print(a, b)
                exit()

solve()

Submission status: Wrong Answer

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

for i in range(100):
    for j in range(100):
        if i**5 + j**5 ==x:
            print(i,end=" ")
            print(-j)
            sys.exit()