Problem:


Score : 400 points

Problem Statement

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

Constraints

1 \leq X \leq 10^9

X is an integer.

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

Input

Input is given from Standard Input in the following format:

X

Output

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

A B

Sample Input 1

33

Sample Output 1

2 -1

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

Sample Input 2

1

Sample Output 2

0 -1



Sample input:
33


Sample output:
2 -1

Submission status: Wrong Answer

Solution code:
X = int(input())

num = [0] * 100
for i in range(len(num)):
    num[i] = i ** 5

for i in range(len(num)):
    for j in range(len(num)):
        if num[i] + num[j] == X:
            print(i, j)
            exit()
        if num[i] - num[j] == X:
            print(i, -j)
            exit()
        if num[j] + num[i] == X:
            print(j, i)
            exit()
        if num[j] - num[i] == X:
            print(-i, j)
            exit()

Submission status: Wrong Answer

Solution code:
# D - I hate Factorization

X = int(input())

fact = []
for i in range(101):
    fact.append(pow(i,5))

for i in range(101):
    for j in range(101):
        if fact[j]-fact[i]==X:
            print(j, i)
            break
        elif fact[j]+fact[i]==X:
            print(j, -i)
            break
    else:
        continue
    break

Submission status: Wrong Answer

Solution code:
from math import *
x=int(input())
for a in range(99):
  b=a**5-x
  if b<0: b=-((-b)**.2)
  else: b**=.2
  if b.is_integer():
    print(a,int(b))
    break

Submission status: Wrong Answer

Solution code:
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))

from collections import defaultdict
from sys import exit
import math

from bisect import  bisect_left
def main():
    x = getN()
    ruis = [i**5 for i in range(-100000, 100000)]
    # print(ruis)
    for a in ruis:
        b = a - x
        if b > ruis[-1]:
            continue
        idx = bisect_left(ruis, b)
        if ruis[idx] == b:
            # print(a, b, x, idx)
            print(a , idx - 100000)
            return

    print(k[100])

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
    else:
        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:
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
from fractions import gcd
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])
 
def main():
    x = inp()
    if x == 0:
        print(1,1)
    for a in range(1,10**3):
        if 10**9 < 5*(a**4):
            break
        for b in range(-10**2,a):
            if a**5-b**5 == x:
                print(a,b)
                return
    
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
x=int(input())
import math
for a in range(10000000000):
    if a**5 >= x :
        B=a**5-x
        b = math.pow(B, 1.0/5.0)
        #print(b)
        if b.is_integer()==True:
            b=int(b)
            print(a,b)
            break
    else:
        B=x-a**5
        b=math.pow(B, 1.0/5.0)
        #print(b)
        if b.is_integer()==True:
            b=int(b)
            print(a,-b)
            break

Submission status: Wrong Answer

Solution code:
def binarySearch(arr, l, r, key):
    if r>=1:
        m = (l+r)//2
        if arr[m] == key:
            return m
        elif arr[m] > key:
            return binarySearch(arr, l, m, key)
        else:
            return binarySearch(arr, m+1, r, key)
    else:
        return -1

n = 100
positive_arr = [elm**5 for elm in range(n)]
negative_arr = [-elm for elm in positive_arr]
arr = negative_arr
arr.extend(positive_arr)
# print(arr)
x = int(input())
negative_a, negative_b, printed = False, False, False
for a in arr:
    for b in arr:
        if a - b == x:
            if a<0:
                a *= -1
                negative_a = True
            if b<0:
                b *= -1
                negative_b = True
            a = int(a**(1/5))
            b = int(b**(1/5))
            if negative_a:
                a *= -1
            if negative_b:
                b *= -1
            print(a,b)
            printed = True
            break
    if printed:
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x=int(input())
for i in range(10**9):
    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 math
def main():

    X = int(input())
    v = int(pow(X, 0.25)) + 1
    for A in range(-v, v+1):
        c = pow(A, 5)
        for B in range(-v, v+1):
            if c - pow(B, 5) == X:
                return A, B
    return -1


if __name__ == '__main__':
    print(main())

Submission status: Wrong Answer

Solution code:
x = int(input())
r = x**(1/5)

