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:
X= int(input())
import itertools
pair = itertools.combinations(range(150),2)
for p in pair:
#    print(p)
    if (p[0]**5-p[1]**5==X):
#        print("Yeah! plus", p)
        print(p[0],p[1])
    elif ((-p[0])**5-p[1]**5==X)|(-((-p[0])**5+p[1]**5)==X):
      #  print("Yeah! minus", p)
        print(-p[0],p[1])
    elif (-(p[0]**5-p[1]**5)==X):
        print(-p[0],-p[1])

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

facts = factorization(x)

for fact in facts:
    c = fact[0]
    for i in range(1, c+1):
        if i**5 + (c-i)**5 == x:
            print(i, (c-i))
            break

Submission status: Wrong Answer

Solution code:
import math

x = int(input())
a = []
b = []
for i in range(-100,100,1):
    a.append([i,i**5])
    b.append([i,i**5])

for ai,a5 in a:
    for bi,b5 in b:
        if a5 - b5 == x:
            print(ai,bi)
            exit()

Submission status: Wrong Answer

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

i, j = 0, 0
for b in range(1, 1000):
    for z in range(1, 1000):
        if b**4 + 10*b**3*z + 10*b**2*z**2 + 5*b*z**3 + z**4 == X//z:
            print(b+z, b)
            sys.exit()

Submission status: Wrong Answer

Solution code:
X=int(input())
for a in range(X):
  if (a+1)**5-a**5 <= X <= (a+1)**+a**5:
    A=a
  break  
  
for b in range((a+1)**5-a**5,(a+1)**+a**5+1):
  if (a+1)**5-b**5 == X:
    B=b
  break

print(a+1, b)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
import collections

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 main():
    X = int(input())
    C = collections.Counter(prime_factorize(X))
    for c, v in C.items():
        NUM = c
        for i in range(-NUM,NUM+1):
            a = i
            b = a -NUM
            print(a,b)
            if a**5 + b**5 == X:
                print("".join(a,b))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# x>0,y<0のときは全探索で良い 10**(9/5)で十分
# x<0,y<0　もしくは x>0,y>0のときは考察 -- (*)
# x<0,y>0のときは条件からありえない．X>0を満たさない
# x5 - y4 = (x-y)(x4+x4y+x3y2+x2y2+xy3+y4)となる
# *の条件からx-y>0,右項>0が成立．なので右項に着目するとこれがXの約数のどれかになる
# それぞれの約数せいぜい10**4？こに対して，たかだか10**(9/4)くらいの計算をするので多分計算間に合う？
# う〜〜んなんか違う？

# Xの約数から(x-y)についてあり得る数を列挙していく
import math
X=int(input())

# まずx>0,y<0のとき，
max_a = int(pow(X,1/5))
for i in range(max_a+1):
    rest = X - pow(i,5)
    max_b=int(pow(rest,1/5))
    for b in range(max_b+1):
        if pow(b,5)==rest:
            print(i,' ',-b)
            exit()

# x>0,y>0もしくはx<0,y<0のとき
max_yakusu = int(math.sqrt(X))
yakusu=[]
for i in range(1,max_yakusu+1):
    if X%i==0:
        yakusu.append(i)
        yakusu.append(X/i)

# いま条件を満たすXが必ず存在するので，a**4...はyakusuのどれかに必ず等しい
for y in yakusu:
    moukatahou = X/y
    max_a = int(pow(y,1/4))+1
    # x>0,y>0のとき
    for a in range(max_a+1):
        b = a - moukatahou
        if b<0:
            continue
        ukou = pow(a,4)+pow(a,3)*b+pow(a,2)*pow(b,2)+a*pow(b,3)+pow(b,4)
        if ukou==y:
            print(a,' ',b)
            exit()
    # x<0,y<0のとき
    for a in range(0,-max_a-1,-1):
        b = a - moukatahou
        if b>0:
            continue
        ukou = pow(a,4)+pow(a,3)*b+pow(a,2)*pow(b,2)+a*pow(b,3)+pow(b,4)
        if ukou==y:
            print(a,' ',b)
            exit()

