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:
#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
while True:
    a2 = -a
    b = (a**5 - X)
    b2 = (a2**5 - X)
    if abs(b)**(1/5) == int(abs(b)**(1/5)):
        if a**5 - b == X:
            print(a,int(abs(b)**(1/5)) * sign(b))
            exit()
    if abs(b2)**(1/5) == int(abs(b2)**(1/5)):
        if a2**5 - b2 == X:
            print(a2, int(abs(b2)**(1/5)) * sign(b2))
            exit()
    a += 1

Submission status: Wrong Answer

Solution code:
import sys
X=int(input())
for i in range(200):
  for j in range(200):
    if (i-100)**5-(j-100)**5==X:
      A=[]
      A.append(i-100)
      A.append(j-100)
      A=[str(n) for n in A]
      print(' '.join(A))
      sys.exit()

Submission status: Wrong Answer

Solution code:
import math
x=int(input())
f = math.floor(x ** (1/5))
for i in range(-f-1,f+1):
    for j in range(-f+1,f+1):
        if i**5-j**5==x:
            print(i,j,sep=" ")
            exit()

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
i = 0
print(i)
while True:
  t = math.pow(i, 5)-x
  if t >= 0:
    b = math.pow(t, 1/5)
    if b.is_integer():
      print(str(i) + ' ' + str(int(b)))
      break
  else:
    b = math.pow(-t, 1/5)
    if b.is_integer():
      print(str(i) + ' ' + str(int(-b)))
      break
  i += 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x=int(input())
D=[1]
for i in range(2,int(x**0.5)+1):
    if x%i==0:
        D.append(i)
for d in D:
    for i in range(-100,100):
        if i**5-(i-d)**5==x:
            print(i,i-d)
            exit()
        if (i+d)**5-i**5==x:
            print(i,i+d)
            exit()

Submission status: Wrong Answer

Solution code:
import math

x = int(input())
template = lambda a, b: "{} {}".format(a, -b) if x >= 0 else "{} {}".format(-a, b)
x = abs(x)
max_a = math.floor(math.pow(x, 1 / 5))
for a in range(max_a + 1):
    for b in range(a + 1):
        if a ** 5 + b ** 5 == x:
            break
print(template(a, b))

Submission status: Wrong Answer

Solution code:
import sys
import os
import math
import bisect
import collections
import itertools

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def f(a, b):
    return pow(a, 5) - pow(b, 5)


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    X = ii()
    for a in range(71):
        for b in range(71):
            if X == f(a, -b):
                print(a, -b)
                exit()
            if X == f(a, b):
                print(a, b)
                exit()


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from collections import deque
from heapq import heapify,heappop,heappush,heappushpop
from copy import copy,deepcopy
from itertools import product,permutations,combinations,combinations_with_replacement
from collections import defaultdict,Counter
from bisect import bisect_left,bisect_right
# from math import gcd,ceil,floor,factorial
# from fractions import gcd
from functools import reduce
from pprint import pprint

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

def mylistinput(n):
    return [ list(myinput()) for _ in range(n) ]

def mycol(data,col):
    return [ row[col] for row in data ]

def mysort(data,col,reverse_flag):
    data.sort(key=lambda x:x[col],reverse=reverse_flag)
    return data

def mymax(data):
    M = -1*float("inf")
    for i in range(len(data)):
        m = max(data[i])
        M = max(M,m)
    return M

def mymin(data):
    m = float("inf")
    for i in range(len(data)):
        M = min(data[i])
        m = min(m,M)
    return m

def myoutput(ls,space=True):
    if space:
        if len(ls)==0:
            print(" ")
        elif type(ls[0])==str:
            print(" ".join(ls))
        elif type(ls[0])==int:
            print(" ".join(map(str,ls)))
        else:
            print("Output Error")
    else:
        if len(ls)==0:
            print("")
        elif type(ls[0])==str:
            print("".join(ls))
        elif type(ls[0])==int:
            print("".join(map(str,ls)))
        else:
            print("Output Error")

x = int(input())

for b in range(-10**5,10**5):
    m = x + (b**5)
    if m<0:
        pass
    else:
        a = pow(m,1/5)
        if a.is_integer():
            a = int(a)
            print(a,b)
            exit()