for i in range(int(r)+1):
    for j in range(-int(r), int(r)+1, 1):
        if i**5-j**5 == x:
            print(i, j)
            break
    else:
        continue
    
    break

Submission status: Wrong Answer

Solution code:
from sys import stdin
X = int(stdin.readline().strip())
 
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
 
divisors = make_divisors(X)
for i in range(len(divisors)):
  gap = divisors[i]
  other = X // gap
  for a in range(10^10):
    b = a - gap
    if (a**4 + (a**3)*b + (a**2)*(b**2) + a*(b**3) + b**4)==other:
      print(a, b)
      break
    a = a*(-1)
    b = a - gap
    if (a**4 + (a**3)*b + (a**2)*(b**2) + a*(b**3) + b**4)==other:
      print(a, b)
      break

Submission status: Wrong Answer

Solution code:
X = int(input())
C = 0
for i in range(-40,40):
	if C == 1:
		break
	for j in range(-40,40):
		if i**5-j**5 == X:
			print(i,j)
			C += 1
			break

Submission status: Wrong Answer

Solution code:
import math


def task(x):
    table = {}
    for i in range(-1000, 1000):
        table[i] = int(math.pow(i, 5))

    for i in range(-1000, 1000):
        for j in range(-1000, 1000):
            if table[i] - table[j] == x:
                print(table[i], table[j])
                return
    print(0)


x = int(input())

task(x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
print(str(int(pow(x-1,1/5)))+' '+str(-1))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def find(x):
    b = 0
    while True:
        right = pow(b,5)+x
        left = pow(right,1/5)
        if left-int(left)==0:
            return left, b
        right = pow(-b,5)+x
        if right>=0:
            left = pow(right,1/5)
            if left-int(left)==0:
                return left, -b
        else:
            left=pow(-right, 1/5)
            if left-int(left)==0:
                return -left, -b
        b+=1
x = int(input())
a,b = find(x)
print(int(a),b)

Submission status: Wrong Answer

Solution code:
x = int(input())


c = 0
l = []
idx = []
while True:
    idx.append(c)
    i = c**5
    l.append(i)
    
    if i > 5*10**9:
        break
    
    c += 1


for i in l:
    for j in l:
        if i - j == x:
            a = i
            b = j
            print(l.index(a), l.index(b))
            exit()
        
        elif i + j == x:
            a = i
            b = j
            print(l.index(a), -l.index(b))
            exit()

Submission status: Wrong Answer

Solution code:
from math import *

a=[]
for i in range(-101,101):
	a.append([int(pow(i,5)),i])

b=[]
for i in range(len(a)):
	for j in range(len(a)):
		if a[i][0]-a[j][0]>0:
			b.append([a[i][0]-a[j][0],a[i][1],a[j][1]])

x=int(input())

for i in range(len(b)):
	if b[i][0]==x:
		print(b[i][1],b[i][2])
		break

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

Submission status: Wrong Answer

Solution code:
x = int(input())

n = 250
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:
import itertools


def calc(num):
    abs_result = abs(num) ** (1/5)
    if num < 0:
        return int(-abs_result)
    else:
        return int(abs_result)


X = int(input())

s = set()
for i in range(0, 101):
    s.add(i**5)
    s.add(-i**5)

for comb in itertools.combinations(s, 2):
    if comb[0] - comb[1] == X:
        A = calc(comb[0])
        B = calc(comb[1])
        print(A, B)
        break
    if comb[1] - comb[0] == X:
        A = calc(comb[1])
        B = calc(comb[0])
        print(A, B)
        break

Submission status: Wrong Answer

Solution code:
def resolve():
    X= int(input())
    nums = dict()
    for A in range(10**4):
        nums[A**5] = A
        nums[-A**5] = A        

        if A**5 - X in nums:
            print(A,nums[A**5-X])
            return
    



    

if __name__ == "__main__":
    resolve()
    #unittest.main()

Submission status: Wrong Answer

Solution code:
x = int(input())
x = 15**5-8**5
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
make_divisors(10**9)
for i in range(0,200):
  for j in range(0,200):
    if i**5+j**5 == x:
      print(i,-j)
      quit()
l = make_divisors(x)
for i in l:
  b = 0
  a = b+i
  if (a**5-b**5)%10 != x%10:
    continue
  while True:
    a = b+i
    if a**5-b**5 < x:
      b += 1
    elif a**5-b**5 > x:
      break
    else:
      print(a,b)
      quit()
print(l)

Submission status: Wrong Answer

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

for i in range(100):
    for j in range(1,100):
        tmp = (i*i*i*i*i) + (j*j*j*j*j)
        if x == tmp:
            a = i
            b = -j
            break

for i in range(100):
    for j in range(1,100):
        tmp = (i*i*i*i*i) - (j*j*j*j*j)
        if x == tmp:
            a = i
            b = j
            break

print(a,b)

Submission status: Wrong Answer

Solution code:
X = int(input())

A = 0

while A ** 5 <= 10 ** 9:
    temp = X - A ** 5
    if temp >= 0:
        B = int(pow(temp, 1/5))
    else:
        B = -int(pow(-temp, 1/5))
    if A ** 5 + B ** 5 == X:
        print(A, -B)
        break
    A += 1

Submission status: Wrong Answer

Solution code:
import math

X = int(input())

for i in range(1001):
    f = float((X + i ** 5) ** 0.2)
    if f.is_integer():
        print(int((X + i ** 5) ** 0.2), i)
        exit()

for i in range(1, 10):
    f = float(abs(X - i ** 5) ** 0.2)
    if f.is_integer():
        if X - i ** 5 > 0:
            print(int((X - i ** 5) ** 0.2), -i)
            exit()
        else:
            print(-int(abs(X - i ** 5) ** 0.2), -i)
            exit()

Submission status: Wrong Answer

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


for a in range(-1000, 1000):

    # ubとlbは余裕を持って大きく（小さく）取っておく
    ub = 99999999
    lb = -99999999
    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:
#!/usr/bin/env python3
import sys

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

def lef(a, b):
    return a*a*a*a + a*a*a*b + a*a*b*b + a*b*b*b + b*b*b*b

def solve(X: int):
    divs = make_divisors(X)
    for d in divs:
        # a-b = divs
        base = 0
        upper = X // d
        while(lef(base+d,base) < upper):
            base+=1
        if lef(base+d,base) == upper:
            print(base+d,base)
            return
        base = -1
        while(lef(base+d,base) < upper):
            base -= 1
        if lef(base+d, base) == upper:
            print(base+d, base)
            return
    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())
