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: Runtime Error

Solution code:
x = int(input())
a = []

for i in range(100):
    num = i ** 5
    a.append(num)

for i in range(100):
    for j in range(i, 100):
        if a[i] - a[j] == x:
            ans = str(i) + ' ' + str(j)
        elif a[i] + a[j] == x:
            ans = str(i) + ' -' + str(j)
        elif a[j] - a[i] == x:
            ans = '-' + str(i) + ' -' + str(j)

print(ans)

Submission status: Runtime Error

Solution code:
ans = set()
i = 0
while i**5 <= 10**10:
    ans.add(i**5)
    ans.add(-i**5)
    i += 1

X = int(input())
for i in ans:
    if X - i in ans:
        print(int(i**0.2), -int((X-i)**0.2))
        break

Submission status: Runtime Error

Solution code:
X = int(input())
i = 0
while True:
  tmp1 = pow(X + pow(i, 5), 1/5)
  if tmp1.is_integer():
    print(int(tmp1), i)
    break
  tmp2 = pow(X - pow(i, 5), 1/5)
  if tmp2.is_integer():
    print(int(tmp2), -i)
    break
  else:
    i += 1

Submission status: Runtime Error

Solution code:
X = int(input())
A = [i for i in range(0, 100)]
B = [-i for i in range(0, 100)]
res = []
for i in range(len(A)):
  a = A[i]
  for j in range(len(B)):
    b = B[j]
    cal = a ** 5 - b ** 5
    if cal == X:
      res.append([a, b])
print(' '.join(map(str, res[0])))

Submission status: Runtime Error

Solution code:
X = int(input())

for B in range(10 ** 5):
    num = X + (B ** 5)
    num = num ** 0.2
    if num.is_integer():
        num = int(num)
        print(max(num, B), min(num, B))
        exit()
    num = X - (B ** 5)
    num = num ** 0.2
    if num.is_integer():
        num = int(num)
        print(max(num, -B), min(num, -B))
        exit()

Submission status: Runtime Error

Solution code:
x = int(input())

b = 0
while True:
	if ((x + b**5)**(1/5)).is_integer():
		a = (x + b**5)**(1/5)
		break
	elif ((x - b**5)**(1/5)).is_integer():
		a = (x - b**5)**(1/5)
		b = -1*b
		break
	b += 1


print(int(a), b)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10 ** 6)  # 再帰関数の再帰の深さを設定
to_index = lambda x: int(x) - 1  # 入力した数字に1を引いたものを返す
print_list_in_2D = lambda x: print(*x, sep="\n")  # リストの要素を改行を挟んで表示する関数

# 入力を整数に変換して受け取る
def input_int():
    return int(input())

def map_int_input():
    return map(int, input())

MII = map_int_input

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

def MII_to_index():
    return map(to_index, input())

def MII_split_to_index():
    return map(to_index, input().split())

# 入力全てを整数に変換したものの配列を受け取る
def list_int_inputs():
    return list(map(int, input()))

LII = list_int_inputs

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

# 2次元リスト化
def LII_2D(rows_number):
    return [LII() for _ in range(rows_number)]

def LII_split_2D(rows_number):
    return [LII_split() for _ in range(rows_number)]

X = input_int()

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        return 2
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            return f
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
        return n
    return n

A_B = prime_factorize(X)
A = 1
while True:
    B = A - A_B
    num = A ** 4 + A ** 3 * B + A ** 2 * B ** 2 + A * B ** 3 + B ** 4
    if X % num == 0:
        print(A, B)
        return
    A += 1

Submission status: Runtime Error

Solution code:
x=int(input())

b=0
while True:
    p,m=b, -b
    xp, xm = x+p**5, x+m**5
    if (xp**(1/5)).is_integer():
        ans=[int(xp**(1/5)),p]
        break
    if (xm**(1/5)).is_integer():
        ans=[int(xm**(1/5)),m]
        break
    b+=1

print(" ".join(list(map(str,ans))))

Submission status: Runtime Error

Solution code:

# input
X = int( input() )
maxA = 1000
pow5 = list()
for aa in range(maxA):
    pow5.append( aa**5 )
    