Submission status: Wrong Answer

Solution code:
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

# Factoring by trial split -- START --
def getPrimeList(n):
  l=[]
  t=int(math.sqrt(n))+1
  
  for a in range(2,t):
    while n%a==0:
      n//=a
      l.append(a)
  
  if n!=1:
    l.append(n)
  
  return l
# Factoring by trial split --- END ---

def main():
  n=I()
  l=getPrimeList(n)

  if len(l)==0:
    l.append(1)
  x=l[0]
  for a in range(x+1):
    b=a-x
    # print(a,b)
    if a**5-b**5==n:
      return str(a)+' '+str(b)

# main()
print(main())

Submission status: Wrong Answer

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

MAX = pow(10,2)

for b in range(-MAX,MAX):
  #print(b)
  temp = X+pow(b,5) #これがaの5乗
  if temp < 0:
    continue
  aa = pow(temp,1/5)
  a = round(aa,5)
  #print(a,b)
  if a.is_integer():
    print(int(a),int(b))
    sys.exit()

Submission status: Wrong Answer

Solution code:
#import numpy as np#not for pypy

def main():
    ##get int
    first_input = list(map(lambda x:int(x), input().split(" ")))
    #second_input = list(map(lambda x:int(x), input().split(" ")))

    ##get float
    #first_input = list(map(lambda x:float(x), input().split(" ")))
    #second_input = list(map(lambda x:float(x), input().split(" ")))

    ##get string
    #first_input = input().split(" ")
    #second_input = input().split(" ")

    X = first_input[0]
    for B in range(-int(X**(1/5)+1),int(X**(1/5)+1)+1):
        if X+B**5<0:
            continue
        A_principle = (X+B**5)**(1/5)
        if (A_principle-(A_principle//1))==0:
            print(str(int(A_principle))+" "+str(B))
            break

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x=int(input())
num1=int(x**(1/5))
num2=num1+1
val1=x-(num1**5)
val2=(num2**5)-x
g1=val1**(1/5)
g2=val2**(1/5)
if g1==int(g1):
    print(num1,end=" ")
    print(0-int(g1))
else:
    print(num2,end=" ")
    print(int(g2))

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)
            exit(0)

Submission status: Wrong Answer

Solution code:
import sys
import math
import fractions
from collections import deque
from collections import defaultdict
sys.setrecursionlimit(10**7)


def 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())
divs = divisors(X)

for i in range(0, 1000):
    for d in divs:
        for m in [-1, 1]:
            for n in [-1, 1]:
                B = m * i
                A = n * d + B
                rest = A ** 4 + (A ** 3) * B + (A ** 2) * \
                    (B ** 2) + A * (B ** 3) + (B ** 4)
                if d * rest == X:
                    print(A, B)
                    sys.exit()

Submission status: Wrong Answer

Solution code:
X = int(input())

gojo = []
i = 0
ans = 0
while ans <= 1000000000:
    ans = i**5
    gojo.append(ans)
    i += 1

risou = 0
for j, gostart in enumerate(gojo):
    risou = gostart + X
    mirisou = X - gostart
    for k in range(len(gojo)):
        if gojo[k] == risou:
            print(k, j)
            exit()
        elif gojo[k] == mirisou:
            print(k, -j)
            exit()
        if gojo[k] > risou or gojo[k] > mirisou:
            break

Submission status: Wrong Answer

Solution code:
x = int(input())

n = 30000
a = [i for i in range(n)]
a5 = [pow(i, 5) for i in range(n)]
for i in range(n):
    for j in range(n):
        if a5[i] - a5[j] == x:
            print(f"{a[i]} {a[j]}")
            exit()
        if a5[i] + a5[j] == x:
            print(f"{a[i]} {-a[j]}")
            exit()
        if a5[j] - a5[i] == x:
            print(f"{-a[i]} {a[j]}")
            exit()
        if a5[j] + a5[i] == x:
            print(f"{-a[i]} {-a[j]}")
            exit()

Submission status: Wrong Answer

Solution code:
n = int(input())
x = 1
while x**5 <= n:
	y = int((n - x**5) ** (1/5))
	if (x**5 + y**5 == n):
		print(x, -1 * y, sep = " ");
		break
	x+=1