flag = False
for A in range(0,100):
    for B in range(-100, 100):
        if A**5 - B**5 == X:
            print(A,B)
            flag = True
            break
    if flag: 
        break

Submission status: Wrong Answer

Solution code:
import sys
stdin = sys.stdin
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

X=int(input())
ans=[0]*2
for i in range(1,1000):
    for j in range(i+1,1001):
        if(j**5-i**5==X):
            ans[0]=j
            ans[1]=i

for i in range(1,1001):
    for j in range(i+1,1001):
        if(j**5+i**5==X):
            ans[0]=j
            ans[1]=-i


print(*ans)

Submission status: Wrong Answer

Solution code:
import math


def task(x):
    table = {}
    for i in range(-1000, 1000):
        table[i] = math.pow(i, 5)

    for i in range(-1000, 1000):
        for j in range(-1000, 1000):
            if table[i] - table[j] == x:
                print(table[i], table[j])
                return
    print(0)


x = int(input())

task(x)

Submission status: Wrong Answer

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

posd = {}
for i in range(1,100):
	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:
import math
X = int(input())


def get_yakusu(P):
    yakusu = []
    for i in range(1, int(math.sqrt(P))+1):
        if P % i == 0:
            yakusu.append(i)
            if i != int(P / i):
                yakusu.append(int(P / i))
    return yakusu


