Problem:


Score : 400 points

Problem Statement

Give a pair of integers (A, B) such that A^5-B^5 = X.
It is guaranteed that there exists such a pair for the given integer X.

Constraints

1 \leq X \leq 10^9

X is an integer.

There exists a pair of integers (A, B) satisfying the condition in Problem Statement.

Input

Input is given from Standard Input in the following format:

X

Output

Print A and B, with space in between.
If there are multiple pairs of integers (A, B) satisfying the condition, you may print any of them.

A B

Sample Input 1

33

Sample Output 1

2 -1

For A=2 and B=-1, A^5-B^5 = 33.

Sample Input 2

1

Sample Output 2

0 -1



Sample input:
33


Sample output:
2 -1

Submission status: Wrong Answer

Solution code:
import math
x=int(input())
for i in range(1,int(math.sqrt(x)+1)):
    if x % i==0:
        t=i
        w=x//i
        a=0
        while a<=t:
            b=a-t
            if a**5-b**5==x:
                print(a,b)
                exit()
            a+=1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(200):
   list_A.append(i**5)
for i in range(-200,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:
x=int(input())
n = 1000
l = [x**5 for x in range(-n, n)]
for i,y in enumerate(l):
    if y+x in l:
        print(f'{int(l.index(y+x)-len(l)/2+1)} {int(i-len(l)/2+1)}')
        break
    elif y-x in l:
        print(f'{int(i-len(l)/2+1)} {int(l.index(y-x)-len(l)/2+1)}')
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

Solution code:
X = int(input())

minus = []
memo = []
i = 0
while i ** 5 < int(1e9):
    minus.append(-i**5)
    memo.append(i**5)
    i += 1

memo = minus + memo


for v in memo:
    tmp = X + v
    tmp2 = pow(tmp,1/5)
    if type(tmp2) != complex and int(tmp2) == tmp2:
        print(int(tmp2),end=" ")
        if v < 0:
            print(-int(pow(-v,1/5)),end=" ")
        else:
            print(int(pow(v,1/5)),end=" ")
        exit()

Submission status: Wrong Answer

Solution code:


def sovle_odd(X):
    max = 2000
    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 = 4000
    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:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
x = int(input())
for a in range(-200, 201):
    for b in range(-200, 201):
        print(a, b)
        if a**5 - b**5 == x:
            print(a, b)

Submission status: Wrong Answer

Solution code:
x=int(input())
if x==1:
    print(0,-1)
    exit()
else:
    n5=[0]
    i=1
    for i in range(1,100):
        i5=i*(i*i)**2
        n5.append(i5)
        if abs(x-i5) in n5:
            print(n5.index(i5),-(x-i5)//abs(x-i5)*(n5.index(abs(x-i5))))
            break

Submission status: Wrong Answer

Solution code:
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table

X = int(input())
prime = prime_decomposition(X)
if(X == 1):
    prime =[1,1]
# print(prime)
primer = [0,0]

f =1
# print(a**4+b**4+a**3*b+a**2*b**2+a*b**3)
for i in range(len(prime)):
    a_b = prime[i]
    c = int(X/a_b)
    # print(a_b,c)
    j = 0
    while all:
        a = j
        b = a - a_b
        # print(a,b,a_b)
        # if(a == 2 or b == -1):
        #     # print(a,b,a_b)
        #     print(a**4+b**4+a**3*b+a**2*b**2+a*b**3,c)
        #     break
        if(a >= 1000):
            break
        if(a**4+b**4+a**3*b+a**2*b**2+a*b**3==c):
            primer[0]= a
            primer[1]= b
            # print(primer)
            f = 1
            break
        d = 0-a
        e = a_b-d
        # print(d,e)
        if(d**4+e**4+d**3*e+d**2*e**2+d*e**3==c):
            primer[0]= d
            primer[0]= e
            # print(primer)
            f = 1
            break
        j += 1
    if(f == 1):
        break
        
print(primer[0],primer[1])

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import math
def main():
# 整数の入力
    x = int(input())
    a = 0
    b = 0
    while True:
        y = 0
        y5_x = math.pow(b, 5)
        y = math.pow(y5_x - x, -5)
        
        y = int(y)
        if math.pow(y, 5) + x == y5_x:
            a = y
            break
        else:
            b += 1

    print(f"{a} {b}")

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

for a in range(119):
  for b in range(119):
    if a**5 - b**5 == x:
      print(a,b)
      sys.exit()
    elif a**5 - (-b)**5==x:
      print(a,-b)
      sys.exit()

Submission status: Wrong Answer

Solution code:
X = int(input())
a = []
b = 0
flag = True
print(pow(100,5)-pow(99,5))
num = 120
if(X <= 120):
  num = X
for i in range(1,num+1):
  if(X%i== 0):
    a.append(i)
while(flag):
  for i in range(len(a)): 
    if(pow(b+a[i],5)-pow(b,5) == X):
      print("%d %d"%(b+a[i],b))
      flag = False
      break
  b -= 1
  if(b < -119):
    b = 119

Submission status: Wrong Answer

Solution code:
x = int(input())
for i in range(-1000,1000+1):
    for j in range(-1000,1001):
        if i**5 - j**5 == x:
            print(i, j, sep=' ')
            break
    break

Submission status: Wrong Answer

Solution code:
from numba import jit
import math
X = int(input())


@jit
def solver(X):
    sol = []
    i = 2
    while i <= math.sqrt(X)+1:
        if X % i == 0:
            sol.append(i)
        i += 1
    return sol


if X == 1:
    print(0, -1)
    exit()
sol = solver(X)


for i in sol:
    for s in range(-100, 101):
        t = s - i
        if s ** 5 - t ** 5 == X:
            print(s, t)
            break

Submission status: Wrong Answer

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

for i in range(120):
   list_A.append(i**5)
for i in range(-120,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:
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))
table.sort
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())
if x==1:
    print(0,-1)
    exit()
