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

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



X = ii()
'''
a = make_divisors(X)
ind = bisect.bisect_left(a, X**0.2)

for num in a[:ind+1]:
    for i in range(num):
        j = num - i
        if i**5 + j**5 == X:
            print(i, (-1)*j)
            exit()
'''
num = int(X**0.2)+1
for i in range(10**6):
    tmp = X - i**5
    b = tmp**0.2
    if math.floor(b) == b:
        print(i, (-1)*int(b))
        exit()
    b2 = ((-1)*tmp)**0.2
    if math.floor(b2) == b2: 
        print(i, int(b2))
        exit()

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

flag = 0
divisors = make_divisors(x)
while flag != -1:
  flag += 1
  p = divisors[flag-1]
  a = 0
  b = 0
  while a**5-b**5 < x:
    a += 1
    b = a-p
    if a**5-b**5 == x:
      print(a,b)
      flag = -1
      break

Submission status: Runtime Error

Solution code:
x=int(input())

for a in range(-10000,10000):
  b=(x+a**5)**(1/5)
  if abs(b%1-0)<=10**(-10):
    print('%d %d'%(a,b))
    exit()

Submission status: Runtime Error

Solution code:
x = int(input())
import math
for i in range(10**9):
    if math.pow(i**5 + x, 1.0/5.0).is_integer():
        print(int(math.pow(i**5 + x, 1.0/5.0)), i)
        break
    elif math.pow(-i**5 + x, 1.0/5.0).is_integer():
        print(int(math.pow(i**5 + x, 1.0/5.0)), -i)
        break

Submission status: Runtime Error

Solution code:
import sys
X = int(input())
# = map(int, input().split())
# = list(map(int, input().split()))
# = [int(input()) for i in range(N)]
# = [list(map(int, input().split())) for i in range(N)]

for i in range(100000):
    C = X + (i**5)
    if C**(1/5)%1 ==0:
        print(int(C**(1/5)), i)
        sys.exit()
    C = X - (i**5)
    if C**(1/5)%1 ==0:
        print(int(C**(1/5)), -i)
        sys.exit()

Submission status: Runtime Error

Solution code:
X = int(input())
B=-1
tmp = X
i=0
flg=0
while True:
    tmp = tmp + B**5
    A = int(tmp**.2)
    if A**5==tmp:
        break
    B -= 1
    tmp = X
    if i>40:
        flg=1
        break
if flg==1:
    A=-1
    while True:
        tmp = tmp + A**5
        B = int(tmp**.2)
        if B**5==tmp:
            break
        A -= 1
        tmp = X
        
print(A, B)

Submission status: Runtime Error

Solution code:
X = int(input())
answer = []
for A in range(10**3):
    for B in range(-10**3,1):
        if A**5 - B **5 == X:
            answer.append([A,B])
print(*answer[0])

Submission status: Runtime Error