# calc    
ans = False
a = 0
b = 0
for ii in range(maxA):  
    if( ans==False ):
        X1 = X - pow5[ii]
        X2 = X + pow5[ii]
        if( X1 in pow5 ):
            b = - ii
            a = pow5.index( X1 )
            ans = True
        
    if( ans==False ):
        if( X2 in pow5 ):
            b = ii
            a = pow5.index( X1 )
            ans = True

# out
print( str(a)+' '+str(b) )

Submission status: Runtime Error

Solution code:
N , K = map( int , input().strip().split(" ") ) ;

arr = [ 1 for x in range ( N ) ] ;
for x in range ( K ) :
	r = input() ;
	for x in map( int, input().strip().split(" ") ) :
		arr[x-1] = 0 ;
print ( sum( arr ) ) ;

Submission status: Runtime Error

Solution code:
def main():
    from builtins import int, map, list, print, len
    import sys
    sys.setrecursionlimit(10 ** 6)

    input = sys.stdin.readline
    input_list = (lambda: input().rstrip().split())
    input_number = (lambda: int(input()))
    input_number_list = (lambda: list(map(int, input_list())))

    X = input_number()
    t = []
    i = 0
    while True:
        x = i ** 5
        t.append(x)
        if x > 10 ** 9:
            break
        i += 1
    d = {}
    for i in range(len(t)):
        for j in range(len(t)):
            d[t[i] - t[j]] = [i, j]
            d[t[i] + t[j]] = [i,-j]
            d[-t[i] - t[j]] = [-i, j]
            d[-t[i] + t[j]] = [-i, -j]
    print(d[X][0],d[X][1])

if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline

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

    for b in range(10**9):
        y = ((x + (-1 * b)**5)**(1/5)).is_integer()
        if y:
            print(int((x - b**5)**(1/5)), -1*b)
            break


if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

a = 1
x = int(input())
while True:
    bz = (x-a**5)**.2
    if float.is_integer(bz):
        print(int(bz), -a)
        exit()
    a += 1

Submission status: Runtime Error

Solution code:
x = int(input())
a = []
for i in range(-10**4, 10**4):
    a.append(i**5)
    # print(i**5)
for i in a:
    if x - i in a:
        A = int(pow(i, 1/5))
        B = int(pow(x-i, 1/5))
        print(A, B)
        break

Submission status: Runtime Error

Solution code:
x = int(input())
n = 0
for i in range(100):
    d[0][i] = i**5
    d[i][0] = i**5
    if i**5 == x:
        n = i
if n !=0:
    print(n,0)
else:
    for i in range(1,100):
        for j in range(1,100):
            d[i][j] = d[0][j]+d[i][0]
            if d[i][j] > x:
                n = i
                break
            elif d[i][j] == x:
                print(i,-j)
                n = i
                break
        if n == i:
            break

Submission status: Runtime Error

Solution code:
x = int(input())
b = 0
ans = []
while True:
    n = x - b**5
    a = int(n ** (1/5))
    if a**5 == n:
       ans.append(a)
       ans.append(-b)
       break
    b += 1

print(*ans)

Submission status: Runtime Error

Solution code:
x = int(input())

b = 0
while True:
    if int((x + b ** 5) ** 0.2) == (x + b ** 5) ** 0.2:
        a = int((x + b ** 5) ** 0.2)
        break
    elif int((x - b ** 5) ** 0.2) == (x - b ** 5) ** 0.2:
        a = int((x - b ** 5) ** 0.2)
        b *= -1
        break
    else:
        b += 1

print(str(a) + " " + str(b))

Submission status: Runtime Error

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

l = []
for i in range(0, 1000):
    l.append(i ** 5)

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

Submission status: Runtime Error

Solution code:
x = int(input())
temp = int(x ** 0.25)
for i in range(-temp, temp + 1):
    temp2 = int((i ** 5 + x) ** 0.2)
    if temp2 ** 5 - i ** 5 == x:
        print(temp2, i)
        break
    temp3 = int((i ** 5 - x) ** 0.2)
    if i ** 5 - temp3 ** 5 == x:
        print(i, temp3)
        break