else:
    n5=[0]
    i=1
    for i in range(1,100):
        i5=i*(i*i)**2
        n5.append(i5)
        if abs(x-i5) in n5:
            print(-(x-i5)//abs(x-i5)*(n5.index(abs(x-i5))),n5.index(i5))
            break

Submission status: Wrong Answer

Solution code:
import math
X = int(input())
Y = math.floor(X**(1/5))
for i in range(0,X-Y):
	f = float(i**5-X)
	if f.is_integer():
		print(i," ",i**5-X)
		break

Submission status: Wrong Answer

Solution code:
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(i)
    i += 1
  if n > 1:
    table.append(int(n))
  return table
def main():
  sFlag=False
  X= int(input())
  X_table=prime_decomposition(X)
  X_table.append(1)
  for i in range(-int(X**(1/5))-1,int(X**(1/5))+1):
    A=i
    for j in range(len(X_table)):
      B=A-X_table[j]
      X_n=A**5-B**5
      if(X_n==X):
        print(A,B)
        sFlag=True
        break
    if(sFlag==True):
      break

if __name__=='__main__':
  main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

x = int(input())

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

Submission status: Wrong Answer

Solution code:
X = int(input())

AA = 0
BB = 0

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

        if X == (A ** 5) - (-B ** 5):
            AA = A
            BB = B

        if X == (-A ** 5) - (-B ** 5):
            AA = A
            BB = B

print(AA,BB)

Submission status: Wrong Answer

Solution code:
X=int(input())
if pow(X, 1/5)%1==0:
  print(int(pow(X, 1/5)), 0)
  exit()

for A in range(1, 10**3):
  tmp=A**5-X
  if tmp>=0:
    B=pow(tmp, 1/5)
  else:
    B=-pow(-tmp, 1/5)
    
  if B%1==0:
    print(int(A), int(B))
    exit()
    
for C in range(1, 10**3):
  A=-C
  tmp=A**5-X
  if tmp>=0:
    B=pow(tmp, 1/5)
  else:
    B=-pow(-tmp, 1/5)
    
  if B%1==0:
    print(int(A), int(B))
    exit()

Submission status: Wrong Answer

Solution code:


def sovle_odd(X):
    max = 2000
    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 = 4000
    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(raw_input())

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

Submission status: Wrong Answer

Solution code:
x = int(input())
for i in range(-1000,1000+1):
    for j in range(-1000,1001):
        if i**5 - j*5 == x:
            print(i, j, sep=' ')
            break
    break

Submission status: Wrong Answer

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

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())
L = make_divisors(x)
ans1=0
ans2=0
for i in L:
    a = 1
    while True:
        if a**5 - (a-i)**5 == x:
            ans1 = a
            ans2 = a-i
            break
        if a**5 - (a-i)**5 > x:
            break
        a += 1
    if ans1 != 0:
        break