Submission status: Wrong Answer

Solution code:
import numpy as np
def check(x):
    x=abs(x)
    n=int(x**(float(0.2)))
    return n**5==x
def sol(x):
    for i in range(1,1001):
        if (check(i**5-x)):
            print (i**5,int(np.sign(i**5-x)*abs(i**5-x)**(float(0.2))))
            return

if __name__=='__main__':
    x=int(input())
    sol(x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

import heapq
from collections import defaultdict, deque
from math import ceil, factorial, gcd
from itertools import accumulate, permutations
import sys
import bisect


sys.setrecursionlimit(10 ** 7)
INF = float("inf")
MOD = 10 ** 9 + 7

si = lambda: input().strip()
ii = lambda: int(input())
mii = lambda: map(int, input().split())
msi = lambda: map(str, input().split())
lmii = lambda: list(map(int, input().split()))
lmsi = lambda: list(map(str, input().split()))
smii = lambda: sorted(map(int, input().split()))


# ----------

X = ii()

beki = 0
i = 0
bekis = set()
while abs(beki) < ((10 ** 9) * 3):
    beki = pow(i, 5)
    bekis.add(i)
    bekis.add(-i)
    i += 1

for a in bekis:
    for b in bekis:
        if pow(a, 5) - pow(b, 5) == X:
            print(a, b)
            exit()

Submission status: Wrong Answer

Solution code:
x = int(input())
for i in range(40):
    for j in range(40):
        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:
def solve():
    X = int(input())
    for i in range(-64,65):
        for j in range(-64,65):
            if i**5 -j**5 == X:
                print(i,j)
                break
        else:
            continue
        break

if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
import math
for i in range(100):
    a = x - (i ** 5)
    print("i", i, "a", a)
    if a > 0:
        v = math.pow(a, 1.0/5.0)
        if v.is_integer():
            v=int(v)
            print("v", v)
            print(v, -i)
            break
    else:
        v = math.pow(-a, 1.0 / 5.0)
        if v.is_integer():
            v=int(v)
            print("v", v)
            print(i, v)
            break

Submission status: Wrong Answer

Solution code:
X=int(input())

factors=[]
for i in range(1,int(X**0.5)+1):
    if X%i==0:
        factors.append(i)
        if i!= X//i:
            factors.append(X//i)

for C in factors:
    for B in range(-100,100):
        A=B+C
        if A**5-B**5==X:
            print(A,B)
            exit()

Submission status: Wrong Answer

Solution code:
X = int(input())
a = int(X**0.2) + 1
if X == 0:
  print(0,0)
else:
  for i in range(0,a+1):
    for j in range(0,-(a+1),-1):
      if i==0 and j==0:
        continue
      else:
        if X%(i-j) == 0:
          if X == i**5 - j**5:
            print(i,j)
            exit()

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))):
    if i % 2 == 0:
        for j in range(98):
            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())
for a in range(-100, 101):
    for b in range(-100, 101):
        if a**5 - b**5 == X:
            print(a, b)
            exit()

Submission status: Wrong Answer

Solution code:
X = int(input())

a = -int(X**(1/5))
b = int(X**(1/5))
for x in range(a, b):
  for y in range(a, b):
    if x**5 - y**5 == X:
      print(x, y)
      break
  else:
    continue
  break

Submission status: Wrong Answer

Solution code:
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)

X = int(readline().rstrip())

lim = int(X ** 0.2) + 1

for A in range(0, lim):
    for B in range(0, lim):
        v = (A ** 5) + (B ** 5)
        if v == X:  
            print(A, -B)
            exit()

Submission status: Wrong Answer

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

def f(a, b):
    return a ** 5 - b ** 5
