Problem:


Score : 400 points

Problem Statement

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

Constraints

1 \leq X \leq 10^9

X is an integer.

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

Input

Input is given from Standard Input in the following format:

X

Output

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

A B

Sample Input 1

33

Sample Output 1

2 -1

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

Sample Input 2

1

Sample Output 2

0 -1



Sample input:
33


Sample output:
2 -1

Submission status: Wrong Answer

Solution code:
def 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 = -10000
    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 >= 10000):
            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
        j += 1
    if(f == 1):
        break
        
print(primer[0],primer[1])

Submission status: Wrong Answer

Solution code:
x = int(input())

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

Submission status: Wrong Answer

Solution code:
import math
X=int(input())
a=pow(10,9)
c=math.ceil(a**0.3)
answers=[]
for a in range(-c,c+1):
    for b in range(-c,c+1):
        if pow(a,5)-pow(b,5)==X:
            answers.append(a)
            answers.append(b)
            break
print(answers)

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    X = int(input())
    for a in range(-120, 120):
        a5 = a ** 5
        for b in range(-120, 120):
            if a5 + b ** 5 == X:
                print(a, b)
                exit()

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
X = int(input())
A = 0
B = 0
for i in range(10 ** 2):
    for j in range(- 10 ** 2, 10 ** 2):
        if i ** 5 - j ** 5 == X:
            A = i
            B = j
print(A, B)

Submission status: Wrong Answer

Solution code:
#coding: utf-8
from math import ceil, floor
X = int(input())
a = 0
a2 = -a
def sign(v):
    if v < 0:
        return -1
    else:
        return 1
def counter(a):
    v = abs(a)
    for i in range(1, int(v**0.5)+2):
        if v % i == 0:
            if v == i**5:
                return True
    return False
while True:
    a2 = -a
    b = (a**5 - X)
    b2 = (a2**5 - X)
    if counter(b):
        if a**5 - b == X:
            print(a, int(abs(round(b))**(1/5))*sign(b))
            quit()
    if counter(b2):
        if a2 ** 5 - b2 == X:
            print(a2, int(abs(round(b))**(1/5))*sign(b2))
            quit()
    a += 1

Submission status: Wrong Answer

Solution code:
import sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

X = ri()

for a in range(-200, 200):
	for b in range(a+1, 200):
		if a**5 + b**5 == X:
			print(a, b)
			exit()

Submission status: Wrong Answer

Solution code:
import math
X=int(input())
c=math.ceil(X**0.3)
answers=[]
for a in range(-c,c+1):
    for b in range(-c,c+1):
        if pow(a,5)-pow(b,5)==X:
            answers.append(a)
            answers.append(b)
            break
print(answers)

Submission status: Wrong Answer

Solution code:
x=int(input())
flag="False"
t=0
while flag=="False":
  s=int(t**5-x)
  if s<0:
    s=s*-1
    if int(-s**0.2)==-s**0.2:
      s=int(-s**0.2)
      flag="True"
      break
  elif int(s**0.2)==s**0.2:
    s=int(s**0.2)
    flag="True"
    break
  t+=1
print("{} {}".format(t,s))

Submission status: Wrong Answer

Solution code:
X=int(input())

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

Submission status: Wrong Answer

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

for i in range(-130,130):
  for j in range(-130,130):
    if x == i**5 - j**5:
      a = i
      b = j
print(i,j)

Submission status: Wrong Answer

Solution code:
x=int(input())
flag="False"
t=0
while flag=="False":
  s=int(t**5-x)
  if s<0:
    s=s*-1
    if int(-s**0.2)==-s**0.2:
      s=int(-s**0.2)
      flag="True"
      break
  elif int(s**0.2)==s**0.2:
    s=int(s**0.2)
    flag="True"
    break
  t+=1
print("{} {}".format(s,t))

Submission status: Wrong Answer

Solution code:
import math
import sys

x = int(input())