X_yakusu = get_yakusu(X)
print(X_yakusu)
flag = False
for x in X_yakusu:
    if flag:
        break
    A_candidates = get_yakusu(abs(int(X // x) - x ** 4))
    if len(A_candidates) == 0:
        A_candidates = [0]
    for A in A_candidates:
        B = A - x
        if A ** 5 - B ** 5 == X:
            print(A, B)
            break

Submission status: Wrong Answer

Solution code:
x = int(input())

def solve(x):
	for first in range(-65, 66):
		for sec in range(-65, 66):
			if first**5 - sec**5 == x:
				print(first, sec)
				return

solve(x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
X = int(input())
MOD = 10**9+7
M = [i for i in range(0, 10**2)]
def function(a, b):
  c = (a-b)%MOD
  return c * ((a**4)%MOD + ((a**3)%MOD * b)%MOD + ((a**2)%MOD * (b**2)%MOD)%MOD + (a * (b**3)%MOD)%MOD + (b**4)%MOD)
for i in M:
  for j in M:
    for m in [-1, 1]:
      for n in [-1, 1]:
        if function(i*m, j*n)%MOD == (X)%MOD:
          print(i*m, j*n)
          sys.exit(0)

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)
    i += 1
i = 0
beki = 0
while abs(beki) < (10 ** 9 * 3):
    beki = pow(i, 5)
    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(x) for x in input().split()]

M = 10 ** 5
fifthRoot = {}
for i in range(-M, M + 1):
    fifthRoot[i ** 5] = i

for a5 in fifthRoot.keys():
    if a5 + X in fifthRoot:
        b5 = a5 + X
        a = fifthRoot[a5]
        b = fifthRoot[b5]
        print(a, b)
        exit()

Submission status: Wrong Answer

Solution code:
x = int(input())

a = [i for i in range(150)]
a5 = [pow(i, 5) for i in range(150)]
for i in range(150):
    for j in range(150):
        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())
m = n % 10

def calc(a, b):
  return a**5 - b**5
  
lst = []
for i in range(-1000, 1000):
  lst.append(calc(i+m, i))
  
for i in range(0, 2000):
  if lst[i] == n:
    print(i - 1000 + m, i - 1000)
    break

Submission status: Wrong Answer

Solution code:
def main():

    from bisect import bisect_left as bl, bisect_right as br, insort
    import sys,heapq,math
    from collections import defaultdict as dd, deque
    def data(): return sys.stdin.readline().strip()
    def mdata(): return list(map(int, data().split()))
    out = sys.stdout.write
    # sys.setrecursionlimit(100000)
    INF = int(1e9)
    mod = int(1e9)+7

    x=int(data())
    a=0
    while True:
        b=(abs(a**5-x))**(1/5)
        if int(b)==b:
            if a**5-x<0:
                b=-b
            print(a,int(b))
            break
        a+=1

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())

x = -1 * pow(10, 3)
y = pow(10, 3)

for B in range(x, y):
  A = pow(X + pow(B, 5), 0.2) 
  if type(A) != complex:
    if int(A) == A:
      print(int(A), B)
      quit()

Submission status: Wrong Answer

Solution code:
import math


def main():
    x = int(input().strip())
    a = 0
    while True:
        b = math.pow(x - a**5, 1 / 5)
        if b == int(b):
            break
    print('{} {}'.format(int(a), int(b)))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

for A in range(100):
  C = A ** 5 - X
  if C > 0:
      B = math.sqrt(C)
      if B % 1 == 0:
          print(str(A) + " " + str(B))
          break
    
for B in range(100):
  C = B ** 5 + X
  if C > 0:
      A = math.sqrt(C)
      if A % 1 == 0:
          print(str(A) + " " + str(B))
          break

Submission status: Wrong Answer

Solution code:
x = int(input())

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

Submission status: Wrong Answer

Solution code:
import sys
X = int(input())
X = 72**5
MOD = 10**9+7
M = [i for i in range(0, 10**2)]
def function(a, b):
  c = (a-b)%MOD
  return c * ((a**4)%MOD + ((a**3)%MOD * b)%MOD + ((a**2)%MOD * (b**2)%MOD)%MOD + (a * (b**3)%MOD)%MOD + (b**4)%MOD)
for i in M:
  for j in M:
    for m in [-1, 1]:
      for n in [-1, 1]:
        if function(i*m, j*n)%MOD == (X)%MOD:
          print(i*m, j*n)
          sys.exit(0)

Submission status: Wrong Answer

Solution code:
x = int(input())

number = 1000

minus = False
end = False

a = 0
b = 0