Submission status: Runtime Error

Solution code:
import sys
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
def resolve():
    X = ir()
    c = {0:0}
    cnt = 1
    while True:
        c[pow(cnt, 5)] = cnt
        r = cnt-X
        if r in c.keys():
            print(c[cnt], c[r])
            break
        if -r in c.keys():
            print(c[cnt], -c[-r])
            break
        cnt += 1
resolve()

Submission status: Runtime Error

Solution code:
# input
X = int( input() )
maxA = 70
pow5 = list()
for aa in range(maxA):
    pow5.append( aa**5 )
    
# calc    
ans = False
a = 0
b = 0
for ii in range(maxA):  
    if( ans==False ):
        X1 = X - pow5[ii]
        X2 = X + pow5[ii]
        if( X1 in pow5 ):
            b = - ii
            a = pow5.index( X1 )
            ans = True
        
    if( ans==False ):
        if( X2 in pow5 ):
            b = ii
            a = pow5.index( X1 )
            ans = True

# out
print( str(a)+' '+str(b) )

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline


def main():
    X = int(input().rstrip())
    B = -1
    for i in range(100):
        if X - 1 == i ** 5:
            A = i
            break

    print(A, B)


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
x=int(input())

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

Submission status: Runtime Error

Solution code:
import sys, math
import bisect, heapq
import collections

sys.setrecursionlimit(10 ** 6)

input = sys.stdin.readline

gets = lambda: input().rstrip()
getn = lambda: int(input())
getmul = lambda: (int(i) for i in input().split())
getlist = lambda: [int(i) for i in input().split()]

x = getn()


for b in range(0, 10000):
    # print(b)
    b5 = b ** 5
    a5 = x + b5

    a = a5 ** (1 / float(5))

    if a.is_integer():
        print(int(a), b)
        exit()

    a5 = x - b5
    a = a5 ** (1 / float(5))

    if a.is_integer():
        print(int(a), -b)
        exit()

Submission status: Runtime Error

Solution code:
x = int(input());

for b in range(114514):
    #bが正の場合
    try:
        a = (x + b ** 5) ** (1 / 5)
    except:
        pass;
    else:
        if a % 1 == 0:
            break;
  
    #bが負の場合
    try:
        b = - b
        a = (x + b ** 5) ** (1 / 5)
    except:
        pass
    else:
        if a % 1 == 0:
            break;
    
print(int(a),b)

Submission status: Runtime Error

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

def show():
    for i in range(100):
        print(i, i**5)

def solve(X: int):
    A = [(i ** 5, i) for i in range(100)]
    for a, b in A:
        for aa, bb in A:
            if a  - aa == X:
                return b, -bb
            if a + aa == X:
                return b, bb
    raise


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
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
    print(*solve(X))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()
    #show()

Submission status: Runtime Error

Solution code:
import sympy

sympy.var('A B')

X = A ** 5 - B ** 5
print(sympy.factor(X))

X = int(input('X: '))



print('A:', A)
print('B:', B)

Submission status: Runtime Error

Solution code:
import math

x=int(input())
l=[]

for i in range(100):
    a=i**5
    if a>10**9:
        break
    else:
        l.append(a)
        l.append(-a)
for j in l:
    for k in l:
        aa=j-k
        if j!=k and aa==x:
            ans=[]
            for z in [j,k]:
                aaa=abs(z)**(1/5)
                if z>=0:
                    ans.append(int(aaa))
                else:
                    ans.append(int(-aaa))
    
print(*ans)

Submission status: Runtime Error

Solution code:
X = int(input())
k = list(range(0,X))
k5 = []
for i in k:
    k5.append(i**5)
for j in k5:
    if X + j in k5:
        print(k[k5.index(X+j)],k[k5.index(j)])
        exit()
    elif X - j in k5:
        print(k[k5.index(X-j)],-k[k5.index(j)])
        exit()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