Solution code:
X=int(input())
Y=int(X**(0.2))
for i in range(Y,-Y,-1):
    for t in (-Y//2,Y,1):
        if (i**5)-(t**5)==X:
            S=i
            Z=t
            break
        else:
            continue
print(S,Z)

Submission status: Runtime Error

Solution code:
x=int(input())
a=0
b=0
t=0
while a**5<x:
    while b**5<x:
        if a**+b**5==x:
            print(a,-b)
            t=1
            break
        b+=1
    if t==1:
        break
    a+=1
if t==0:
    for i in range(a+1,10**3):
        for j in range(10**3):
            if i**5-j**5==x:
            print(i,j)
            t=1
            break
    if t==1:
        break

Submission status: Runtime Error

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

for a_ in range(3):
    _ = a_**5 - x
    b_ = _**0.2
    if a_**5 - b_**5 ==x:
        a = a_
        b = b_**5
        
print(a, int(b))

Submission status: Runtime Error

Solution code:
X = int(input())

for b in range(X):
    a = X + b ** 5
    a = pow(a, 1.0 / 5.0)
    if a.is_integer():
        A, B = int(a), b
        break
    a = X - b ** 5
    if a < 0:
        continue
    a = pow(a, 1.0 / 5.0)
    if a.is_integer():
        A, B = int(a), -b

if X == 1:
    print(1, 0)
else:
    print(A, B)

Submission status: Runtime Error

Solution code:
x=int(input())

max=int(pow(x,0.2))
a=0
b=0
check=0
for i in range(0,max*max+1):
    tmp_b=-1*pow(x-i**5,0.2)
    if int(tmp_b)==tmp_b:
        a=i
        b=int(tmp_b)
        check+=1
        break
print(a,b)

Submission status: Runtime Error

Solution code:

n = int(input())

l = []
for _ in range(0, 100):
    x = _**5
    if x > 10**9:
        break
    else:
        l.append(x)
tmp = len(l)

for i in range(len(l)):
    l.append(l[i]*-1)

from itertools import combinations
y = (list(combinations(l, 2)))

for j in range(len(y)):
    if y[j][0] - y[j][1] == n:
        z = j

if y[z][0] >= 0:
    a = l.index(y[z][0])
else:
    a = -1 * (l.index(y[z][0]*-1))

if y[z][1] >= 0:
    b = l.index(y[z][1])
else:
    b = -1 * (l.index(y[z][1]*-1))

print(a, b)

Submission status: Runtime Error

Solution code:
X = int(input())
B=-1
tmp = X
i=0
flg=0
while True:
    tmp = tmp + B**5
    A = int(tmp**.2)
    if A**5==tmp:
        break
    B -= 1
    tmp = X
    if i>40:
        flg=1
        break
if flg==1:
    A=1
    while True:
        tmp = tmp + A**5
        B = int(tmp**.2)
        if B**5==tmp:
            break
        A += 1
        tmp = X
        
print(A, B)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
nn = int(pow(n,1/5)) + 1
p = sorted(range(nn),reverse = True)
for i in range(nn,0,-1):
    b = pow(n - i, 1/5)
    if float.is_integer(b):
        break

print(i,int(-b))

Submission status: Runtime Error

Solution code:
X = int(input())

for a in range(int(X ** 0.25 - 1), X + 1):
    b = - (X - a ** 5) ** 0.2

    if b == int(b):
        print(str(a) + " " + str(int(b)))
        break

Submission status: Runtime Error

Solution code:
import sys

def debug(*args):
    print(*args, file=sys.stderr)

# https://www.themathpage.com/Alg/difference-two-squares-2.htm#fifth

# https://qiita.com/snow67675476/items/e87ddb9285e27ea555f8
def factorize(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

def get_factors_of(a_number):
    factorized = factorize(a_number)
    return [factor for factor, _ in factorized]


x_diff_of_5th_factor = int(input())

factors_of_x = get_factors_of(x_diff_of_5th_factor)

# debug(factors_of_x)

for a_factor_of_x in factors_of_x:
    for b in range(a_factor_of_x//2+1):
        a = b + a_factor_of_x

        if a ** 5 - b ** 5 == x_diff_of_5th_factor:
            print('{} {}'.format(a, b))
            sys.exit(0)
sys.exit(1)

Submission status: Runtime Error

Solution code:
x = int(input())

for a in range(1, x):
    for b in range(-a, a):
        if pow(a, 5) - pow(b, 5) == x:
            break
print(a, b)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun May  3 21:48:14 2020

@author: Kei
"""

X = int(input())

i = 0
j = 0


for i in range(0,100):
    A_5 = pow(i,5) + X
    if float(pow(A_5,0.2)).is_integer() == True:
        A = int(pow(A_5,0.2))
        B = i
        break


for j in range(0,100):
    j = -1*j
    if abs(pow(j,5))> X:
        continue
    else:
        A_5 = pow(j,5) + X
        if float(pow(A_5,0.2)).is_integer() == True:
            A = int(pow(A_5,0.2))
            B = j
            break
    


print(A,B)

Submission status: Runtime Error

Solution code:
import sys
X = int(input())
# = map(int, input().split())
# = list(map(int, input().split()))
# = [int(input()) for i in range(N)]
# = [list(map(int, input().split())) for i in range(N)]

for i in range(1000000000):
    C = X + (i**5)
    if C**(1/5)%1 ==0:
        print(int(C**(1/5)), i)
        sys.exit()
    C = X - (i**5)
    if C**(1/5)%1 ==0:
        print(int(C**(1/5)), -i)
        sys.exit()

Submission status: Runtime Error

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

X = int(input())

li = prime_factorize(X)

if len(li) == 2:
  A = li[0]
  B = li[1]
else:
  A = li[0]
  B = li[0]

import numpy as np
ans = np.roots([5, 10*A, 10*A*A, 5*A*A*A, A*A*A*A-B])

li2 = []
for i in range(len(ans)):
  y = np.round(ans[i].real).tolist()
  x = A + y
  if x**5 - y**5 == X:
    break
    
print("{} {}".format(x, y))

Submission status: Runtime Error

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

    pf = {}
    m = X
    for i in range(2, int(m**0.5)+1):
        while m % i == 0:
            pf[i] = pf.get(i, 0)+1
            m //= i
    if m > 1:
        pf[m] = 1

    for i in range(0, len(pf)):
        p = pf.get(i)
        for a in range(1, 60, 1):
            b = a - p
            if X == pow(a, 5) - pow(b, 5):
                print(str(a) + " " + str(b))
                exit()


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
X=int(input())
Ans=[]
for n in range(65):
    for n1 in range(65):
        n2=n**5+n1**5
        if n2 == X:
            Ans.append(n)
            Ans.append(-1*n1)
            break

if len(Ans)==0:
    for n3 in range(80,2700):
        for n4 in range(n3):
            n2=n3**5-n4**5
            if n2 == X:
                Ans.append(n3)
                Ans.append(n4)
                break

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

Submission status: Runtime Error

Solution code:
import sys

sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


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

                if i != n // i:  # 平方数の場合n**0.5を1つだけにしてる
                    divisors.append(n // i)
                    divisors2.append(i)
                    divisors.append(-(n // i))
                    divisors2.append(-i)

        # divisors.sort() # ソートしたけりゃして
        return [divisors, divisors2]

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

        d, d2 = make_divisors(X)[0], make_divisors(X)[1]
        i = 0
        b = 0
        while True:
            a = d[i] + b
            val = a ** 4 + a ** 3 * b + a ** 2 * b ** 2 + a * b ** 3 + b ** 4

            if val == d2[i]:
                return [a, b]
            if val > abs(d2[i]):
                i += 1
                b = 0
                if i >= len(d):
                    break
            else:
                b += 1

        i = 0
        b = -1
        while True:
            a = d[i] + b
            val = a ** 4 + a ** 3 * b + a ** 2 * b ** 2 + a * b ** 3 + b ** 4
            if val == d2[i]:
                return [a, b]
            if val > abs(d2[i]):
                i += 1
                b = -1
                if i >= len(d):
                    break
            else:
                b -= 1

    print(*main())


resolve()

Submission status: Runtime Error

Solution code:
import itertools
import numpy as np

X = int(input())
maxs = int(X**(1/5))

l = np.arange(-maxs-1, maxs+2)

comb = np.array(list(itertools.combinations_with_replacement(l, 2)))

sum1 = comb[:, 0]**5 - comb[:, 1]**5
sum2 = comb[:, 1]**5 - comb[:, 0]**5

try:
    result1 = np.where(sum1==X)[0][0]
    print(comb[result1][0], comb[result1][1])
except:
    result2 = np.where(sum2==X)[0][0]
    print(comb[result2][1], comb[result2][0])

Submission status: Runtime Error

Solution code:
X = int(input())
j = 1
for i in range(1,X//2+2):
  if X%i == 0:
    if i != 1:
      j = i
      break


a_b=j
tmp = X//i
for k in range(-100000,100000):
  b = -k
  a = a_b + b
  if a**5 - b**5 == X:
    print(a,b)
    exit()
  else -a**5 + b**5 == X:
    print(a,b)
    exit()
for k in range(-100000,100000):
  b = -k
  a = tmp + b
  if a**5 - b**5 == X:
    print(a,b)
    exit()
  else -a**5 + b**5 == X:
    print(a,b)
    exit()

Submission status: Runtime Error

Solution code:
import bisect

X = int(input())
five = [i ** 5 for i in range(0,1000)]

left = bisect.bisect_left(five, X) - 1
right = bisect.bisect(five, X)

if abs(five[left]  - X) < abs(five[right]  - X):
  dif = X - five[left]
  b = five.index(dif) * -1
  a = left
else:
  dif = five[right] - X
  b = five.index(dif)
  a = right
  
print(a,b)

Submission status: Runtime Error

Solution code:
import numpy
import math

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

    divisors.sort()
    return divisors

X = int(input())
lis = make_divisors(X)

a = 0, b = 0
for i in range(len(lis)):
    Y = lis[i]
    Z = X // Y
    tmp = numpy.roots([5, 10*Y, 10*pow(Y, 2), 5*pow(Y, 3), pow(Y, 4)-Z])
    ans = []
    for j in range(len(tmp)):
        if round(tmp[j].imag) == 0:
            ans.append(int(tmp[j].real))
    for i in range(len(ans)):
        for j in range(len(ans))
        if i != j:
            tmp = ans[i]**5 - ans[j]**5
            if tmp == X: 
                a = ans[i]
                b = ans[j]
                break

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

Submission status: Runtime Error

Solution code:

"""
=int(input())
=map(int,input().split())
=list(map(int,input().split()))

# アレイ import numpy as np =np.array(list(map(float,input().split())))

# 文字列 =list(str(input()).split(" " or ","))

# 一文字＆連番(縦横可能) =map(int, open(0).read().split())

# 2-d list
lis=[[] for _ in range(M)]
for i in range(M):
    lis[i] = list(map(int,input().split()[0:]))

# Each list
N = int(input())
a = [0] * N
b = [0] * N
c = [0] * N
for i in range(N):
    a[i], b[i], c[i] = map(int, input().split())
"""
import numpy as np


n = int(input())
x=n
pf={}
for i in range(2,int(n**0.5)+1):
    while n % i == 0:
        pf[i] = pf.get(i,0)+1
        n//= i
if n > 1 : pf[n] = 1

from decimal import Decimal
# print((list(pf.keys()))[0]) #素因数分解したときの最小の因数取得
lis=[]
for b in range(-1000000,1000000):
    a=b+int(list(pf.keys())[0])
    siki=Decimal(a**4 + a**3*b + a**2*b**2 + a*b**3 + b**4)
    if siki==Decimal(x/int(list(pf.keys())[0])):
        lis.append((a,b))
print(*lis[0])

Submission status: Runtime Error

Solution code:
X=int(input())
Y=int(X**(0.2))
for i in range(Y,-Y,-1):
    for t in (-Y//2,Y,1):
        if i**5-t**5==X:
            S=i
            Z=t
            break
        else:
            continue
print(S,Z)

Submission status: Runtime Error

Solution code:
X = int(input())
answer = []
for A in range(10**2):
    for B in range(-10**2,0):
        if A**5 - B **5 == X:
            answer.append([A,B])
print(*answer[0])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x=int(input())
a=0
b=0
t=0
while a**5<x:
    while b**5<x:
        if a**+b**5==x:
            print(a,-b)
            t=1
            break
        b+=1
    if t==1:
        break
    a+=1
if t==0:
    for i in range(a+1:10**3):
        for j in range(10**3):
            if i**5-j**5==x:
            print(i,j)
            t=1
            break
    if t==1:
        break

Submission status: Runtime Error

Solution code:
X = int(input())
B=-1
tmp = X
i=0
flg=0
while True:
    tmp = tmp + B**5
    A = int(tmp**.2)
    if A**5==tmp:
        break
    B -= 1
    tmp = X
    if i>40:
        flg=1
        break
if flg==1:
    B=1
    while True:
        tmp = tmp + B**5
        A = int(tmp**.2)
        if A**5==tmp:
            break
        B += 1
        tmp = X
        
print(A, B)

Submission status: Runtime Error

Solution code:
x=int(input())

while True:
    a=random.randint(-1000000000,1000000000)
    b=random.randint(-1000000000,1000000000)
    if x == a*a*a*a*a-b*b*b*b*b:
        print(a,b)
        break

Submission status: Runtime Error

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

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

        p = a1 ** (1 / 5)
        if int(p) == p:
            p = int(p)
            print(p, j)
            break
        if a2 >= 0:
            p = a2 ** (1 / 5)
            if int(p) == p:
                p = int(p)
                print(p, -1 * j)
                break
        else:
            p = abs(b2) ** (1 / 5) * -1
            if int(p) == p:
                p = int(p)
                print(p, -1 * j)
                break
        i += 1


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:

"""
=int(input())
=map(int,input().split())
=list(map(int,input().split()))

# アレイ import numpy as np =np.array(list(map(float,input().split())))

# 文字列 =list(str(input()).split(" " or ","))

# 一文字＆連番(縦横可能) =map(int, open(0).read().split())

# 2-d list
lis=[[] for _ in range(M)]
for i in range(M):
    lis[i] = list(map(int,input().split()[0:]))

# Each list
N = int(input())
a = [0] * N
b = [0] * N
c = [0] * N
for i in range(N):
    a[i], b[i], c[i] = map(int, input().split())
"""
import numpy as np


n = int(input())
x=n
pf={}
for i in range(2,int(n**0.5)+1):
    while n % i == 0:
        pf[i] = pf.get(i,0)+1
        n//= i
if n > 1 : pf[n] = 1

from decimal import Decimal
# print((list(pf.keys()))[0]) #素因数分解したときの最小の因数取得
lis=[]
for b in range(-1000,1000):
    a=b+int(list(pf.keys())[0])
    siki=Decimal(a**4 + a**3*b + a**2*b**2 + a*b**3 + b**4)
    if siki==Decimal(x/int(list(pf.keys())[0])):
        lis.append((a,b))
print(*lis[0])

Submission status: Runtime Error

Solution code:
X = int(input())
arr= list(range(X))    

for i in range(0, X): 
    for j in range(0,X): 
        if arr[i] + arr[j] == X: 
            if str(arr[i]**0.2).split(".")[1] == "0":
                if str(arr[j]**0.2).split(".")[1] == "0":
                    print(int(arr[i]),int(-arr[j]))

Submission status: Runtime Error

Solution code:
X = int(input())
for i in range(1, 1000):
    A = i**5
    B = (A-X)**(1/5)
    if B.is_integer():
      a = int(A)
      b = int(B)
print(f"{a} {b}")

Submission status: Runtime Error

Solution code:
import numpy as np


def solve(vec, is_complex=True):
    dim = len(vec)
    if is_complex:
        A = np.zeros((dim, dim), dtype=complex)
    else:
        A = np.zeros((dim, dim))
    A[np.arange(dim - 1), 1 + np.arange(dim - 1)] = 1
    A[-1, :] = -vec
    ans, vec = np.linalg.eig(A)
    return ans


def make_divisors(n):
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            d = n // i
            try:
                ans = np.array([((i ** 4) -d)/5, (i ** 3), (i ** 2) * 2, i * 2])
                for x in ans:
                    try:
                        if x.is_integer():
                            if x**5-(i-x)**5 == d:
                                return [int(x), int(i-x)]
                    except:
                        continue
            except:
                pass
            try:
                ans = np.array([((d ** 4) -i)/5, (d ** 3), (d ** 2) * 2, d * 2])
                for x in ans:
                    try:
                        if x.is_integer():
                            if x**5-(d-x)**5 == i:
                                return [int(x), int(d-x)]
                    except:
                        continue
            except:
                continue
m=int(input())
print(*make_divisors(m))

Submission status: Runtime Error

Solution code:
#d
import math
d=int(input())

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

ans=[]
for i in range(100):
    a=math.pow(d+(i**5), 1.0/5.0)
    b=math.pow(d-(i**5), 1.0/5.0)
    if is_integer_num(a)==True:
        ans.append(int(a))
        ans.append(int(i))
        break
    if is_integer_num(b)==True:
        ans.append(int(b))
        ans.append(int(-i))
        break
        
print(*ans)

Submission status: Runtime Error

Solution code:
X=int(input())
Ans=[]
for n in range(65):
    for n1 in range(65):
        n2=n**5+n1**5
        if n2 == X:
            Ans.append(n)
            Ans.append(-1*n1)
            break

if len(Ans)==0:
    for n3 in range(80,2500):
        for n4 in range(n3):
            n2=n3**5-n4**5
            if n2 == X:
                Ans.append(n3)
                Ans.append(n4)
                break

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

Submission status: Runtime Error

Solution code:
X = int(input())
arr= list(range(X))    
print(arr)
count = 0 

for i in range(0, X): 
    for j in range(0,X): 
        if arr[i] + arr[j] == X: 
            if str(arr[i]**0.2).split(".")[1] == "0":
                if str(arr[j]**0.2).split(".")[1] == "0":
                    print(int(arr[i]),int(-arr[j]))

Submission status: Runtime Error

Solution code:
"""
import random
import functools
import copy
import bisect
import array
import re
import collections
import heapq
import fractions
import itertools
import string
import math
from operator import itemgetter as ig
from bisect import bisect_left, bisect_right, insort_left, insort_right
from itertools import permutations, combinations, product, accumulate, groupby
from heapq import heappush, heappop
from collections import deque, defaultdict, Counter
import sys
sys.setrecursionlimit(10 ** 7)
# import numpy as np

inf = 10 ** 20
INF = float("INF")
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = dd + [(-1, 1), (1, 1), (1, -1), (-1, -1)]
ddn9 = ddn + [(0, 0)]
'''for dx, dy in dd:
        nx = j + dx; ny = i + dy
            if 0 <= nx < w and 0 <= ny < h:'''
"""
from operator import itemgetter
from collections import defaultdict
import sys
import math
sys.setrecursionlimit(10 ** 7)


def wi(): return list(map(int, sys.stdin.readline().split()))
# WideIntPoint


def wip(): return [int(x) - 1 for x in sys.stdin.readline().split()]


def ws(): return sys.stdin.readline().split()


def si(): return int(sys.stdin.readline())  # SingleInt


def ss(): return input()


def hi(n): return [si() for _ in range(n)]


def hs(n): return [ss() for _ in range(n)]  # HeightString


def s_list(): return list(input())


def mi(n): return [wi() for _ in range(n)]  # MatrixInt


def mip(n): return [wip() for _ in range(n)]


def ms(n): return [ws() for _ in range(n)]


def num_grid(n): return [[int(i) for i in sys.stdin.readline().split()[
    0]] for _ in range(n)]  # NumberGrid


def grid(n): return [s_list() for _ in range(n)]


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

# a/b の切り上げ


def round_up(a, b):
    """ a/b の切り上げ """
    c = (a + b - 1) / b
    return c


def lcm(a, b):
    """a,bの最小公倍数"""
    return a * b // gcd(a, b)


def floor(a, b):
    """floor(a/b) 整数値を返す"""
    c = (a - a % b)/b
    return int(c)


def main():
    """
import random
import functools
import copy
import bisect
import array
import re
import collections
import heapq
import fractions
import itertools
import string
import math
from operator import itemgetter as ig
from bisect import bisect_left, bisect_right, insort_left, insort_right
from itertools import permutations, combinations, product, accumulate, groupby
from heapq import heappush, heappop
from collections import deque, defaultdict, Counter
import sys
sys.setrecursionlimit(10 ** 7)
# import numpy as np

inf = 10 ** 20
INF = float("INF")
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = dd + [(-1, 1), (1, 1), (1, -1), (-1, -1)]
ddn9 = ddn + [(0, 0)]
'''for dx, dy in dd:
        nx = j + dx; ny = i + dy
            if 0 <= nx < w and 0 <= ny < h:'''
"""


sys.setrecursionlimit(10 ** 7)


def wi(): return list(map(int, sys.stdin.readline().split()))
# WideIntPoint


def wip(): return [int(x) - 1 for x in sys.stdin.readline().split()]


def ws(): return sys.stdin.readline().split()


def si(): return int(sys.stdin.readline())  # SingleInt


def ss(): return input()


def hi(n): return [si() for _ in range(n)]


def hs(n): return [ss() for _ in range(n)]  # HeightString


def s_list(): return list(input())


def mi(n): return [wi() for _ in range(n)]  # MatrixInt


def mip(n): return [wip() for _ in range(n)]


def ms(n): return [ws() for _ in range(n)]


def num_grid(n): return [[int(i) for i in sys.stdin.readline().split()[
    0]] for _ in range(n)]  # NumberGrid


def grid(n): return [s_list() for _ in range(n)]


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

# a/b の切り上げ


def round_up(a, b):
    """ a/b の切り上げ """
    c = (a + b - 1) / b
    return c


def lcm(a, b):
    """a,bの最小公倍数"""
    return a * b // gcd(a, b)


def floor(a, b):
    """floor(a/b) 整数値を返す"""
    c = (a - a % b)/b
    return int(c)


def main():
    x = int(input())
    x = int(input())
    for a in range(-10000, 10000):
        for b in range(-1000, 1000):
            if a**5 - b ** 5 == x:
                print(a, b)
                sys.exit()

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import itertools
x = int(input())
n = 70
table = [pow(i, 5) for i in range(-n, n+1)]
choices = list(itertools.permutations([i for i in range(len(table))], 2))
for choice in choices:
    left = choice[0]
    right = choice[1]
    if table[left] - table[right] == x:
        if left == n:
            ans_left = 0
        elif left < n:
            ans_left = left - n
        else:
            ans_left = left % n
            
        if right == n:
            ans_right = 0
        elif right < n:
            ans_right = right - n
        else:
            ans_right = right % n
        break
print(ans_left, ans_right)

Submission status: Runtime Error

Solution code:
x = int(input())


i = 0

while i**5 < x:
    i += 1
for k in range(i):
    for j in range(-i, i + 1):
        if k**5 - j**5 == x:
            a, b = k, j
print(a, b)

Submission status: Runtime Error

Solution code:
X=int(input())
Y=int(X**(0.2))
for i in range(Y,-Y,-1):
    for t in (-Y//2,Y,1):
        if i**5-t**5==X:
            S=i
            Z=t
            break
print(S,Z)

Submission status: Runtime Error

Solution code:
X=int(input())
Ans=[]
for n in range(65):
    for n1 in range(65):
        n2=n**5+n1**5
        if n2 == X:
            Ans.append(n)
            Ans.append(-1*n1)
            break

if len(Ans)==0:
    for n3 in range(80,2500):
        for n4 in range(n3-20):
            n2=n3**5-n4**5
            if n2 == X:
                Ans.append(n3)
                Ans.append(n4)
                break

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

Submission status: Runtime Error

Solution code:
import sympy
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

A = sympy.Symbol('A')
B = sympy.Symbol('B')

for i in make_divisors(X):
    expr1 = A - B - i
    expr2 = A**4 + A**3 * B + A**2 * B**2 + A * B**3 + B**4 - X//i
    print(sympy.solve([expr1, expr2]))

Submission status: Runtime Error

Solution code:
import itertools
import numpy as np

X = int(input())
maxs = int(X**(1/5))

l = np.arange(-maxs, maxs+1)

comb = np.array(list(itertools.combinations_with_replacement(l, 2)))

sum1 = comb[:, 0]**5 - comb[:, 1]**5
sum2 = comb[:, 1]**5 - comb[:, 0]**5

try:
    result1 = np.where(sum1==X)[0][0]
    print(comb[result1][0], comb[result1][1])
except:
    result2 = np.where(sum2==X)[0][0]
    print(comb[result2][1], comb[result2][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)
    return divisors

for i in range(len(make_divisors(X))):
    A = make_divisors(X)[i]
    for j in range(-int(X**(1/5)),int(X**(1/5))):
        if (A+j)**5-j**5==X:
            a = j + A
            b = j
            break
        else:
            continue
        break
    else:
        continue
    break
print(a,b)

Submission status: Runtime Error

Solution code:
X = int(input())
B=-1
tmp = X
i=0
flg=0
while True:
    tmp = tmp + B**5
    A = int(tmp**.2)
    if A**5==tmp:
        break
    B -= 1
    tmp = X
    if i>40:
        B+=2
print(A, B)

Submission status: Runtime Error

Solution code:
import numpy as np

n = int(input())
a = np.asarray(list(map(int, input().split())))

# n = 10**5
# a = np.asarray([0] * n)

idx = np.argsort(a)
a = a[idx]

count = 0

for i in range(1, n):
    for j in range(n - i):
        sum_ = a[j] + a[j+i]
        if sum_ >= n:
            break
        if abs(idx[j+i] - idx[j]) == sum_:
            count += 1

print(count)

Submission status: Runtime Error

Solution code:
x = int(input())

a = [i**5 for i in range(-100, 101)]

for _a in a:
    if _a**5 + x in a:
        if (_a**5 + x) >= 0:
            a1, a2 = _a, int((_a**5 + x)**(1/5))
        else:
            a1, a2 = _a, int(abs(_a**5 + x)**(1/5))*(-1)
        break

print(a2, a1)