for i in range(-118, 120):
    if x-i**5 < 0:
        b = math.pow(-(x-i**5), 1.0/5.0)
    else:
        b = math.pow((x-i**5), 1.0/5.0)
        b = -b
    if b.is_integer():
        print(i, int(b))
        sys.exit()

Submission status: Wrong Answer

Solution code:
X = int(input())

minus = []
memo = []
i = 0
while i ** 5 < int(1e11):
    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:
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())

for i in range(-2000, 2000):
    if (i+3)**5 - (i+2)**5 == X:
        # print(i, (i+3)**5 , (i+2)**5)
        print((i+3), (i+2))
        break
    elif (i+3)**5 + (i+2)**5 == X:
        # print(i, (i+3)**5 , (i+2)**5)
        print((i+3), -(i+2))
        break
    elif -(i+3)**5 - (i+2)**5 == X:
        # print(i, (i+3)**5 , (i+2)**5)
        print(-(i+3), (i+2))
        break
    elif -(i+3)**5 + (i+2)**5 == X:
        # print(i, (i+3)**5 , (i+2)**5)
        print(-(i+3), -(i+2))
        break

Submission status: Wrong Answer

Solution code:
X = int(input())

a = 0
while True:
    a += 1
    if a**5 > X:
        A1 = (a-1)**5
        A2 = a**5
        break

B1 = -(X - A1)
B2 = -(X - A2)

b=0
c=0
d=0
e=0

if B1 < 0:
    while True:
        b -= 1
        if B1 == b**5:
            print(a-1, b)
            break
        elif b**5 < B1:
            break
elif B1 >= 0:
    while True:
        c += 1
        if B1 == c**5:
            print(a-1, c)
            break
        elif c**5 > B1:
            break
elif B2 < 0:
    while True:
        d -= 1
        if B2 == d**5:
            print(a-1, d)
            break
        elif d**5 < B2:
            break
elif B2 >= 0:
    while True:
        e += 1
        if B1 == e**5:
            print(a-1, e)
            break
        elif e**5 > B1:
            break

Submission status: Wrong Answer

Solution code:
x = int(input())

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

Submission status: Wrong Answer

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

print(A+1, B)

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 = -1000
    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
        j += 1
    if(f == 1):
        break
        
print(primer[0],primer[1])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x=int(input())
n = 1000
l = [x**5 for x in range(n)]
for i,y in enumerate(l):
    if abs(y-x) in l:
        print(f"{i+1} {-(i)}")
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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



def solve(X: int):
    for i in range(-100, 100):
        for j in range(-100, 100):
            if i ** 5 - j ** 5 == X:
                print(i, j)
                return
    


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  # type: int
    solve(X)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
X = int(input())
for i in range (240):
    for j in range (240):
        s = (i -120)**5 - (j -120)**5
        if s == X:
            exit()
print(i-120,j-120)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())

for a in range(-10**6, 10**6):
    b5 = abs(X - a**5)
    b = pow(b5, 1 / 5)

    if X - a**5 > 0:
        b = -b

    if b.is_integer():
        b = int(b)
        if a**5 - b**5 == X:
            print(a, b)
            exit()

Submission status: Wrong Answer

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


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

    for d in range(1, upper):
        """
        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
        """
        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:
import math

def main(X):
    lst = f(X)
    for L in lst:
        for l in L:
            B = 1
            A = B + l[0]
            if g(A, B):
                print(A, B)
                exit()