def make_divisors(n):
    divisors = []
    for i in range(1, int(math.sqrt(n)) + 1):
        if n % i == 0:
            divisors.append(i)
            # √nで無い数についてもう一個プラス
            if i != n // i:
                divisors.append(n // i)
    return divisors
division = sorted(make_divisors(x))
sele = math.floor(x ** (1/4))
for div in division:
    for j in range(-sele, sele + 1):
        a1 = j
        b1 = div - j
        if f(a1, b1) == x:
            print(a1, b1)
            exit()
    else:
        continue
    break

Submission status: Wrong Answer

Solution code:
x = int(input())


for a in range(-1, 20000):
    # ubとlbは余裕を持って大きく（小さく）取っておく
    ub = 100000**5
    lb = -100000**5
    while lb + 1 < ub:
        target = (ub+lb)//2
        if (a**5 - target**5 >= x):
            lb = target
        else:
            ub = target
    if a**5 - target**5-x == 0:
        print(a, target)

Submission status: Wrong Answer

Solution code:
x = int(input())
a = 0
b = 0
flag = False
for i in range(10**7):
    tmp = (x + i)**(1/5)
    if tmp.is_integer():
        b = i
        a = x + b**5
        flag = True
        break
if flag == False:
    for i in range(-10**7,0):
        tmp = (x + i)**(1/5)
        if tmp.is_integer():
            b = i
            a = x + b**5
            break
print(int(a),int(b))

Submission status: Wrong Answer

Solution code:
import sys
import math
from collections import deque
import heapq
import itertools
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

X = I()

a = [0,1]
for i in range(2,60):
  if i**5 - a[-1] > X:
    break
  a.append(i**5)
#print(a)

for i,j in itertools.combinations(a, 2):
  #print(i)
  for k,l in ([1,1], [-1,1], [1,-1], [-1,-1]):
    if j*k - i*l == X:
      print(int(j**0.2)*k, int(i**0.2)*l)
      exit()

Submission status: Wrong Answer

Solution code:
import sys
import os
import math
import bisect
import collections
import itertools

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def f(a, b):
    return pow(a, 5) - pow(b, 5)


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    X = ii()
    for a in range(41):
        for b in range(41):
            if X == f(a, -b):
                print(a, -b)
                exit()
            if X == f(a, b):
                print(a, b)
                exit()


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False

def main():
    X = int(input())
    ROOT = 1/5
    for a in range(-100000, 100000):
        a5 = a ** 5
        b = a5 - X
        b_root = abs(b)**ROOT
        if not is_integer_num(b_root):
            continue
        if b < 0:
            if a5 + b_root ** 5 == X:
                print(a, -int(b_root))
                exit()
        else:
            if a5 - b_root ** 5 == X:
                print(a, int(b_root))
                exit()

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
X = int(input())

for a in range(0, 101):
    for b in range(-100, 101):
        if (a**5) - (b**5) == X:
            print(a, b)
            exit()

Submission status: Wrong Answer

Solution code:
x = int(input())
import math
for i in range(100):
    a = x - (i ** 5)
    print("i", i, "a", a)
    if a > 0:
        v = math.pow(a, 1.0/5.0)
        if v.is_integer():
            print("v", v)
            print(v, -i)
            break
    else:
        v = math.pow(-a, 1.0 / 5.0)
        if v.is_integer():
            print("v", v)
            print(i, v)
            break

Submission status: Wrong Answer

Solution code:
from math import pow, ceil
from itertools import product

X = int(input())
max_X = ceil(pow(X, 1 / 5))

for a, b in product(range(-max_X, max_X + 1), repeat=2):
    if a ** 5 - b ** 5 == X:
        print(a, b)
        break

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))
import math

X = ii()
i = 0

while True:
    flag = 1
    b5 = i**5 - X
    if b5 < 0:
        b5 *= -1
        flag = -1
    b = b5**(1/5)
    if type(b) == float:
        if math.floor(b) == b:
            print(i, int(flag*b))
            exit()
    i += 1

Submission status: Wrong Answer

Solution code:
X = int(input())
a = 1
while a**5 <= X:
    b5 = X - a**5
    if b5 == 0: print(a, 0); break
    elif b5 < 0:
        b = -1
        while b**5 >= b5:
            if b**5 == b5: print(a, b); break
            b -= 1
        else:
            a += 1; continue
    else:
        b = 1
        while b**5 <= b5:
            if b**5 == b5: print(a, b); break
            b += 1
        else:
            a += 1; continue
    break

Submission status: Wrong Answer

Solution code:

x = int(input())

pow2a = {a ** 5: a for a in range(-100, 100)}

for a_pow, a in pow2a.items():
    b_pow = a_pow - x

    if b_pow in pow2a:
        print(a, pow2a[b_pow])
        exit()

Submission status: Wrong Answer

Solution code:
X = int(input())
n = 1
while(X > n**5):
    n += 1
print(n)
#A>B
#A**5+B**5
for i in range(1,n+1):
    for j in range(0,i+1):
        test = i**5+j**5
        if(X == test):
            print(i,-j)
            exit()
#A**5-B**5
for i in range(n,65):
    for j in range(0,i+1):
        test = i**5-j**5
        if(X == test):
            print(i,j)
            exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# Template 1.0
import sys, re
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(input())
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

dd=defaultdict(int)
#take care of 0
for i in range(0, 81):
    for j in range(i+1):
        temp = i**5 - j**5
        dd[temp] = (i, j)
        temp1 = i**5 + j**5
        dd[temp1] = (i, -j)
# print(len(dd))
x = INT()
if(dd[x]!=0):
    print(dd[x][0], dd[x][1])

Submission status: Wrong Answer

Solution code:
import sys
import math
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
from collections import deque
def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def S(): return sys.stdin.readline().rstrip()
def LS(): return sys.stdin.readline().split()
def LS2(N): return [sys.stdin.readline().split() for i in range(N)]
def FILL(i,h): return [i for j in range(h)]
def FILL2(i,h,w): return [FILL(i,w) for j in range(h)]
def FILL3(i,h,w,d): return [FILL2(i,w,d) for j in range(h)]
def FILL4(i,h,w,d,d2): return [FILL3(i,w,d,d2) for j in range(h)]
def sisha(num,digit): return Decimal(str(num)).quantize(Decimal(digit),rounding=ROUND_HALF_UP)
#'0.01'や'1E1'などで指定、整数に戻すならintをかます
MOD = 1000000007
INF = float("inf")
sys.setrecursionlimit(10**5+10)
#input = sys.stdin.readline
X = I()
five_l = [-1]*200
f=0
for a in range(200):
    five_l[a]=pow(a,5)
    now = five_l[a]
    for i in range(a+1):

        search = five_l[i]
        if search+now==X:
            f = 1
            break
        elif now-search == X:
            print(a,i)
            f = 1
            break
    if f==1:
        break

Submission status: Wrong Answer

Solution code:
x = int(input())
A=[a**5 for a in range(5)]
for b in range(10000):
    tmp=x+b**5
    if tmp in A:
        print(A.index(tmp),b)
        exit()
    tmp=x-b**5
    if tmp in A:
        print(A.index(tmp),-b)
        exit()

Submission status: Wrong Answer

Solution code:
X = int(input())
for a in range(-100, 100+1):
  for b in range(-100, 100+1):
    if pow(a, 5) - pow(b, 5) == X:
      print(a, b)
      exit()

Submission status: Wrong Answer

Solution code:
I=lambda : list(map(int,input().split()))
a,=I();f=0
r=[j**5 for j in range(-100,101)]
for i in range(len(r)):
    for j in range(len(r)):
        if r[i]-r[j]==a:
            print(i-100,j-100);f=1;break
    if f:
        break

Submission status: Wrong Answer

Solution code:
x=int(input())
i=0
while True:
    i+=1
    b=(i**5-x)
    if(b<0):
        b*=-1
        b=b**(1/5)
        b*=-1
    else:
        b=b**(1/5)
    if(b==int(b)):
        print(i,int(b))
        break

Submission status: Wrong Answer

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

def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False

def main():
    X = int(input())
    ROOT = 1/5
    for a in range(-1000, 1000):
        a5 = a ** 5
        b = a5 - X
        b_root = abs(b)**ROOT
        if not is_integer_num(b_root):
            continue
        if b < 0:
            if a5 + b_root ** 5 == X:
                print(a, -int(b_root))
                exit()
        else:
            if a5 - b_root ** 5 == X:
                print(a, int(b_root))
                exit()

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:

import sys
from math import pow
from math import floor
def main():
    x = int(input())
    ta = int(floor(pow(x, 1.0/5.0)))
    tx = int(pow(ta,5))
    if x == tx:
        print(int(ta), 0)
        sys.exit()
    elif x > tx:
        tb = -1
        while True:
            tb5 = int(pow(tb,5))
            if tx - tb5 == x:
                print(ta, tb)
                sys.exit()
            elif tx - tb5 > x:
                break
            tb -= 1
    ta += 1
    tx = int(pow(ta,5))
    tb = 1
    while True:
        tb5 = int(pow(tb,5))
        if tx - tb5 == x:
            print(ta, tb)
            sys.exit()
        elif tx - tb5 < x:
            break
        tb += 1

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from sys import stdin

x = int(stdin.readline().rstrip())

fivelist = []

i = 0
while True:
    n = i**5
    # print(i,n)
    if n > (10**10):
        break
    fivelist.append(n)
    i += 1

a = 0
b = 0
for i in range(len(fivelist)):
    for j in range(len(fivelist)):
        if x == (fivelist[i] - fivelist[j]):
            a, b = i, j
            break
        if x == (-fivelist[i] - fivelist[j]):
            a, b = -i, j
            break
        if x == (fivelist[i] + fivelist[j]):
            a, b = i, -j
            break
        if x == (-fivelist[i] + fivelist[j]):
            a, b = -i, -j
            break

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

Submission status: Wrong Answer

Solution code:
d = {}
for i in range(-63,63):
	temp = i**5
	if temp not in d:
		d[temp] = i

posd = {}
for i in range(1,63):
	temp = i**5
	if temp not in posd:
		posd[temp] = i

x = int(input())
for i in posd:
	if i-x in d:
		print(posd[i],d[i-x])
		break

Submission status: Wrong Answer

Solution code:
x=int(input())
a=0
while True:
    b=a**5-x
    if b<0:
        b=-((-b)**(1/5))
    else:
        b=b**(1/5)
    try:
        c=int(b)
    except:
        a+=1
    else:
        if b==c:
            print(str(a)+" "+str(c))
            break
        else:
            a+=1

Submission status: Wrong Answer

Solution code:
import sys
import os
import math
import bisect
import collections
import itertools

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def f(a, b):
    return pow(a, 5) - pow(b, 5)


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    X = ii()
    for a in range(41):
        for b in range(41):
            if X == f(a, -b):
                print(a, -b)
                exit()


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
import math
from collections import deque
import heapq
import itertools
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

X = I()

a = [0,1]
for i in range(2,60):
  if i**5 - a[-1] > X:
    break
  a.append(i**5)
#print(a)

for i,j in itertools.combinations(a, 2):
  print(i)
  for k,l in ([1,1], [-1,1], [1,-1], [-1,-1]):
    if j*k - i*l == X:
      print(int(j**0.2)*k, int(i**0.2)*l)
      exit()

Submission status: Wrong Answer

Solution code:
X = int(input())

x = int(pow(X, 0.2) // 1)
y1 = x - pow(10, 6)
y2 = x + pow(10, 6)


for B in range(y1, y2 + 1):
  A = pow(X + pow(B, 5), 0.2) 
  #print(A)
  if type(A) != complex:
    if int(A) == A:
      print(int(A), B)
      quit()

Submission status: Wrong Answer

Solution code:
import math
X = int(input())
i = 1
while(i <= math.sqrt(X)):
  if(X % i == 0):
    A = 0
    B = A-i
    while(abs(A) <= abs(B)):
      if(A**4 + (A**3)*B + (A**2)*(B**2) + A*(B**3) + B**4 == X//i):
        print(A, B)
        break
      A += 1
      B += 1
  i += 1

Submission status: Wrong Answer

Solution code:
import numpy as np

x = int(input())
power = ""

for a in range(-100, 100):
    for b in range(-100, 100):
        if np.power(a, 5)^-np.power(b, 5) == x:
            power = f"{a} {b}"
            break
    if not power == "":
        break

print(power)

Submission status: Wrong Answer

Solution code:
x = int(input())
p, q = 0, 0
for a in range(-64, 65):
    for b in range(-64, 65):
        if a**5 - b**5 == x:
            p, q = a, b
print(p, q)