X=int(input())
five=[i**5 for i in range(100) ]
flg=0
for i in range(len(five)):
    for j in range(len(five)):
        if five[i]+five[j]==X:
            flg=1
            ans_1=i
            ans_2=-j
        if five[i]-five[j]==X:
            ans_1=i
            ans_2=j
print(ans_1,ans_2)

Submission status: Runtime Error

Solution code:
X=int(input())
if (X**0.2)%1==0:
    a=int(X**0.2)
    b=0
    print(a,b)
else:
    b=1
    while b<1002:
        if ((X+b**5)**0.2)%1==0:
            a=int((X+b**5)**0.2)
            print(a,b)
            exit()
        else:
            b+=1
    c=-1
    while c>-1002:
        if ((X+c**5)**0.2)%1==0:
            a=int((X+c**5)**0.2)
            print(a,c)
            exit()
        else:
            c-=1

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10 ** 6)  # 再帰関数の再帰の深さを設定
to_index = lambda x: int(x) - 1  # 入力した数字に1を引いたものを返す
print_list_in_2D = lambda x: print(*x, sep="\n")  # リストの要素を改行を挟んで表示する関数

# 入力を整数に変換して受け取る
def input_int():
    return int(input())

def map_int_input():
    return map(int, input())

MII = map_int_input

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

def MII_to_index():
    return map(to_index, input())

def MII_split_to_index():
    return map(to_index, input().split())

# 入力全てを整数に変換したものの配列を受け取る
def list_int_inputs():
    return list(map(int, input()))

LII = list_int_inputs

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

# 2次元リスト化
def LII_2D(rows_number):
    return [LII() for _ in range(rows_number)]

def LII_split_2D(rows_number):
    return [LII_split() for _ in range(rows_number)]

X = input_int()

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        return 2
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            return f
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
        return n
    return n

A_B = prime_factorize(X)
A = 1
while True:
    if X % A == 0:
        print(A, A - A_B)
        return
    A += 1

Submission status: Runtime Error

Solution code:
import math

X = int(input())


def calculate(x):

    loop = True
    b = 0
    while loop:
        tmp1 = x + b ** 5
        a1 = math.pow(tmp1, 1 / 5)

        if float.is_integer(a1):
            print(int(a1), int(b))
            break

        tmp2 = x + (-1 * b) ** 5
        a2 = math.pow(tmp2, 1 / 5)
        if float.is_integer(a2):
            print(int(a2), int(-1*b))
            break
        b = b + 1


calculate(X)

Submission status: Runtime Error

Solution code:
import math


def main():
    X = int(input())

    MAX = int(math.pow(10 ** 10, 1 / 5))

    for b in range(0, MAX + 1):
        a = math.pow(abs(b ** 5 + X), 1 / 5)
        # print(f'b={b} a={a}')
        if a == int(a):
            print(int(a), b)
            return

        a = math.pow(abs(b ** 5 - X), 1 / 5)
        # print(f'b={-b} a={a}')
        if a == int(a):
            print(-int(a), b)
            return

    raise ValueError()


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import sys

x = int(input())
flag = False
a = 0

while True:
    if x - a**5 <= 0:
        b_sub = pow(x - a**5,1/5)
    else:
        b_sub = (-1)*pow(x - a**5,1/5)
    # if int(b_sub) - b_sub == 0:
    if b_sub.is_integer():
        # flag = True
        print(a,int(b_sub))
        sys.exit()
    a += 1

Submission status: Runtime Error

Solution code:
x = int(input())
for i in range(-10000, 10000):
    a = i
    b = (x - a**5) ** (1/5)
    if(b == int(b)):
        if(x - a**5 > 0):
            b = -b
        break
print(a, int(b))

Submission status: Runtime Error

Solution code:
x=int(input())
t=True
for i in range(1,36):
  a5=i**5
  for j in range(36):
    if x==a5-j**5:
      a=i
      b=j
      t=False
      break
    elif x==a5+j**5:
      a=i
      b=-j
      t=False
      break
  if not t:
    break
print(a,b)

Submission status: Runtime Error

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

    divisors.sort()
    return divisors
  