Submission status: Wrong Answer

Solution code:
x=int(input())
c=1
for a in range(10**3):
    for b in range(-10**3,10**2):
        if a**5-b**5==x:
            print(a,b)
            c=0
            break
    if c==0:
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())
A = 0
B = 0
flag = 1
while flag:
  B = A * (-1)
  while B < A:
    if A*A*A*A*A + B*B*B*B*B == X:
      print(A, B)
      flag = 0
      break
    B = B + 1
  A = A + 1

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

Solution code:
import math

X = int(input())

for i in range(X):
    factor1 = math.pow(X+i, 1.0/5.0)
    if factor1.is_integer():
        print(int(factor1), -i)
    factor2 = math.pow(X-i, 1.0/5.0)
    if factor2.is_integer():
        print(int(factor2), i)

Submission status: Wrong Answer

Solution code:
#d
d=int(input())
for i in range(-100,101):
    for j in range(-100,101):
        if i**5-j**5==d:
            break
            break
ans=[]
ans.append(int(i))
ans.append(int(j))
print(*ans)

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(str(A) + " " + str(B))
      break
    if A**5 + B**5 == X:
      print(str(A) + " -" + str(B))
      break

Submission status: Wrong Answer

Solution code:
X = int(input())
x = 1
while ((x-1)**2)*9 < X:
  x += 1
for i in range(x):
  for j in range(-x, i):
    if i**5-j**5 == X:
      a = [i,j]
      print(*a)

Submission status: Wrong Answer

Solution code:
x = int(input())
b = 0
while 1:
    a = (x + b**5)**(1/5)
    if a == int(a):
        break
    else:
        if x > b**5:
            a = (x - b**5)**(1/5)
            # print(a,b,"%.20f"%((x - b**5)**(1/5)))
        else:
            a = -((b**5 - x)**(1/5))
            # print(a,b,"%.20f"%(-((b**5 - x)**(1/5))))
        if abs(a) == int(abs(a)):
            b = -b
            break
            # if a**5 - b1**5 == x:
            #     b = b1
            #     break
    b += 1
print(int(a), b)

Submission status: Wrong Answer

Solution code:
import sys

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


for i in range(len(make_divisors(x))):
    for j in range(70):
        if j ** 5 - (j - make_divisors(x)[i]) ** 5 == x:
            print(j, j - make_divisors(x)[i])
            sys.exit()

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,7)
    if pow(int(k),5) - pow(i,5) == x:
        print(int(k),i)
        exit()

Submission status: Wrong Answer

Solution code:
ma = lambda :map(int,input().split())
ni = lambda:int(input())
x = ma()
ma = 200
for i in range(ma):
    for j in range(-ma,ma):
        if (i**5 - j**5) ==x:
            print(i,j)
            exit()

Submission status: Wrong Answer

Solution code:
import math
X=int(input())
for a in range(X+1):
    if pow(a,5)-1==X:
        print(a,1)
        break
    elif pow(a,5)+1==X:
        print(a,-1)
        break

Submission status: Wrong Answer

Solution code:
# import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)


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

    N = int(X**(1/5))
    M = int(X**(2/5))

    isFound = False

    res = [N,0]

    L = X * 3

    for A in range(L):
        posi = True
        nega = True
        for Bp in range(L):
            if posi:
                print(A,Bp)
                temp1 = A ** 5 - Bp ** 5
                if temp1 == X:
                    res = [A,Bp]
                    isFound = True
                    break
                if temp1 < X:
                    posi = False
            if nega:
                Bn = Bp * (-1)
                print(A,Bn)
                temp1 = A ** 5 - Bn ** 5
                if temp1 == X:
                    res = [A,Bn]
                    isFound = True
                    break
                if temp1 > X:
                    nega = False
        if isFound:
            break

    print(res[0],res[1])



main()

Submission status: Wrong Answer