print(ans1, ans2)

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]
table.sort()
def main():
    for i in range(len(table)):
        for j in range(len(table)):
            a5 = table[i]
            b5 = table[j]
            if a5-b5 == X:
                if i < 64:
                    a = i -64
                else:
                    a = i +64
                if j < 64:
                    b = j -64
                else:
                    b = j +64
                print(a, b)
                return
main()

Submission status: Wrong Answer

Solution code:
def read_int():
    return int(input())

def read_int_map():
    return map(int,input().split(' '))

def read_int_list():
    return list(map(int,input().split(' ')))

def read_s_list_loop(n):
    return [input() for _ in range(n)]

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 = read_int()

prime_value  = prime_factorize(X)

def calc(diff,minus=False):
    threads = 10**10
    a = diff
    b = 0
    ## + & +
    while True:
        tmp_x =  (a**5 - b**5)
        if tmp_x == X:
            print(a,b)
            exit(0)
        elif tmp_x > threads:
            break
        elif minus and threads*(-1) > tmp_x:
            break
        a += 1
        b += 1

    a = diff
    b = 0
    ## + & - and -
    while True:
        tmp_x =  (a**5 - b**5)
        if tmp_x == X:
            print(a,b)
            exit(0)
        elif tmp_x > threads:
            break
        elif minus and threads*(-1) > tmp_x:
            break
        a -= 1
        b -= 1
calc(1)
calc(-1,minus=True)
for p in prime_value:
    calc(p)
    calc(p*(-1),minus=True)

Submission status: Wrong Answer

Solution code:
x = int(input())
for i in range(-1000,1000+1):
    for j in range(-1000,1001):
        if i**5 - j*5 == x:
            print(i, j, sep=' ')

Submission status: Wrong Answer

Solution code:
import sys
import bisect
import numpy as np

x = int(input())
bs = [i for i in range(-100, 200)]
bspow = list(map(lambda x: x**5, bs))
# print(bspow)

for a in range(100):
    b_calc = a**5 - x
    index = bisect.bisect_left(bspow, b_calc)
    if(bspow[index] == b_calc):
        print(a, bs[index])
        sys.exit(0)

Submission status: Wrong Answer

Solution code:
x = int(input())

y = 100
s = -100
t = -100

a = 0
b = 0

while s < y:
    t = -y
    while t < y:
        if s ** 5 - t ** 5 == x:
            a = int(s)
            b = int(t)
        t += 1
    s += 1