x = int(input())
lis = make_divisors(x)
for i in range(0, len(lis)):

  for j in range(-100,100):
    if (j+lis[i])**5 -j**5 ==x:
      ans = str(j+lis[i])+' '+str(j)
      break

print(ans)

Submission status: Runtime Error

Solution code:
x = int(input())

for a in range(1, 1001001001):
    b = (x - a**5)
    if b != 0:
        if b > 0 and b ** 0.2 == int(b ** 0.2):
            print(a, int(b ** 0.2))
            break
        else:
            b = -1*b
            if b ** 0.2 == int(b ** 0.2):
                print(a, -1*int(b ** 0.2))
                break

Submission status: Runtime Error

Solution code:
### ----------------
### ここから
### ----------------

import sys
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline
    x=int(readline())
    to=6000
    memo=[0]*to
    #memo={}
    for i in range(to):
        memo[i]=i**5

    for i in range(to):
        z1=x-memo[i]
        z2=memo[i]-x
        if z1 in memo:
            a=i
            for j in range(to):
                if memo[j]==z1:
                    b=j*-1
            break
        if z2 in memo:
            a=i
            for j in range(to):
                if memo[j]==z1:
                    b=j
            break

    print(a,b)

    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

### ----------------
### ここまで 
### ----------------

Submission status: Runtime Error

Solution code:
n = int(input())
ans = n

a=[]
while n % 2 == 0:
  a.append(2)
  n //=2
f = 3
while f*f <= n:
  if n%f == 0:
    a.append(f)
    n //= f
  else:
    f += 2
if n != 1:
  a.append(n)

print(ans)
for i in range(10**9):
  x = i
  y = x-a[0]
  if x**5 - y**5 == ans:
    print(x,y)
    break

Submission status: Runtime Error

Solution code:
x = int(input())

m = 2*10**9
l = []

a = 0
b = 0
while b <= m:
  b = a**5
  l.append(b)
  a += 1
  
flg = 0
for i in range(len(l)):
  if flg == 1:
    break
  for j in range(i+1,len(l)):
    if l[i] + l[j] == x:
      res = [i,-j]
      flg = 1
      break
    elif l[i] - l[j] == x:
      res = [i,j]
      flg = 1
      break

print(res[0],res[1])

Submission status: Runtime Error

Solution code:
x = int(input())
temp = int(x ** 0.25)
for i in range(-temp, temp + 1):
    temp2 = int((i ** 5 + x) ** 0.2)
    if temp2 ** 5 - i ** 5 == x:
        print(temp2, i)
        break

Submission status: Runtime Error

Solution code:
from decimal import *
x=int(input())

for i in range (100):
  h=Decimal(x)-Decimal(i)**Decimal('5')
  if h<=0:
    bh=Decimal(h)**Decimal('0.2')
    if Decimal(bh)%1==0:
      print(i,int(bh))
      exit()
  else:
    hh=abs(h)
    bh=Decimal(hh)**Decimal('0.2')
    if Decimal(bh)%1==0:
      print(i,(-1)*int(bh))
      exit()

Submission status: Runtime Error

Solution code:
ans = set()
i = 0
while i**5 <= 2*10**9:
    ans.add(i**5)
    ans.add(-i**5)
    i += 1

X = int(input())
for i in ans:
    if X - i in ans:
        print(int(i**0.2), -int((X-i)**0.2))
        break

Submission status: Runtime Error

Solution code:
#include<iostream>
#include<cmath>
using namespace std;

int main(void){
  int x;
  double y;
  
  cin >> x;
  
  int i = -10;
  while(i>-100){
    y = x + pow(i, 5.0);
    y = pow(y, 0.2);
    if(floor(y) == y)
      break;
    i++;
  }
  cout << (int)y << ' ' << i;
     
  return 0;
}

Submission status: Runtime Error

Solution code:
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
L=make_divisors(X)
#print(L)
Y=False
ans=[]
for x in L:
    a=0
    while True:
        tmp=a**5-(a-x)**5
        if tmp==X:
            Y=True
            ans=[a,a-x]
            break
        if tmp>X:
            break
        a+=1
        #print(tmp)
    if Y:
        break