Solution code:
x = int(input())
A = 0
B = 0
for i in range(-1000,1001):
  if i**5+x >0 and float.is_integer((i**5 + x)**0.2) == True:
    A = (i**5 + x)**0.2
    B = i
    break

print(int(A),B)

Submission status: Wrong Answer

Solution code:

x = int(input())
hoge = []
for i in range(100):
    if i**5 > 10**9:
        hoge.append(i**5)
        break
    hoge.append(i**5)
for i, h_1 in enumerate(hoge):
    for j, h_2 in enumerate(hoge):
        if (h_1-h_2 == x):
            print(i, j)
        if (h_2 - h_1 == x):
            print(j, i)

Submission status: Wrong Answer

Solution code:
from sys import stdin
import sys
import math

X = int(input())

x = int(math.sqrt(X) + 1)

# ａ⁵－ｂ⁵＝(ａ－ｂ)(ａ⁴＋ａ³ｂ＋ａ²ｂ²＋ａｂ³＋ｂ⁴)
# a - b >= 1
# a != b


a5 = []
for i in range(66):
    a5.append(i ** 5)

b5 = []
for j in range(66):
    b5.append(j ** 5)
#print(a5)
#print(b5)

ans_a = 0
ans_b = 0

#for k in a5:
#    res = k - X
#    if res in b5:
#        b = b5.index(res)
#        ans_b = b
#    elif -res in b5:
#        b = b5.index( (-res) )
#        ans_b = -b

for a in a5:
    for b in b5:
        if a - b == X:
            print("%d %d" % (a5.index(a), b5.index(b)))
            sys.exit()
        elif a + b == X:
            print("%d %d" % (b5.index(b), (a5.index(a)) * (-1)))
            sys.exit()

Submission status: Wrong Answer

Solution code:
arr = []
x = input()
for i in range((-39), 39):
    arr.append(pow(i,5))

for i in range(0, 76):
    for j in range(0, 76):
        if (arr[i] - arr[j] == x):
            print('%d %d' % (i, j))
            exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())

from collections import Counter
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 q_cal(a, b):
    return a**4 + a**3 * b + a**2 * b**2 + a * b**3 + b **4


from math import ceil, floor


def search(p, q):
    a = ceil(p/2)
    while a<=p:
        b = a - p
        q_temp = q_cal(a, b)

        if q == q_temp:

            return a, b
        elif q < q_temp:
            break
        a += 1
    return None, None

fact = dict(Counter(prime_factorize(X)))
for k in fact.keys():
    p = k
    q = int(X/p)
    a, b = search(p, q)
    if a:
        print('%d %d'%(a,b))
        break

Submission status: Wrong Answer

Solution code:
import math
def factorial(x):
    for a in range(-1, 9 + 1):
        for b in range(-1, 9 + 1):
            check = math.pow(a, 5) - math.pow(b, 5)
            if check == x:
                return f'{a} {b}'


x = int(input())
print(factorial(x))

Submission status: Wrong Answer

Solution code:
X = int(input())
factors = []

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

Submission status: Wrong Answer

Solution code:
#D - I hate Factorization
X = int(input())
for i in range(-int(X**(1/5)),int(X**(1/5))):
    for j in range(-int(X**(1/5)),int(X**(1/5))):
        if i**5 - j**5 ==X:
            print(i,j)
            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+1000):
        for j in range(b,b+1000):
            if i**5 - j**5 == x:
                print(i,j)
                flag = 1
                break

if flag == 0:
    b = 0
    for i in range(a,a-1000):
        for j in range(b,b-1000):
            if i**5 - j**5 == x:
                print(i,j)
                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(-f**2, f**2):
    a = f + i
    b = i
    if a**4+a**3*b+a**2*b**2+a*b**3+b**4 == s:
        print(a, b)
        exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
x = 1
y = 0
while x**5 < n:
	y = (n - x**5);
	y = int(y)
	if (x**5 + y**5 == n):
		print(x, -1 * y, sep = " ");
		break
	x+=1