print(a, b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
X = int(input())
Y = math.floor(X**(1/5))
for i in range(Y,X-Y):
	f = float(i**5-X)
	if f.is_integer():
		print(i," ",i**5-X)
		break

Submission status: Wrong Answer

Solution code:
x=int(input())
for i in range(-64,64+1):
    for j in range(-64,64+1):
        if i**5-j**5==x:
            print(i,j)
            exit()

Submission status: Wrong Answer

Solution code:
x = int(input())
#n, k = list(map(int, input().split()))
# a, b, c = list(map(int, input().split()))
#a = 0
#b = 0
for a in range(0, 1000):
    for b in range(0, 100):
        if pow(a, 5)-pow(b, 5) == x:
            print(a, end=" ")
            print(b)
            exit()
        elif pow(a, 5)-pow(b*-1, 5) == x:
            print(a, end=" ")
            print(b*-1)
            exit()

Submission status: Wrong Answer

Solution code:
X=int(input())
for B in range(-200,200):
    A = (X+(B**5))**(1/5)
    if (abs(A))%1==0:
        print(int(A), B)
        break

Submission status: Wrong Answer

Solution code:
X = int(input())

minus = []
memo = []
i = 0
while i ** 5 < int(1e9):
    minus.append(-i**5)
    memo.append(i**5)
    i += 1

memo = minus + memo


for v in memo:
    tmp = X + v
    tmp2 = pow(tmp,1/5)
    if type(tmp2) != complex and int(tmp2) == tmp2:
        if v < 0:
            print(-int(pow(-v,1/5)),end=" ")
        else:
            print(int(pow(v,1/5)),end=" ")
        print(int(tmp2))
        exit()

Submission status: Wrong Answer

Solution code:
x = int(input())
a = [i**5 for i in range(-300,300)]
for i in range(600):
  for j in range(600):
    if a[i] - a[j] == x:
      print(a[i],a[j])
      break

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]
table.sort()
def main():
    for i in range(len(table)):
        for j in range(len(table)):
            a5 = table[i]
            b5 = table[j]
            if a5-b5 == X:
                if i < 64:
                    a = i -64
                else:
                    a = i +64
                if i < 64:
                    b = i -64
                else:
                    b = i +64
                print(a, b)
                return
main()

Submission status: Wrong Answer

Solution code:
X = int(input())
c = 0
for i in range(-200,200):
    for j in range(-200,200):
        if i**5-j**5==X:
            a = i
            b = j
            print(a, b)

Submission status: Wrong Answer

Solution code:
x=int(input())
for i in range(-64,64+1):
    for j in range(-64,64+1):
        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:
n = int(input())
nn = int(pow(n,1/5)) + 1
for i in range(nn):
    b = pow(n - i ** 5, 1/5)
    if float.is_integer(b):
        break

print(i,int(-b))

Submission status: Wrong Answer

Solution code:
import math
X = int(input())
for i in range(0 - X, X):
        A5 = 0
        A5 = X + (i ** 5)
        A = A5 ** (1/5)
        # print(type(A))
        if type(A) is float:
                if A.is_integer() is True:
                        A = int(A)
                        print(i, A)
                        break

Submission status: Wrong Answer

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

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 func(a, b):
    return pow(a, 5) - pow(b,5)
    
cands = prime_factorize(x)
ok = False

for i in range(2 ** len(cands)):
    y = 1
    for j in range(len(cands)):        
        if (i >> j) & 1 == 1:
            y *= cands[j]
        for a in range(1, y + 1):
            b = a - y
            if func(a, b) == x:
                print(a, b)
                ok = True
            break
        if ok:
            break
    if ok:
        break

Submission status: Wrong Answer

Solution code:
x = int(input())

for a in range(-60, 60):
    for b in range(-60, 60):
        if a**5 - b**5 == x:
            print(a, b)
            quit()

Submission status: Wrong Answer

Solution code:
import math
def D():
    X = int(input())
    for x in range(X):
        A = math.pow(x, 5)
        B = A-X
        if B == 0:
            print(int(x), int(ans))
            return
        else:
            ans = math.pow(abs(B), 0.2)
            if ans.is_integer():
                print(int(x), int(ans))
                return
D()

Submission status: Wrong Answer

Solution code:
x=int(input())

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

Submission status: Wrong Answer

Solution code:
x = int(input())

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

