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 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline
from collections import defaultdict
from heapq import heappop, heappush

from decimal import *

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

##### 累乗 #####
# pow(x, y, z) -> x**y % z

##### 割り算の切り上げ #####
# tmp = -(-4 // 3)

##### dict の for文 #####
# for k, v in d.items():
#     print(k, v)

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
def inputStr(): return input()[:-1]

inf = float('inf')
mod = 1000000007

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

def main():
	X = inputInt()

	for A in range(1000):
		for B in range(-1000,0,1):
			if A**5 - B**5 == X:
				print("{} {}".format(A,B))
				sys.exit()
	print("{} {}".format(-1,-1))


#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# nCr mod m
# rがn/2に近いと非常に重くなる
def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res

# mを法とするaの乗法的逆元
def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

def egcd(a, b):
    if a == 0:
        return b, 0, 1
    else:
        g, y, x = egcd(b % a, a)
        return g, x - (b // a) * y, y

# nHr mod m
# 問題によって、combination()を切り替えること
def H(n, r, mod=10**9+7):
	# comb = Combination(n+r-1, mod)
	# return comb(n+r-1, r)
    return combination(n+r-1, r, mod)


class Combination:
    """
    O(n)の前計算を1回行うことで，O(1)でnCr mod mを求められる
    n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)
    使用例：
    comb = Combination(1000000)
    print(comb(5, 3))  # 10
    """
    def __init__(self, n_max, mod=10**9+7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def make_factorial_list(self, n):
        # 階乗のリストと階乗のmod逆元のリストを返す O(n)
        # self.make_modinv_list()が先に実行されている必要がある
        fac = [1]
        facinv = [1]
        for i in range(1, n+1):
            fac.append(fac[i-1] * i % self.mod)
            facinv.append(facinv[i-1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        # 0からnまでのmod逆元のリストを返す O(n)
        modinv = [0] * (n+1)
        modinv[1] = 1
        for i in range(2, n+1):
            modinv[i] = self.mod - self.mod//i * modinv[self.mod%i] % self.mod
        return modinv

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# dfs のサンプル
def dfs(graph,parent,counter,edge):
    stk = []
    stk.append(edge)
    while len(stk) > 0:
        p = stk.pop()
        for e in graph[p]:
            if parent[p] == e:
                continue
            else:
                parent[e] = p
                counter[e] += counter[p]
                stk.append(e)

if __name__ == "__main__":
	main()

Submission status: Wrong Answer

Solution code:
x = int(input())
d = []
for i in range(-100, 100):
    d.append([i**5, i])

for j in range(len(d)):
    for i in range(len(d)):
        tmp = d[i][0] - d[j][0]
        if x == tmp:
            print(d[i][1], d[j][1])
            exit()

Submission status: Wrong Answer

Solution code:
import sys
x = int(input())
for b in range(-100, 100):
    a = (x+b**5)**(1/5)
    if type(a) == float:
        int_a = int(a)
        if int_a**5 - b**5 == x:
            print(int(a), b)
            exit()

Submission status: Wrong Answer

Solution code:
import numpy as np
import math
x = int(input())
flag = False
for i in range(10**10):
    for j in range(1,10**10):
        if (i+j)**5-i**5 == x:
            print(i+j,j)
            flag = True
            break
        elif (i+j)**5-i**5 > x:
            break
    if flag:
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
for b in range(-100, 100):
    v = b ** 5 + x
    p = pow(v, 0.2)
    if p == p.real:
       print(int(p.real), b)
       break

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
from bisect import bisect_left,bisect_right
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    X=int(input())
    l=[i**5 for i in range(65)]
    for i,a in enumerate(l):
        for j,b in enumerate(l):
            if a+b==X:
                print(j,-i)
                exit()
            elif a-b==X:
                print(j,i)
                exit()
    

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
x=int(input())

f=[i for i in range(-64,65)]

from itertools import combinations as cmb
ok=False
for b,a in cmb(f,2):
    if x==a**5-b**5:
        ok=True
        aa=a
        bb=b
        break
if ok:print(aa,bb)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline
from collections import defaultdict
from heapq import heappop, heappush

from decimal import *

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

##### 累乗 #####
# pow(x, y, z) -> x**y % z

##### 割り算の切り上げ #####
# tmp = -(-4 // 3)

##### dict の for文 #####
# for k, v in d.items():
#     print(k, v)

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
def inputStr(): return input()[:-1]

inf = float('inf')
mod = 1000000007

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

def main():
	X = inputInt()

	for A in range(100):
		for B in range(-100,0,1):
			if A**5 - B**5 == X:
				print("{} {}".format(A,B))
				sys.exit()
	print("{} {}".format(-1,-1))










#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# nCr mod m
# rがn/2に近いと非常に重くなる
def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res

# mを法とするaの乗法的逆元
def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

def egcd(a, b):
    if a == 0:
        return b, 0, 1
    else:
        g, y, x = egcd(b % a, a)
        return g, x - (b // a) * y, y

# nHr mod m
# 問題によって、combination()を切り替えること
def H(n, r, mod=10**9+7):
	# comb = Combination(n+r-1, mod)
	# return comb(n+r-1, r)
    return combination(n+r-1, r, mod)


class Combination:
    """
    O(n)の前計算を1回行うことで，O(1)でnCr mod mを求められる
    n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)
    使用例：
    comb = Combination(1000000)
    print(comb(5, 3))  # 10
    """
    def __init__(self, n_max, mod=10**9+7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def make_factorial_list(self, n):
        # 階乗のリストと階乗のmod逆元のリストを返す O(n)
        # self.make_modinv_list()が先に実行されている必要がある
        fac = [1]
        facinv = [1]
        for i in range(1, n+1):
            fac.append(fac[i-1] * i % self.mod)
            facinv.append(facinv[i-1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        # 0からnまでのmod逆元のリストを返す O(n)
        modinv = [0] * (n+1)
        modinv[1] = 1
        for i in range(2, n+1):
            modinv[i] = self.mod - self.mod//i * modinv[self.mod%i] % self.mod
        return modinv

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# dfs のサンプル
def dfs(graph,parent,counter,edge):
    stk = []
    stk.append(edge)
    while len(stk) > 0:
        p = stk.pop()
        for e in graph[p]:
            if parent[p] == e:
                continue
            else:
                parent[e] = p
                counter[e] += counter[p]
                stk.append(e)

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 ** 5 - j ** 5 == x:
            print(i, j)
            exit()

Submission status: Wrong Answer

Solution code:
import sys
X = int(input())
MAX = 10**9
M = [0]
i = 1
while i**5 <= MAX:
  M.append(i)
  i+=1
#print(M)
  
for i in M:
  for j in M:
    for m in [-1, 1]:
      for n in [-1, 1]:
        ifi = m * (i**5)
        jfi = n * (j**5)
        if ifi - jfi == X:
          print(i*m, j*n)
          sys.exit(0)

Submission status: Wrong Answer

Solution code:
import math
s = int(input())
b = -1
while True:
    a = s + (b**5)
    if a != 0:
        temp_a = math.log(a, 2)
        if temp_a == math.floor(temp_a):
            print("{} {}".format(math.floor(temp_a), b))
            break
    else:
        print("{} {}".format(a, b))
        break

    b += 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
for b in range(-100, 100):
    v = b ** 5 + x
    p = pow(v, 0.2)
    if p == p.real:
       print(p.real, b)
       break

Submission status: Wrong Answer

Solution code:
"""
aを10^3くらいまででいいよね
"""
x = int(input())
for i in range(-10^3,10^3): #b
    for j in range(i,10^3): #a
        # print(i,j)
        if j**5-i**5 == x:
            print(j,i)
            exit()

Submission status: Wrong Answer

Solution code:
x = int(input())

i = 0
tmp = []
while True:
    _tmp = i ** 5
    if _tmp > 10 ** 9:
        break
    else:
        tmp.append(_tmp)
        i += 1

tmpset = set(tmp)

for i in range(len(tmp)):
    if x - tmp[i] in tmpset:
        break

a = i
b5 = x - tmp[i]

for j in range(len(tmp)):
    if tmp[j] == b5:
        break

b = j

a, b = max(a, b), min(a, b)

print(a, -b)

Submission status: Wrong Answer

Solution code:
import math
X=int(input())
for a in range(-math.ceil(X**0.2),math.ceil(X**0.2)+1):
    for b in range(-a,a+1):
        if a**5-b**5==X:
            print(a,b)
            break

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
input = sys.stdin.readline

pattern = [(item**5, item) for item in range(-110, 110)]
x = int(input())

for a, i in pattern:
    for b, j in pattern:
        if a == x + b:
            print(i, j)
            exit()

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(-3000, 3000)]
    # print(ruis)
    for a in (1, 3001):
        b = (a ** 5) - x
        if b > ruis[-1]:
            continue
        idx = bisect_left(ruis, b)
        if ruis[idx] == b:
            # print(a, b, x, idx)
            print(a ** 5, idx - 3000)
            return

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

x = INT()

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())
for A in range(1010):
    for B in range(1010):
        if A**5+B**5==X:
            print(A, -B)
            exit()

Submission status: Wrong Answer

Solution code:
x = int(input())
d = []
for i in range(100):
	d.append( [i,i ** 5] )
	d.append( [ -i, (-i) ** 5 ] )
import sys
y = d
for i in y:
	for j in y:
		if i[1] - j[1] == x:
			print(i[0],j[0])
			exit(0)

Submission status: Wrong Answer

Solution code:
from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations # (string,3) 3回
from collections import deque
from collections import defaultdict
import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    X = int(input())
    import math
    for b in range(-20000,20000,1):
        a = X + pow(b,5)
        if a != 0:
            p = pow(a,-5)
        #print(a,b,p)
        if int(p) == p:
            print(a,b)
            exit()
if __name__ == '__main__':
  main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**8)
INF = float("inf")


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


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 a in range(-100,101):
    for b in range(-100,101):
        if(a**5 - b**5 == x):
            print(' '.join(map(str,[a,b])))
            exit()

Submission status: Wrong Answer

Solution code:
x = int(input())
flag = False
for a in range(0, 101):
  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 math
x = int(input())
for b in range(-100000, 100000):
    v = b ** 5 + x
    p = pow(v, 0.2)
    if p == p.real:
       print(int(pow(v, 0.2)), b)
       break

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
x = int(input())

b = -1
a = pow(x + b ** 5, 1/5)
print(int(a), b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
for b in range(-10000, 10000):
    v = b ** 5 + x
    p = pow(v, 0.2)
    if p == p.real:
       print(int(pow(v, 0.2)), b)
       break

Submission status: Wrong Answer

Solution code:
x=int(input())
for a in range(-100,101):
  for b in range(-100,101):
      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(1000):
  for j in range(1000):
    if i**5 - j**5 == x:
      print(i,j)
      break

Submission status: Wrong Answer

Solution code:
def get_divisor(n: int) -> list:
    divisor = []
    for i in range(1, n + 1):
        if i * i > n:
            break
        if n % i == 0:
            divisor.append(i)
            if n // i != i:
                divisor.append(n // i)
    # divisor.sort() # if you want sorted divisors
    return divisor


x = int(input())
cand = get_divisor(x)
# print(cand)
for d in cand:
    a = d
    b = 0
    while a**5 - b**5 < x:
        a += 1
        b += 1
    if a**5 - b**5 == x:
        print(a, b)
        break

    a = d - 1
    b = -1
    while a**5 - b**5 < x:
        a -= 1
        b -= 1
    if a**5 - b**5 == x:
        print(a, b)
        break

Submission status: Wrong Answer

Solution code:
X = int(input())
for A in range(100):
    B5 = A**5-X
    for B in range(-100, 100):
        if B**5 == B5:
            print(A, B)
            exit()

Submission status: Wrong Answer

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

for i in range(-100,100):
	B = i**5
	A5 = X + B
	T = abs(A5)
	C = T**0.2
	if int(C)==C:
		if T!=A5:C=-C
		print(str(int(C)) + ' ' + str(i))
		sys.exit()

Submission status: Wrong Answer

Solution code:
lis = [i ** 5 for i in range(-300,300)]
x = int(input())
for i in range(len(lis)):
    for j in range(len(lis)):
        if lis[i] + lis[j] == x:
            print(i-300,j-300)
            exit()

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
for b in range(-10000, 10000):
    v = b ** 5 + x
    p = pow(v, 0.2)
    if v == pow(p, 5):
       print(int(pow(v, 0.2)), b)
       break

Submission status: Wrong Answer

Solution code:
x = int(input())

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

Submission status: Wrong Answer

Solution code:
x = int(input())
if x == 2:
    print(1, -1)
    exit(0)
for d in range(1, int(x ** 0.5) + 1):
    if x % d == 0:
        for w in [-d, -x//d, d, x // d]:
            l = w
            r = 10 ** 20
            while r - l > 1:
                m = (l + r) // 2
                if m ** 5 - (m - w) ** 5 <= x:
                    l = m
                else:
                    r = m
            for ep in range(-10, 10):
                if (l + ep) ** 5 - (l + ep - w) ** 5 == x:
                    print(l + ep, l + ep - w)
                    exit(0)

Submission status: Wrong Answer

Solution code:
x = int(input())
if x == 2:
    print(1, -1)
    exit(0)
for d in range(1, int(x ** 0.5) + 1):
    if x % d == 0:
        for w in [-d, -x//d, d, x // d]:
            l = w
            r = 10 ** 30
            while r - l > 1:
                m = (l + r) // 2
                if m ** 5 - (m - w) ** 5 <= x:
                    l = m
                else:
                    r = m
            for ep in range(-10, 10):
                if (l + ep) ** 5 - (l + ep - w) ** 5 == x:
                    print(l + ep, l + ep - w)
                    exit(0)

Submission status: Wrong Answer

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

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

X = input_int()

def divs(n):
    i = 1
    res = []
    while i * i <= n:
        if n % i == 0:
            res.append(i)
            res.append(n // i)
        i += 1
    return res

import sys

for d in divs(X):
    for i in range(-10000, 10000):
        if (i + d) ** 5 - i ** 5 == X:
            print(i, i + d)
            sys.exit(0)

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(-3000, 3000)]
    # print(ruis)
    for a in (1, 301):
        b = (a ** 5) - x
        if b > ruis[-1]:
            continue
        idx = bisect_left(ruis, b)
        if ruis[idx] == b:
            # print(a, b, x, idx)
            print(a ** 5, idx - 300)
            return

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math
x=int(input())
f = math.floor(x ** (1/5)) * 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=" ")

Submission status: Wrong Answer

Solution code:
x = int(input())
if x == 2:
    print(1, -1)
    exit(0)
for d in range(1, int(x ** 0.5) + 1):
    if x % d == 0:
        for w in [d, x // d]:
            l = w
            r = 10 ** 30
            while r - l > 1:
                m = (l + r) // 2
                if m ** 5 - (m - w) ** 5 <= x:
                    l = m
                else:
                    r = m
            for ep in range(-10, 10):
                if (l + ep) ** 5 - (l + ep - w) ** 5 == x:
                    print(l + ep, l + ep - w)
                    exit(0)

Submission status: Wrong Answer

Solution code:
def solve():
   x = int(input())
   for a in range(-100,100):
      for b in range(-100,100):
         n = a**5 - b**5
         if n == x:
            print(a,end=" ")
            print(b)
            return
solve()

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=" ")

Submission status: Wrong Answer

Solution code:
def divisor(n):
    res = []
    for i in range(1,int(n**0.5)+1):
        if n%i == 0:
            res.append(i)
            if i**2 == n:
                continue
            res.append(n//i)
    return res
import sys
x = int(input())
res = sorted(divisor(x))
for r in res:
    for i in range(200):
        if i**5-(i+r)**5 == x:
            print(i+r, i)
            sys.exit()
for i in range(200):
    for j in range(200):
        if i**5+j**5 == x:
            print(i, -j)
            sys.exit()

Submission status: Wrong Answer

Solution code:
x = int(input())
if x == 2:
    print(1, -1)
    exit(0)
for d in range(1, int(x ** 0.5) + 1):
    if x % d == 0:
        for w in [d, x // d]:
            l = -1
            r = 10 ** 30
            while r - l > 1:
                m = (l + r) // 2
                if m ** 5 - (m - w) ** 5 <= x:
                    l = m
                else:
                    r = m
            for ep in range(-10, 10):
                if (l + ep) ** 5 - (l + ep - w) ** 5 == x:
                    print(l + ep, l + ep - w)
                    exit(0)

Submission status: Wrong Answer

Solution code:
x = int(input())
if x == 2:
    print(1, -1)
    exit(0)
for d in range(1, int(x ** 0.5) + 1):
    if x % d == 0:
        for w in [d, x // d]:
            l = -1
            r = 10 ** 18
            while r - l > 1:
                m = (l + r) // 2
                if m ** 5 - (m - w) ** 5 <= x:
                    l = m
                else:
                    r = m
            if l ** 5 - (l - w) ** 5 == x:
                print(l, l - w)
                exit(0)

Submission status: Wrong Answer

Solution code:
x = int(input())
for d in range(1, int(x ** 0.5) + 1):
    if x % d == 0:
        for w in [d, x // d]:
            l = -1
            r = 10 ** 18
            while r - l > 1:
                m = (l + r) // 2
                if m ** 5 - (m - w) ** 5 <= x:
                    l = m
                else:
                    r = m
            if l ** 5 - (l - w) ** 5 == x:
                print(l, l - w)
                exit(0)

Submission status: Time Limit Exceeded

Solution code:
X=int(input())

for a in range(10**5):
  for b in range(10**5):
    if a**5-b**5==X:print(a,b);exit()
    elif a**5+b**5==X:print(a,-b);exit()

Submission status: Time Limit Exceeded

Solution code:
x=int(input())
a=0
while True:
    for b in range(10**2):
        if a**5-b**5==x:
            print(a,b)
            exit()
        elif a**5+b**5==x:
            print(a,-b)
            exit()
        elif -a**5+b**5==x:
            print(-a,-b)
            exit()
    a+=1

Submission status: Time Limit Exceeded

Solution code:
import sys
import heapq
from decimal import Decimal

input = sys.stdin.readline

x = int(input())


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

Submission status: Time Limit Exceeded

Solution code:
x = int(input())
for b in range(-int(x**(1/5)),10**7):
    a5 = b**5 + x
    if a5**(1/5) == a5**(1/5)//1:
        print(int(a5**(1/5)),b)
        break

Submission status: Time Limit Exceeded

Solution code:
x = int(input())
for b in range(-int(x**(1/5)),10**8):
    a5 = b**5 + x
    if a5**(1/5) == a5**(1/5)//1:
        print(int(a5**(1/5)),b)
        break

Submission status: Time Limit Exceeded

Solution code:
x = int(input())
for b in range(-int(x**(1/5)),10**9):
    a5 = b**5 + x
    if a5**(1/5) == a5**(1/5)//1:
        print(int(a5**(1/5)),b)
        break

Submission status: Time Limit Exceeded

Solution code:
def fact(n):
    L = []
    i = 1
    while i*i <= n:
        if n % i == 0:
            L.append(i)
        i += 1
    return L

X = int(input())
N = -X if X < 0 else X
L = fact(N)
for e in L:
    if pow(e, 5, 5) !=  N%5: continue
    b = -e
    while True:
        a = b+e
        if a**5 - b**5 == N:
            ans = (b, a) if X < 0 else (a, b)
            print(str(ans[0]), str(ans[1]))
            exit()
        b += 1

Submission status: Time Limit Exceeded

Solution code:
a=int(input())
b=0
c=int(a**(1/2))
for i in range(-1500,1500):
    for j in range(-1500,1500):
        if((i**5)-(j**5)==a):
            b=1
            break
    if(b==1):
        break
print(i,j)

Submission status: Time Limit Exceeded

Solution code:
a=int(input())
b=0
c=int(a**(1/2))
for i in range(-2000,2000):
    for j in range(-2000,2000):
        if((i**5)-(j**5)==a):
            b=1
            break
    if(b==1):
        break
print(i,j)

Submission status: Time Limit Exceeded

Solution code:
a=int(input())
b=0
c=int(a**(1/2))
for i in range(c+1):
    for j in range(-c,c):
        if((i**5)-(j**5)==a):
            b=1
            break
    if(b==1):
        break
print(i,j)

Submission status: Time Limit Exceeded

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

a = math.floor(x**(1/5))
while True:
    b = (x-a**5)**(1/5)
    if b % 1 == 0:
        print(a, -int(b))
        break
    a -= 1

Submission status: Time Limit Exceeded

Solution code:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    x = int(input())
    p1 = 1
    while True:
        p15 = p1 ** 5
        rt1 = ((x + p15) ** 0.2) % 1
        if rt1 == 0:
            r = (int((x + p15) ** 0.2), p15)
            break
        if (x - p15) < 0:
            pass
        else:
            rt2 = ((x - p15) ** 0.2) % 1
            if rt2 == 0:
                r = (int((x - p15) ** 0.2), -p15)
                break
        p1 += 1
    print(*r, sep=' ')
if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

import math
x = int(input())

#aもbも0以上のとき
border = 1;
while border ** 5 - (border - 1) ** 5 < x:
    border += 1

for i in range(border + 1):
    aa = ((x + i ** 5) ** (1.0 / 5.0)) #仮
    if aa % 1 == 0:
        a = int(aa)
        b = i
        print(a, b)
        break
else:
    while True:
        b = -1
        aa = ((x + b ** 5) ** (1.0 / 5.0))  # 仮
        if aa % 1 == 0:
            a = int(aa)
            print(a, b)
            break
        if x + b ** 5 < 0:
            break
        b -= 1

Submission status: Time Limit Exceeded

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

import math
x = int(input())

#aもbも0以上のとき
border = 1;
while border ** 5 - (border - 1) ** 5 < x:
    border += 1

for i in range(border + 1):
    aa = ((x + i ** 5) ** (1.0 / 5.0)) #仮
    if aa % 1 == 0:
        a = int(aa)
        b = i
        print(a, b)
        break
else:
    while True:
        b = -1
        aa = ((x + b ** 5) ** (1.0 / 5.0))  # 仮
        if aa % 1 == 0:
            a = int(aa)
            print(a, b)
            break
        if x < b:
            break
        b -= 1

Submission status: Time Limit Exceeded

Solution code:
x = int(input())
n=100
tes = [0]
for i in range(-10001,10001):
    for j in range(-10001,10001):
        if pow(i,5) - pow(j,5) == x:
            print(str(i)+" "+str(j))
            exit()

Submission status: Time Limit Exceeded

Solution code:
X=int(input())

for b in range(50000):
  for a in range(int(X**(1/5))+1):
    if a**5-b**5 == X:
      ans = str(a)+" "+str(b)
      break
    if a**5+b**5 == X:
      ans = str(a)+" "+str(-b)
      break
print(ans)

Submission status: Time Limit Exceeded

Solution code:
X=int(input())

for b in range(500000):
  for a in range(int(X**(1/5))+1):
    if a**5-b**5 == X:
      ans = str(a)+" "+str(b)
      break
    if a**5+b**5 == X:
      ans = str(a)+" "+str(-b)
      break
print(ans)