if (x**5 + y**5 != n):
	i = 1
	while(i <= 100):
		if (n % i == 0):
			j = 0;
			ok = False;
			while((i+j)**5 - j**5 <= n):
				if (i+j)**5 - j**5 == n:
					print(i+j,i, sep = ' ');
					ok = True;
					break;
				j+=1
		i+=1
		if (ok == True):
			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)
            exit()

Submission status: Wrong Answer

Solution code:
import math
X = int(input())
A=[]
B=[]
number = []
flag = 0
for i in range(math.ceil(X/100000000) * -1, math.ceil(X/100000000) + 1):
    number.append(i)
    A.append(i ** 5)
    B.append(i ** 5)

for i in range(len(A)):
    for j in range(len(B)):
        if(A[i] - B[j] == X and flag == 0):
            print(number[i],number[j])
            flag += 1

Submission status: Wrong Answer

Solution code:
# coding: utf-8

X = int(input())
flg = 0
for A in range(-80, 80):
    for B in range(-80, 80):
        if A ** 5 - B ** 5 == X:
            print(f"{A} {B}")
            flg = 1
            break
    if flg:
        break

Submission status: Wrong Answer

Solution code:
def DI(n):
    D = []
    for i in range(1,int(n**0.5)+1):
        if n % i == 0:
            D.append(i)
            if i != n//i:
                D.append(n//i)
    return D
X = int(input())
D = DI(X)
flag = False
for i in range(len(D)):
    for a in range((D[i]+1)//10):
        b = -(D[i] - a)
        if a**5 - b**5 == X:
            print(str(a) + ' ' + str(b))
            flag = True
            break
    if flag:
        break

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(x//4):
        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:
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.000000000001:
        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())
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(j,i)
      break
    elif list[i]+list[j] == X:
      print(j,-i)
      break

Submission status: Wrong Answer

Solution code:
x=int(input())
for i in range(100):
    pq=abs(x-i**5)
    
    y=(pq)**(1/5)
    #print(y,i)
    if y//1==y:
        y=int(y)
        if (y**5-i**5)==x:
            print(y,i)
        elif (y**5+i**5)==x:
            print(y,-1*i)
        elif (i**5-y**5)==x:
            print(i,y)
        elif (i**5+y**5)==x:
            print(i,-1*y)
        break

Submission status: Wrong Answer

Solution code:
x = int(input())

U = 10**9

divisors = set()
for i in range(1, int(U**.5)+1):
    if x % i == 0:
        divisors |= {i, x//i}


# fact = factorization(x)
# a = fact[0][0]
# a -= 1
# b = -1
# print(divisors)


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


for b in range(-1000, 1000):
    for div in divisors:
        a = div+b
        if f(a, b) == x:
            print(a, b)
            exit()

Submission status: Wrong Answer

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

yakusuu = make_divisors(x)

for i in yakusuu[:len(yakusuu)//2+1]:
    y = int(x/i)
    if (y-i)%2 == 0:
        print(i+(y-i)//2,i)

Submission status: Wrong Answer

Solution code:
X =int(input())
A = 0
B = 0
AA = 0
for i in range(1,X+1):
    A = i **5
    if AA != 0:
        break
    for j in range(0,i):
        B = j **5
        if abs(A-X) < B:
            break
        if abs(A-X) == B:
            AA = i
            AB = j
            break
if X - A < 0:
    AB = -AB
print(AA,AB)

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 (100000):
        if pow1(i-50000,5)-pow1(i-50000-a[j],5)==X:
            ans1=i-50000
            ans2=i-50000-a[j]
            print(ans1,ans2)
            break

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())
b = -1
a = x + b**5

print(a, b)

Submission status: Wrong Answer

Solution code:
X=int(input())
i=1
table=[]
while i*i<=X:
    if X%i==0:
        table.append(i)
        table.append(X//i)
    i+=1
table=list(set(table))
j=0
a=len(table)
for j in range(a):
    p=table[j]
    A=1
    while A**5-(A-p)**5<=X:
        if X==A**5-(A-p)**5:
            print(A,A-p)
            break
        A+=1
    j+=1

Submission status: Wrong Answer

Solution code:
X = int(input())
table = [0, 1, -1, 32, -32, 243, -243, 1024, -1024, 3125, -3125, 7776, -7776, 16807, -16807, 32768, -32768, 59049, -59049, 100000, -100000, 161051, -161051, 248832, -248832, 371293, -371293, 537824, -537824, 759375, -759375, 1048576, -1048576, 1419857, -1419857, 1889568, -1889568, 2476099, -2476099, 3200000, -3200000, 4084101, -4084101, 5153632, -5153632, 6436343, -6436343, 7962624, -7962624, 9765625, -9765625, 11881376, -11881376, 14348907, -14348907, 17210368, -17210368, 20511149, -20511149, 24300000, -24300000, 28629151, -28629151, 33554432, -33554432, 39135393, -39135393, 45435424, -45435424, 52521875, -52521875, 60466176, -60466176, 69343957, -69343957, 79235168, -79235168, 90224199, -90224199, 102400000, -102400000, 115856201, -115856201, 130691232, -130691232, 147008443, -147008443, 164916224, -164916224, 184528125, -184528125, 205962976, -205962976, 229345007, -229345007, 254803968, -254803968, 282475249, -282475249, 312500000, -312500000, 345025251, -345025251, 380204032, -380204032, 418195493, -418195493, 459165024, -459165024, 503284375, -503284375, 550731776, -550731776, 601692057, -601692057, 656356768, -656356768, 714924299, -714924299, 777600000, -777600000, 844596301, -844596301, 916132832, -916132832, 992436543, -992436543, 1073741824, -1073741824]
def main():
    for a in table:
        for b in table:
            if a-b == X:
                print(pow(a, 1/5), pow(b, 1/5))
                return
main()

Submission status: Wrong Answer

Solution code:
import math

X = int(input())
M = int(10 ** (9 * 0.2)) + 10

def culc():
  for a in range(-M, M):
    a5 = pow(a, 5)

    for b in range(-M, M):
      b5 = pow(b, 5)

      if(a5 - b5 == X):
        print(" ".join(map(str, [a, b])))
        return

culc()

Submission status: Wrong Answer

Solution code:
import sys
a=int(input())
i=1
t=True
while t:
  if a-i**5>=0:
    if int((a-i**5)**0.2)==(a-i**5)**0.2:
      print(i,int((-1)*(a-i**5)**0.2))
      sys.exit()
  else:
    if int((-a+i**5)**0.2)==(-a+i**5)**0.2:
      print(i,int((-a+i**5)**0.2))
      sys.exit()
  i+=1

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(-1,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())
start = int(pow(x,0.2))
for i in range(-start,start+1):
    k = pow(x + pow(i,5),0.2)
    k = round(k,10)
    if pow(int(k),5) - pow(i,5) == x:
        print(int(k),i)
        exit()

Submission status: Wrong Answer

Solution code:
x=int(input())
p=False
q=[]
for i in range(101):
  q.append(i**5)
r=100
a=0
b=0
l=0
while (r-l>=1):
  j=(l+r)//2
  if q[j]-x in q:
    a=q[j]
    b=q[j]-x
  elif q[j]-x >= 50**5:
    r=i
  else:
    l=i+1
print(a,b)

Submission status: Wrong Answer

Solution code:
import math
X = int(input())
n = math.log(X, 5)
B = 1
A = math.log(X + B, 5)
B = math.log(X, 5) - A
print(A, B)

Submission status: Wrong Answer

Solution code:
X = int(input())


lst = []

i = 0
v = 0
while v <= X * 2:
    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:
X=int(input())
Y=int((X/4)**(1/4))+1
for B in range(-Y,Y+1):
    if (int(X+B**5)**(1/5))**5==(X+B**5):
        print(int((X+B**5)**(1/5)),B)
        break

Submission status: Wrong Answer

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

for a in range(-1*(10**(4)),10**4+1):
  if a == 0:
    b = pow(-x,-5)
  elif a**5 - x == 0:
    b = 0
  else:
    b = pow(pow(a,5) - x,-5)
    if b % 1 == 0:
      print(a,b)

Submission status: Wrong Answer

Solution code:
import math

x = int(input())
a = []
b = []
for i in range(-50,50):
    a.append([i,i**5])
    b.append([i,i**5])

for ai,a5 in a:
    for bi,b5 in b:
        if a5 - b5 == x:
            print(ai,bi)
            exit()

Submission status: Wrong Answer

Solution code:
from sys import stdin
X = int(stdin.readline())

for a in range(X):
    for b in range(X):
        if (pow(a,5) - pow(b,5)) == X:
            print(f'{a} {b}')

Submission status: Wrong Answer

Solution code:
X = int(input())

b = True
i = 1

if X == 1:
    i = 0
else:
    while b:
        x = (X - 1) // i ** 5 
        if x == 1:
            b = False
        else:
            i += 1
print(i , -1)

Submission status: Wrong Answer

Solution code:
X = int(input())

found = False
for i in range(1, int(X**0.5)+1):
    if X % i == 0:
        a = 0
        b = a - i
        while 1 <= a**5 - b**5 <= 10**9:
            if a**5 - b**5 == X:
                print(a, b)
                found = True
                break
            a += 1
            b = a - i
        if found:
            break
            
    if X % i == 0:
        a = 0
        b = a - int(X / i)
        while 1 <= a**5 - b**5 <= 10**9:
            if a**5 - b**5 == X:
                print(a, b)
                found = True
                break
            a += 1
            b = a - int(X / i)
        if found:
            break

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
            B = 1
            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:
from itertools import combinations_with_replacement
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

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

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

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
x = int(input())
b = -1
a = (b**5+x)**1/5
if  a %1 == 0 or a ==0:
    exit()

    while a %1 != 0 :
        b+= 1
print(int(a),int(b))

Submission status: Wrong Answer

Solution code:
X=int(input())
x=0
list_A=[]
list_B=[]

for i in range(40):
   list_A.append(i**5)
for i in range(-40,0):
   list_B.append(i**5)
    
list_B.reverse()

    
for i in list_A:
    for j in list_B:
      x=i-j
      if x == X:
        d=(list_B.index(j)+1)*-1
        e=(list_A.index(i))
        print(e," ",d)
        break
    else:
        continue
    break

Submission status: Wrong Answer

Solution code:
import itertools
import numpy as np
X=int(input())
t=0
for i in range(-63,63):
    if t==-1:
        break
    for j in range(-63,63):
        #print(i,end=" ")
        #print(j)
        if i**5-j**5==X:
            print(i,end=" ")
            print(j)
            t=-1
            break

Submission status: Wrong Answer

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

a = 0
b = 0

c = float(pow(x, 1/5).real)
if c.is_integer():
    a = int(c)
    b = 0
    print(a, b)

else:
    for i in range(x):
        y = i**5 - x
        if y < 0:
            y = -y
            minus = True
        else:
            minus = False

        b = round(float(pow(y, 1/5).real), 8)
        print(i, b)
        if b.is_integer():
            a = i
            if minus:
                b = -b
            break

    print(a, int(b))

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

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

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

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

Submission status: Wrong Answer

Solution code:
import sys
import math

X = int(input())

# Aが正、Bが負
for A in range(math.ceil(X**(1 / 5))):
    # A = 1
    B_5 = X - A**5
    B = B_5**(1 / 5)
    if math.floor(B) == B:
        print(A, -int(B))
        sys.exit(0)

# Aが正、Bが正
for a in range(math.ceil(X**(1 / 4))):
    for b in range(math.ceil(X**(1 / 4))):
        eq = a**4 + (a**3) * b + (a**2) * (b**2) + a * (b**3) + b**4
        if (a - b) * eq == X:
            print(a, b)
            sys.exit(0)