print(ans[0],ans[1])

Submission status: Runtime Error

Solution code:
def calc(a, b):
    return a**4+a**3*b+a**2*b**2+a*b**3+b**4

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

x = int(input())
div = make_divisors(x)
ans = 0
for yakusu in div:
    num = x // yakusu
    left = 0
    right = int(num**0.25) + 1
    while left+1 < right:
        mid = (left+right) // 2
        a, b = mid, mid-yakusu
        result = calc(a, b)
        if abs(result) > num:
            right = mid
        else:
            left = mid
    if abs(calc(right, right-yakusu)) == num:
        ans = (right, right-yakusu)
        break
    if abs(calc(left, left-yakusu)) == num:
        ans = (left, left-yakusu)
        break

if ans[0]**5 - ans[1]**5 > 0:
    print(ans[0], ans[1])
else:
    print(ans[1], ans[0])

Submission status: Runtime Error

Solution code:
X = int(input())

for i in range(X):
    B = i**5
    B_ = (-1*i)**5
    A_pow = pow(X + B,1/5)
    A_minus_pow = pow(X + B_,1/5)
    if A_pow.is_integer():
        print(int(A_pow),int(B))
        break
    elif A_minus_pow.is_integer():
        print(int(A_minus_pow),int(B_))
        break

Submission status: Runtime Error

Solution code:
x = int(input())
flag = False
a = 0

while flag == False:
    if x - a**5 <= 0:
        b_sub = pow(x - a**5,1/5)
    else:
        b_sub = (-1)*pow(x - a**5,1/5)
    if b_sub.is_integer():
        flag = True
        print(a,int(b_sub))
    a += 1

Submission status: Runtime Error

Solution code:
x = int(input())
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

temp = prime_factorize(x)
ma = min(temp)
a = 0
b = 0
if x == 1:
    print(0,-1)
else:
    for i in range(ma+1):
        a = ma-i
        b = a-ma
        #print(a,b)
        if a**4+(a**3)*b+(a**2)*(b**2)+a*(b**3)+b**4 == max(temp):
            print(a,b)
            break

Submission status: Runtime Error

Solution code:
x = int(input())
for a in range(10**4):
    for b in range(-10**4,10**4):
        if a**5 - b**5 == X:
            print(a,b)
            break
    else:
        continue
    break

Submission status: Runtime Error

Solution code:
inf = 10**15
mod = 10**9+7
x = int(input())
for i in range(-10**5, 10**5+1):
    tmp = i**5-x
    b = int(abs(tmp)**(1/5))
    if b**5 == abs(tmp):
        if tmp > 0:
            print('{} {}'.format(i, b))
        else:
            print('{} {}'.format(i, -b))
        sys.exit()

Submission status: Runtime Error

Solution code:
x = int(input());

for b in range(114514):
  #bが正の場合
  a = (x + b ** 5) ** (1 / 5)
  
  if a % 1 == 0:
    break;
  
  #bが負の場合
  b = - b
  a = (x + b ** 5) ** (1 / 5)
  
  if a % 1 == 0:
    break;
    
print(int(a),b)

Submission status: Runtime Error

Solution code:
X = int(input())
p = 1e9

n = 1
C = [0]
while n**5 < p:
    C.append(n)
    n += 1

for i in C:
    for j in C:
        if i**5 + j**5 == X:
            a, b = i, -j
            break
        elif i**5 - j**5 == X:
            a, b = i, j
            break

print(a, b)

Submission status: Runtime Error

Solution code:
X = int(input())

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

Submission status: Runtime Error

Solution code:
import numpy as np
x = int(input())
k = 10000
a = np.arange(-k, k)[:, np.newaxis]
b = np.arange(-k, k)
 
res = a**5 - b**5  == x
res.nonzero()
ans = (np.argwhere(res) - k )[0]
print(ans[0],ans[1])

Submission status: Runtime Error