for i in range(number):
    a = i + 1
    a5 = pow(a, 5)
    if a5 < x:
        minus = True
        surplus = x - a5
    else:
        surplus = a5 - x
    if surplus == 0:
        b = 0
        break
    elif a == 1:
        continue
    for j in range(i):
        b = j + 1
        b5 = pow(b, 5)
        if b5 == surplus:
            if minus:
                b = -b
            end = True
            break
    if end:
        break

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
from fractions import gcd
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

def main():
    x = inp()
    for a in range(1,10**3):
        if 10**9 < 5*(a**4):
            break
        for b in range(-10**2,a):
            if a**5-b**5 == x:
                print(a,b)
                return
    
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    X = int(rl())
    
    five_pow = [0]
    i = 1
    while five_pow[-1] < 10 ** 10:
        five_pow.append(i ** 5)
        i += 1
    
    for a in range(len(five_pow)):
        pow_of_a = five_pow[a]
        min_flg = False
        if pow_of_a < X:
            min_flg = True
        b = pow(abs(pow_of_a - X), 1./5.)
        if b.is_integer():
            if min_flg:
                b = -int(b)
            else:
                b = int(b)
            print(a, b)
            exit()


if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
x = int(input())

def check(i):
    a = 1
    while True:
        b = a - i
        temp = pow(a, 5) - pow(b, 5)
        if temp == x:
            return (a, b)
        if temp > x:
            return -1
        a += 1

num = int(x ** 0.5)
for i in range(1, num + 1):
    if x % i == 0:
        temp = check(i)
        temp1 = check(x//i)
        if temp == -1 and temp1 == -1:continue
        else:
            if temp != -1:print(*temp)
            else:print(*temp1)

Submission status: Wrong Answer

Solution code:
import sys
input=lambda: sys.stdin.readline().rstrip()
x=int(input())
A=[int(i) for i in range(5000)]
Ans=[]
for a in A:
  for b in A:
    if a+b**5==x and not Ans:
      Ans=[a,-b]
    if a**5-b**5==x and not Ans:
      Ans=[a,b]
print(*Ans)

Submission status: Wrong Answer

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

for i in range(100):
    for j in range(1,100):
        tmp = (i*i*i*i*i) + (j*j*j*j*j)
        if x == tmp:
            a = i
            b = -j
            break

print(a,b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int( input() )

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

Submission status: Wrong Answer

Solution code:
a=int(input())
k=int(a**(1/int(5)))
f=a-k**5
h=-int(f**(1/int(5)))
print(k,h)

Submission status: Wrong Answer

Solution code:
from itertools import combinations

x = int(input())
num = [i**5 for i in range(1000)]

for a, b in combinations(num, 2):
    if a - b == x:
        print(int(a**0.2), int(b**0.2))
    elif a + b == x:
        print(int(a**0.2), -int(b**0.2))
    elif b - a == x:
        print(int(a**0.2), int(a**0.2))
    elif b + a == x:
        print(int(b**0.2), -int(a**0.2))
    else:
        continue
    break

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 * 2):
    beki = pow(i, 5)
    bekis.add(i)
    i += 1
i = 0
beki = 0
while abs(beki) < (10 ** 9 * 2):
    beki = pow(i, 5)
    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 a in range(1, 10**9):
    tmp = a**5 - x
    if (tmp <= 0):
        tmp *= -1
        
    b = tmp**(1/5)
    if(b == int(b)):
        print(a, int(b))
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

x = ii()
l = [0]
i = 0
num = 0
while num < 10**10:
    i += 1
    num = i**5
    l.append(num)
#print(l[:10])
l = set(l)
for item in l:
    if x - item in l:#Aがitemでx-itemは-B**5
        print(int(item**0.2),int(abs(item-x)**0.2)*(-1))
        exit()
    elif item - x in l:#Aがitemでx-itemはB**5
#        print(item,item-x)
        print(int(item**0.2),int(abs(item-x)**0.2)*(-1))
        exit()

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10 ** 6)

def main():
    X = int(input())
    T = [i**5 for i in range(-100, 100)]
    for ai, a in enumerate(T):
        for bi, b in enumerate(T):
            if a - b == X:
                print(ai-100, bi-100)
                return

if __name__ == '__main__':
    main()