Submission status: Wrong Answer

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

  def divisor(n):
    # nの約数列挙、戻り値はsortされていない
    ret = []
    for i in range(1, int(n**0.5)+1):
      if n % i == 0:
        ret.append(i)
        ret.append(n//i)
    return ret

  divs = sorted(divisor(x))
  for d in divs:
    for a in range(100):
      if a**5 - (a-d)**5 == x:
        print(a, a-d)
        return

abc166_d()

Submission status: Wrong Answer

Solution code:
x = int(input())
a = [i**5 for i in range(300)]
for i in range(300):
  for j in range(300):
    if a[i] - a[j] == x:
      print(a[i],a[j])
      break

Submission status: Wrong Answer

Solution code:
import itertools
import numpy as np
X=int(input())
t=0
for i in range(0,1000):
    if t==-1:
        break
    for j in range(1000,1000):
        #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:
x=int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X=int(input())
i=1
while (X+(i**5))**(1/5)-int((X+(i**5))**(1/5))>10**(-8):
    i+=1
    if X<i:
        i=-1
        while (X+(i**5))**(1/5)-int((X+(i**5))**(1/5))>10**(-8):
            i-=1
        break
print("{} {}".format(int((X+(i**5))**(1/5)), i))

Submission status: Wrong Answer

Solution code:
x=int(input())
s={0}
n=1
stop=0
while(1):
    N=n**5
    for i in s:
        if N-i==x:
            if i>0:
                sig=int(i//abs(i))
            else:
                sig=1
            print(n,sig*int(pow(abs(i),1/5)))
            stop=1
        elif N-i==-x:
            if i>0:
                sig=int(i//abs(i))
            else:
                sig=1
            print(n,sig*int(pow(abs(i),1/5)))
            stop=1
    if stop==1:
        break
    s|={N,-N}
    n+=1

Submission status: Wrong Answer

Solution code:
def main():
    import sys
    X=int(sys.stdin.readline())
    for i in range(-100,100):
        for j in range(-100,100):
            if i**5-j**5==X:
                print("{} {}".format(i,j))
                


main()

Submission status: Wrong Answer

Solution code:
import sys
import math

from collections import defaultdict
from collections import deque
def load(vtype=int):
    return vtype(input().strip())
def load_list(seplator=" ", vtype=int):
    return [vtype(v) for v in input().strip().split(seplator)]
def exit():
    import sys
    sys.exit(0)
def perm_sub(li, used):
    if len(li) == len(used):
        return [deque()]
    k = []
    for i in range(len(li)):
        if i in used:
            continue
        used.add(i)
        sub_list = perm_sub(li, used)
        for sub in sub_list:
            sub.appendleft(li[i])
        k.extend(sub_list)
        used.discard(i)
    return k
def perm_li(li):
    return perm_sub(li, set())
def perm_n(n):
    return perm_sub(list(range(n)), set())
def join_i(li, sep=""):
    return sep.join([str(e) for e in li])
def li2n(li):
    n, base = 0, 1
    for i in range(len(li)-1, -1, -1):
        n += li[i] * base
        base *= 10
    return n
def sli2ili(li):
    return [int(s) for s in li] 
def prime_list(n):
    li = [i for i in range(2, n+1)]
    for i in range(len(li)):
        if li[i] >= int(math.sqrt(n)):
            break
        if li[i] == -1:
            continue
        for j in range(i+1, len(li)):
            if li[j] % li[i] == 0:
                li[j] = -1
    return [n for n in li if n != -1]
def gcd(a, b):
    a, b = max(a, b), min(a, b)
    while True:
        r = a % b
        if r == 0: return b
        a, b = b, r
def lcm(a, b):
    return int(a * b / gcd(a,b))
def all_subset(li):
    s = []
    n = len(li)
    for bit in range(0, (1<<(n+1))):
        ss = set()
        for i in range(0, n):
            if (bit & (1 << i)):
                ss.add(li[i])
        s.append(ss)
    return s
def factorial(n):
    if n == 1:
        return 1
    return n * factorial(n-1)
def mCn(m, n):
    def factorial_ntimes(m, n):
        r = 1
        while n:
            r *= m
            m -= 1
            n -= 1
        return r
    return int(factorial_ntimes(m, n) / factorial(n))

x = load()
for b in range(10000, -10000, -1):
    b5 = b ** 5
    y = (x + b5)**(1/5)
    if type(y) == complex:
        continue
    if abs(y - math.floor(y)) < 0.000005:
        print(math.floor(y), b)
        exit()

Submission status: Wrong Answer

Solution code:
X=int(input())

def judgef(n):
    if n>0:
        a=round(n**(0.2),3)
        b=int(n**(0.2))
    else:
        n=0-n
        a=round(n**(0.2),3)
        b=int(a**(0.2))
    if abs(a-b)==0:
        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())

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

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

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

    return arr


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

Submission status: Wrong Answer

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