Solution code:
from math import sqrt, log, pow
num = [i**5 for i in range(-1, 150)]
c = 0
def solve(X):
    try:
        for i in range(len(num)):
            a = num[i]
            for j in range(i+1):
                if a - num[j] == X:
                    x, y = i-1, j-1
                    # print(i-1, j-1)
                    assert x**5-y**5 == X
                    return x, y
    except IndexError:
        print(0)
print(*solve(int(input())))

Submission status: Runtime Error

Solution code:
from decimal import *
x=int(input())

for i in range (100):
  h=Decimal(x)-Decimal(i)**Decimal('5')
  if h<0:
    bh=Decimal(h)**Decimal('0.2')
    if Decimal(bh)%1==0:
      print(i,int(bh))
      exit()
  else:
    hh=abs(h)
    bh=Decimal(h)**Decimal('0.2')
    if Decimal(bh)%1==0:
      print(i,(-1)*int(bh))
      exit()

Submission status: Runtime Error

Solution code:
X = int(input())
for A in range(201):
  for B in range(A):
    if A ** 5 - B ** 5 == X:
      Ans = [A, B]
      break
      
print(Ans.split())

Submission status: Runtime Error

Solution code:
def main():
    x = int(input())
    tmp = [0] * 100
    for i in range(100):
        tmp[i] = i**5
    for i in range(100):
        a = x-tmp[i]
        if abs(a) in tmp:
            print(int(a**0.2),i*(a//abs(a)))
            return
if __name__=='__main__':
    main()

Submission status: Runtime Error

Solution code:
X = int(input())

def nb(b):
    if b == 0:
        return 1
    elif b > 0:
        return -b
    else:
        return -b+1

b = 0

while 1:
    # print("b:",b)
    a_est = int((b**5+X)**0.2)
    if a_est**5-b**5==X:
        a = a_est
        break
    elif (a_est+1)**5-b==X:
        a = a_est+1
        break
    
    # print(a_est)
    b = nb(b)

print(a,b)

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

Solution code:
import bisect as bi
import collections as cc
I=lambda:list(map(int,input().split()))
x,=I()
ar=[]
i=1

t=bi.bisect_left(ar,x)
for i in range(-100,100):
    for j in range(-100,100):
        if (i**5)-(j**5)==x:
            print(i,j)
            fl=0
            break
    if not fl:
        break

Submission status: Runtime Error

Solution code:
from math import sqrt, log, pow
num = [i**5 for i in range(-1, 150)]
c = 0
def solve(X):
    try:
        for i in range(len(num)):
            a = num[i]
            for j in range(i+1):
                if a - num[j] == X:
                    x, y = i-1, j-1
                    # print(i-1, j-1)
                    assert x**5-y**5 == X
                    return x, y
    except AssertionError:
        print(0)
print(*solve(int(input())))

Submission status: Runtime Error

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

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: Runtime Error

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

Submission status: Runtime Error

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

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: Runtime Error

Solution code:
x = int(input())

my_dict = dict()

for i in range(10 ** 5):
    my_dict[i**5] = i

for i in range(-10 ** 5, 10 ** 5):
    target = x + (i ** 5)
    if target in my_dict:
        print(my_dict[target], i)
        exit()
    elif - target in my_dict:
        print(-my_dict[target], i)
        exit()

Submission status: Runtime Error

Solution code:
X = int(input())
b = 0.0
c = True

while c:
    if ((X + b**5)**0.2).is_integer():
        c = False
        a = int(((X + b**5)**0.2))
    elif b == 0:
        b = 1.0
    elif b > 0:
        b = -1.0*b
    else:
        b = -1*b + 1
        
print(a, int(b))

Submission status: Runtime Error

Solution code:
#N, M = list(map(int, input().strip().split()))
X = int(input())

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

Submission status: Runtime Error

Solution code:
X = int(input())

p = [0]*1000

flag = False
for i in range(1000):
    p[i] = i**5

for i in range(1,1000):
    for j in range(1,1000):
        if p[i]-p[j] == X or flag:
            a = i
        
            b = j
            flag=True
        if p[i] + p[j] ==X or flag:
            a=i
            b=-j
            flag=True
        if flag:
            break
    if flag:
        break

print(str(a)+" "+str(b))