def f(X):
    return [[[X // i, i], [i, X // i]] for i in range(1, math.floor(X ** 0.5) + 1) if X % i == 0]

def g(A, B):
    return A ** 5 - B ** 5 == X



if __name__ == '__main__':
    X = int(input())
    main(X)

Submission status: Wrong Answer

Solution code:
X = int(input())

a = 0
while True:
    a += 1
    if a**5 > X:
        A1 = (a-1)**5
        A2 = a**5
        break

B1 = X - A1
B2 = X - A2

b=0
c=0
d=0
e=0

if B1 < 0:
    while True:
        b -= 1
        if B1 == b**5:
            print(a-1, b)
            break
        elif b**5 < B1:
            break
elif B1 >= 0:
    while True:
        c += 1
        if B1 == c**5:
            print(a-1, c)
            break
        elif c**5 > B1:
            break
elif B2 < 0:
    while True:
        d -= 1
        if B2 == d**5:
            print(a-1, d)
            break
        elif d**5 < B2:
            break
elif B2 >= 0:
    while True:
        e += 1
        if B1 == e**5:
            print(a-1, e)
            break
        elif e**5 > B1:
            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:
                a = i - 64
                b = j - 64
                print(a, b)
                return
main()

Submission status: Wrong Answer

Solution code:
X = int(input())
for i in range (240):
    for j in range (240):
        s = (i -120)**5 - (j -120)**5
        if s == X:
            exit()
print(i,j)

Submission status: Wrong Answer

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

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(-10**3, 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()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
A = 0
B = 0
for i in range(-119,120):
  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())

for a in range(-200,201):
    for b in range(-200,201):
        if a^5 - b^5 == X:
            print(a,b)
            exit()

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(-130,130):
        t = s - i
        if s ** 5 - t ** 5 == X:
            print(s, t)
            break

Submission status: Wrong Answer

Solution code:
import collections
import itertools

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

a = prime_factorize(X)
L = len(a)

for i in range(L+1):
    d = itertools.combinations(a,i)
    Y = 1
    if i != 0:
        for j in d:
            Y *= j[0]
    A = -200
    while A < 200:
        if A ** 5 - (A-Y)**5 == X:
            print(A,A-Y)
            exit()
        else:
            A += 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]
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:
x=int(input())
for i in range(240):
  for j in range(240):
    if (120-i)**5-(120-j)**5==x:
      print(i,j)
      exit()

Submission status: Wrong Answer

Solution code:
x = int(input())
# x = 275

import math

a = math.floor(math.pow(x, 1 / 5))
bp = a ** 5 - x

b = math.ceil(math.pow(abs(bp), 1 / 5))
if bp < 0:
    b = -b

print('{} {}'.format(a, b))

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

Solution code:
import math
import sys

x = int(input())

for i in range(-119, 119):
    if x-i**5 < 0:
        b = math.pow(-(x-i**5), 1.0/5.0)
    else:
        b = math.pow((x-i**5), 1.0/5.0)
        b = -b
    if b.is_integer():
        print(i, int(b))
        sys.exit()

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==abs(x):
            if x>=0:
                if i>0:
                    sig=int(i//abs(i))
                else:
                    sig=1
                print(n,sig*int(pow(abs(i),1/5)))
                stop=1
            else:
                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==abs(x):
            if x>=0:
                if i>0:
                    sig=int(i//abs(i))
                else:
                    sig=1
                print(sig*int(pow(abs(i),1/5)),n)
                stop=1
            else:
                if i>0:
                    sig=int(i//abs(i))
                else:
                    sig=1
                print(sig*int(pow(abs(i),1/5)),n)
                stop=1
    if stop==1:
        break
    s|={N,-N}
    n+=1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

        p = a1 ** (1 / 5)
        q = a2 ** (1 / 5) if a2 >= 0 else abs(a2) ** (1 / 5) * -1

        f = int(p) - p == 0
        g = int(q) - q == 0
        if f:
            print(int(p), i)
            break
        if g:
            print(int(q), -1 * i)
            break

        i += 1


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
X = int(input())
a = 0
b = 0
def cal(a, b):
    return (a-b)*(a**4+a**3*b+a**2*b**2+a*b**3+b**4)

for i in range(10**9):
    if cal(0, -i) > X:
        b = -i+1
        break
a = (X-cal(0, b))


print("{} {}".format(a, b))

Submission status: Wrong Answer

Solution code:
MOD = 10 ** 9 + 7
INF = 10 ** 11
import sys
sys.setrecursionlimit(100000000)
from bisect import bisect_right,bisect_left


def main():
    X = int(input())
    for i in range(1000):
        for j in range(1000):
            p = pow(i,5)
            q = pow(j,5)
            if p + q == X:
                print(i,-j)
                return
            elif abs(p - q) == X:
                print(i,j)
                return
                
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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):
        if a**5 - b**5 == x:
            print(a, b)
            break

Submission status: Wrong Answer

Solution code:
x = int(input())
key = x % 5
# x = 0 # こいつのせいだ
# y = 0
is_true = False
for a in range(-key, key+1):
    for b in range(-key, key+1):
        A = a ** 5
        B = b ** 5
        # print([A, B])
        # print([a, b])
        if a != b and A - B == x:
            is_true = True
            break
        # elif a != b and A + B == x:
        #     x, y = A, -(B)
        #     is_true = True
        #     break
        # elif a != b and -(A + B) == x:
        #     x, y = -(A), B
        #     is_true = True
        #     break
    if is_true:
        break

print(a, b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())
for i in range(-200,200):
  for j in range(-200,200):
    if i**5-j**5 == X:
      print(i,j)
      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

print(AA,BB)

Submission status: Wrong Answer

Solution code:
X=int(input())

def judgef(n):
    if n>0:
        a=round(n**(0.2),8)
        b=int(n**(0.2))
    else:
        n=0-n
        a=round(n**(0.2),8)
        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:
MOD = 10 ** 9 + 7
INF = 10 ** 11
import sys
sys.setrecursionlimit(100000000)
from bisect import bisect_right,bisect_left


def main():
    X = int(input())
    for i in range(1000):
        for j in range(1000):
            p = pow(i,5)
            q = pow(j,5)
            if p + q == X:
                print(i,-j)
                return
            elif abs(p - q) == X:
                print(i,j)
                
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
x = int(input())
A = 0
B = 0
for i in range(-10000,10001):
  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())
for i in range(200):
  for j in range(200):
    if i**5-j**5 == X:
      print(i,j)
      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 = (max(0, 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:
X =int(input())
A = 0
B = 0
AA = 0
for i in range(1,1000):
    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:
x = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())

j = 1

while 1:
  if x < j ** 5:
    j -=1
    break
  j += 1
a = j
#print(a)
# j or j - 1

f = False
b = None
for i in range(a, a + 2):
  a_5 = i ** 5
  #print(a_5)
  for k in range(0, i + 1):
    #print(a_5 - k ** 5, a_5 + k ** 5)
    if a_5 - k ** 5 == x:
      b = k
      f = not f
      break
    elif a_5 + k ** 5 == x:
      b = -k
      f = not f
      break
    #print(i,k)
  if f:
    a = i
    break
print(a,b)

Submission status: Wrong Answer

Solution code:
X = int(input())
a = 0
while True:
    b = a ** 5 - X
    if b < 0:
        b = -abs(b) ** (1 / 5)
    else:
        b = b ** (1 / 5)
    if b.is_integer():
        print(a, int(b))
        break
    a += 1

Submission status: Wrong Answer

Solution code:
hoge = []
for i in range(100):
    if i**5 > 10**9:
        hoge.append(i**5)
        break
    hoge.append(i**5)
    
x = int(input())
f = False
for i, h_1 in enumerate(hoge):
    for j, h_2 in enumerate(hoge):
        if (h_1- h_2 == x):
            print(i, j)
            f = True
            break
        if (h_1+h_2 == x):
            print(i, -j)
            f = True
            break
        if (h_2 - h_1== x):
            print(-i, j)
            f = True
            break
        if (-h_2 - h_1== x):
            print(-i, -j)
            f = True
            break
        
    if f:
        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(-1000,1000):
    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(-118,119):
  for B in range(-118,119):
    if A**5-B**5==X:
      print(A,B)
      exit()

Submission status: Wrong Answer

Solution code:
x = int(input());
n1 = 0;
n2 = 0;
if(x == 1):
    n1 = 0;
    n2 = -1;
    print(n1, n2);
flag = False;

if(x != 1):
    for i in range(1000):
        for j in range(1000):
            if((i * i * i * i * i) - (-(j * j * j * j * j)) == x ):
                print(i, -j);
                flag = True;
                break;
        if(flag):
            break;