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:
from math import sqrt, log, pow
num = [i**5 for i in range(-1, 150)]
c = 0
def solve(X):
    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
print(*solve(int(input())))

Submission status: Runtime Error

Solution code:
if __name__ == '__main__':
    a = int(input())
    ansdict= {}
    count = 100000
    mcount =100000 *-1

    for i in range(0,100000):
        c = i **5
        ansdict[i]=c
        ansdict[i*-1]=c*-1
    flag = 0

    for i in range(mcount,count):
        for j in range(mcount,count):
            ans = ansdict[j]-ansdict[i]
            if ans ==a:
                print(str(j) + " " +str(i))
                flag+=1
                break
        if flag == 1:
            break

Submission status: Runtime Error

Solution code:
import math


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


if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

import math

def main():
     x = int(input())
     # x は 正の整数
     # ans = a^5 - b^5 = x となる a, b

     b = 0
     while(True):
          b_x = pow(b, 5)
          a_x = x + b_x
          a = pow(a_x, 1 / 5)

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

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

          else:
               if b <= 0:
                    b -= 1
                    b = b * (-1)
               else:
                    b = b * (-1)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
input = raw_input

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: # choufuku
                divisors.append(n//i)
    # divisors.sort()
    return divisors

def f(x, d):
    out = (x+d) ** 5 - x ** 5
    return out

ds = make_divisors(x)
#print("ds", ds)

found = False
for d in ds:
    if found:
        break

    b = 0
    while True:
        aa = b+d
        bb = b
        ret = f(b, d)
        #print(aa, bb, d, ret)
        
        if x == ret:
            found = True
            a = b+d
            b = b
            break
        elif ret > x:
            break
        b += 1

    if found:
        break

    b = -1
    while True:
        aa = b+d
        bb = b

        ret = f(b, d)
        #print(aa, bb, d, ret)
        
        if x == ret:
            found = True
            a = b+d
            b = b
            break
        elif ret > x:
            break
        b -= 1

assert found
print("%d %d" % (a, b))

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

dd=defaultdict(int)
#take care of 0
for i in range(0, 81):
    for j in range(i):
        temp = i**5 - j**5
        dd[temp] = (i, j)
        temp1 = i**5 + j**5
        dd[temp1] = (i, -j)

x = INT()

print(*dd[x])

Submission status: Runtime Error

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

    n = int(x ** .2)
    if n ** 5 == x:
        print(n, 0)
        return
    
    for i in range(1, 100):
        n = int((x - i ** 5) ** .2)
        if n ** 5 == (x - i ** 5):
            print(i, -n)
            return
    
    for i in range(1, 10000):
        fif = x + i ** 5
        n = int(fif ** .2)
        if n ** 5 == fif:
            print(fif, i)
            return

main()

Submission status: Runtime Error

Solution code:
def main():
x=int(input())
for a in range(-250,251):
  for b in range(-250,251):
      if pow(a,5)-pow(b,5)==x:
          print(a,b)
          exit()
main()

Submission status: Runtime Error

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

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<10000:
        if ((X+b**5)**0.2)%1==0:
            a=int((X+b**5)**0.2)
            print(a,b)
            exit()
        elif ((X+(-1*b)**5)**0.2)%1==0:
            a=int((X+b**5)**0.2)
            print(a,-b)
            exit()
        else:
            b+=1

Submission status: Runtime Error

Solution code:
X=int(input())
tup=(0, 1, 32, 243, 1024, 3125, 7776, 16807, 32768, 59049, 100000, 161051, 248832, 371293, 537824, 759375, 1048576, 1419857, 1889568, 2476099, 3200000, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176, 69343957, 79235168, 90224199, 102400000, 115856201, 130691232, 147008443, 164916224, 184528125, 205962976, 229345007, 254803968, 282475249, 312500000, 345025251, 380204032, 418195493, 459165024, 503284375, 550731776, 601692057, 656356768, 714924299, 777600000, 844596301, 916132832, 992436543, 1073741824, 1160290625, 1252332576, 1350125107, 1453933568, 1564031349, 1680700000, 1804229351, 1934917632, 2073071593, 2219006624, 2373046875, 2535525376, 2706784157, 2887174368, 3077056399, 3276800000, 3486784401, 3707398432, 3939040643, 4182119424, 4437053125, 4704270176, 4984209207, 5277319168, 5584059449, 5904900000, 6240321451, 6590815232, 6956883693, 7339040224, 7737809375, 8153726976, 8587340257, 9039207968, 9509900499)

for i,t in enumerate(tup):
  Y=X-t
  if -1 * Y in tup:
    j=tup.index(Y)
    print("{} {}".format(i, j))
    exit(0)
  elif Y in tup:
    j=tup.index(Y)
    print("{} {}".format(i, -1*j))
    exit(0)

Submission status: Runtime Error

Solution code:
X = int(input())

p = [0]*100

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

for i in range(1,100):
    for j in range(1,100):
        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))

Submission status: Runtime Error

Solution code:


def solve(x):
    for b in xrange(-101, 101):
        a5 = (b ** 5) + x
        s = -1 if a5 < 0 else 1
        a = s * int(pow(abs(a5), 0.2) + 0.1)
        if a ** 5 == a5:
            return a, b

def test(x):
    a, b = solve(x)
    assert x == (a ** 5 - b ** 5)

test(33)
test(1)


x = int(raw_input())
a, b = solve(x)
print a, b

Submission status: Runtime Error

Solution code:
X = int(input())

_range = int(pow(X,1/5))
for i in range(-1*_range-1,_range+2):
  for j in range(-1*_range-1,_range+2):
    if pow(i,5) - pow(j,5) == X:
      ans_a = i
      ans_b = j
      break
      
print(ans_a,ans_b)

Submission status: Runtime Error

Solution code:
#dt = {} for i in x: dt[i] = dt.get(i,0)+1
#dt = {k:v for k,v in sorted(x.items(), key=lambda i: i[1])}
ipnl = lambda n: [int(input()) for _ in range(n)]
inp = lambda :int(input())
ip = lambda :[int(w) for w in input().split()]
mp = lambda :map(int,input().split())

from bisect import bisect_left as bs
dt = {}
x = []
for i in range(200):
    dt[i**5] = i
    x.append(i**5)
n = inp()
if n in dt:
    print(dt[n],0)
    exit()
i = bs(x,n)
a = x[i]
b = a - n
if b in dt:
    print(dt[a],dt[b])
else:
    a = x[i-1]
    b = n - a
    print(dt[a],-dt[b])

Submission status: Runtime Error

Solution code:
X = int(input())

p = [0]*100

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

for i in range(1,100):
    for j in range(1,100):
        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(flag)
print(str(a)+" "+str(b))

Submission status: Runtime Error

Solution code:
X = int(input())
b = 1.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*b
    else:
        b = -1*b + 1
        
print(a, int(b))

Submission status: Runtime Error

Solution code:
n=int(input())
d=dict()
for i in range(200):
    for j in range(i,200):
        d[i**5-j**5]=(i,j)
        d[i**5+j**5]=(i,-j)
a,b=d[n]
print(a,b)

Submission status: Runtime Error

Solution code:
x = int(input())

quarter = int(x ** 0.25)
for B in range(-quarter, quarter+1):
  A = int((B**5 + x) ** 0.2)
  if A % 1 == 0:
    print(A, B)
    break

Submission status: Runtime Error

Solution code:


sa = eval(input())
s, lists = sa // 10, []
if sa == 1:
    lists.append(0)
    lists.append(-1)
for i in range(-10, 10):
    for x in range(-10, 10):
        if i**5 - x**5 == sa:
            lists.append(i)
            lists.append(x)
print(lists[-2], lists[-1])

Submission status: Runtime Error

Solution code:
x=int(input())
for a in range(-100,100):
    for b in range(-100,100):
        if (a**5-b**5)==x:
            a_ans=a
            b_ans=b
            break

print(a_ans,b_ans)

Submission status: Runtime Error

Solution code:
import sys
import numpy as np

s=int(sys.stdin.readline())
#n,k=map(int,sys.stdin.readline().split())
#a=np.array(sys.stdin.readline().split(),dtype='int64')
#a=np.array([sys.stdin.readline().split() for i in range(n)],dtype='int64')

num=0
a=1
while True:
    f=(s+num**5)**(1/5)
    if f.is_integer():
        break
    f=(s-num**5)**(1/5)
    if f.is_integer():
        a=-1
        break
    num+=1

print(str(int(f))+' '+str(a*num))

Submission status: Runtime Error

Solution code:
def main():
    tmp = [-10000000000, -9509900499, -9039207968, -8587340257, -8153726976, -7737809375, -7339040224, -6956883693, -6590815232, -6240321451, -5904900000, -5584059449, -5277319168, -4984209207, -4704270176, -4437053125, -4182119424, -3939040643, -3707398432, -3486784401, -3276800000, -3077056399, -2887174368, -2706784157, -2535525376, -2373046875, -2219006624, -2073071593, -1934917632, -1804229351, -1680700000, -1564031349, -1453933568, -1350125107, -1252332576, -1160290625, -1073741824, -992436543, -916132832, -844596301, -777600000, -714924299, -656356768, -601692057, -550731776, -503284375, -459165024, -418195493, -380204032, -345025251, -312500000, -282475249, -254803968, -229345007, -205962976, -184528125, -164916224, -147008443, -130691232, -115856201, -102400000, -90224199, -79235168, -69343957, -60466176, -52521875, -45435424, -39135393, -33554432, -28629151, -24300000, -20511149, -17210368, -14348907, -11881376, -9765625, -7962624, -6436343, -5153632, -4084101, -3200000, -2476099, -1889568, -1419857, -1048576, -759375, -537824, -371293, -248832, -161051, -100000, -59049, -32768, -16807, -7776, -3125, -1024, -243, -32, -1, 0, 1, 32, 243, 1024, 3125, 7776, 16807, 32768, 59049, 100000, 161051, 248832, 371293, 537824, 759375, 1048576, 1419857, 1889568, 2476099, 3200000, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176, 69343957, 79235168, 90224199, 102400000, 115856201, 130691232, 147008443, 164916224, 184528125, 205962976, 229345007, 254803968, 282475249, 312500000, 345025251, 380204032, 418195493, 459165024, 503284375, 550731776, 601692057, 656356768, 714924299, 777600000, 844596301, 916132832, 992436543, 1073741824, 1160290625, 1252332576, 1350125107, 1453933568, 1564031349, 1680700000, 1804229351, 1934917632, 2073071593, 2219006624, 2373046875, 2535525376, 2706784157, 2887174368, 3077056399, 3276800000, 3486784401, 3707398432, 3939040643, 4182119424, 4437053125, 4704270176, 4984209207, 5277319168, 5584059449, 5904900000, 6240321451, 6590815232, 6956883693, 7339040224, 7737809375, 8153726976, 8587340257, 9039207968, 9509900499, 10000000000]
    x = int(input())
    for i in range(100,201):
        for j in range(201):
            if tmp[i] - tmp[j] == x:
                print(i-100,j-100)
                exit()
    print(a)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
from sys import stdin


def factorization(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


if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    X = int(_in[0])  # type:int
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    X_fac = factorization(X)
    flag = False
    for x_fac in X_fac:
        fac_max = sum(x_fac[:-1])
        for fac in x_fac:
            A = 0
            while True:
                A += 1
                B = A-fac
                if X == A**5-B**5:
                    s = f'{A} {B}'
                    flag == True
                    break
                elif A**4+A**3*B+A**2*B**2+A*B**3+B**4>fac_max:
                    break
            if flag:
                break
        if flag:
            break
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(s)

Submission status: Runtime Error

Solution code:
X = int(input())
m = 0
n = 0
tip = 0
for i in range(101):
    if (tip == 0):
        p = i ** 5
        q = X - p
        r = q ** (1/5)
        if ((r - int(r)) == 0):
            m = r
            n = ((-1) * p)
            tip = 1
print(int(m), int(n))

Submission status: Runtime Error

Solution code:
X = int(input())
b = 1
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*b
    else:
        b = -1*b + 1
        
print(a, b)

Submission status: Runtime Error

Solution code:
x = int(input())

for a in range(1, 10**9):
    if (x%(a-b) != 0):
        continue
    
    tmp = a**5 - x
    if (tmp <= 0):
        tmp *= -1
        
    b = tmp**(1/5)
    if(b == int(b)):
        print(a, int(b))
        break

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
X = int(input())

d = {}
k = {}
for i in range(-100,101):
    d[i] = pow(i,5)
    k[d[i]] = i
i = -100

while True:
    if X + d[i] in d.values():
        b = i
        a = k[X + d[i]]
        break
    i += 1

print(a, b)

Submission status: Runtime Error

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

    if (n := int(x ** .2)) ** 5 == x:
        print(n, 0)
        return
    
    for i in range(1, 10000):
        if (n := int((x - i ** 5) ** .2)) ** 5 == (x - i ** 5):
            print(i, -n)
            return
    
    v = (x / 5)

    for i in range(1, 10000):
        fif = x + i ** 5
        if (n := int(fif ** .2)) ** 5 == fif:
            print(fif, i)
            return

main()

Submission status: Runtime Error

Solution code:
import math

x = int(input())
for a in range(1000000000):
    b = (x - (a**5))**0.2
    if b.is_integer():
        print(a, int(b) * -1)
        break

Submission status: Runtime Error

Solution code:
x = int(input())

t = int(x**0.2)

for i in range(x):
    t2 = t + i
    d = x - t2 ** 5
    if(d.imag == 0):
        b = int(d**0.2)
        if(b**5 == d):
            print(t2,-d)
            exit()
    t2 = t - i
    d = x - t2 ** 5
    if(d.imag == 0):
        b = int(d**0.2)
        if(b**5 == d):
            print(t2,-d)
            exit()

Submission status: Runtime Error

Solution code:
#dt = {} for i in x: dt[i] = dt.get(i,0)+1
#dt = {k:v for k,v in sorted(x.items(), key=lambda i: i[1])}
ipnl = lambda n: [int(input()) for _ in range(n)]
inp = lambda :int(input())
ip = lambda :[int(w) for w in input().split()]
mp = lambda :map(int,input().split())

from bisect import bisect_left as bs
dt = {}
x = []
for i in range(120):
    dt[i**5] = i
    x.append(i**5)
n = inp()
if n in dt:
    print(dt[n],0)
    exit()
i = bs(x,n)
a = x[i]
b = a - n
if b in dt:
    print(dt[a],dt[b])
else:
    a = x[i-1]
    b = n - a
    print(dt[a],-dt[b])

Submission status: Runtime Error

Solution code:
X=int(input())
def PrimeFactor(n):
    ret=[]
    for i in range(2,int(-(-n**0.5//1))+1):
        if i!=2 and i%2==0:
            continue
        cnt=0
        while n%i==0:
            cnt+=1
            n//=i
        if cnt!=0:
            ret.append([i,cnt])
    if n!=1:
        ret.append([n,1])
    return ret
L=PrimeFactor(X)
L.append([1,1])
Y=False
ans=[]
for l in L:
    x=l[0]
    b=-1*x-1
    while True:
        tmp=(b+x)**5-b**5
        if tmp==X:
            Y=True
            ans=[b+x,b]
            break
        if tmp>X and b>0 and b+x>0:
            break
        b+=1
    if Y:
        break
print(ans[0],ans[1])

Submission status: Runtime Error

Solution code:
X = int(input())

p = [0]*100

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

for i in range(100):
    for j in range(100):
        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))

Submission status: Runtime Error

Solution code:
for a_i in range(100000):
	for b_i in range(100000):
		if a_i**5 - b_i**5 == X:
			print ("%d %d"%(a_i, b_i))
			break
		if a_i**5 + b_i**5 == X:
			print ("%d %d"%(a_i, -1 * b_i))			
			break
	else:
		continue
	break

Submission status: Runtime Error

Solution code:
#dt = {} for i in x: dt[i] = dt.get(i,0)+1
#dt = {k:v for k,v in sorted(x.items(), key=lambda i: i[1])}
ipnl = lambda n: [int(input()) for _ in range(n)]
inp = lambda :int(input())
ip = lambda :[int(w) for w in input().split()]
mp = lambda :map(int,input().split())

from bisect import bisect_left as bs
dt = {}
x = []
for i in range(65):
    dt[i**5] = i
    x.append(i**5)
n = inp()
if n in dt:
    print(dt[n],0)
    exit()
i = bs(x,n)
a = x[i]
b = a - n
if b in dt:
    print(dt[a],dt[b])
else:
    a = x[i-1]
    b = n - a
    print(dt[a],-dt[b])

Submission status: Runtime Error

Solution code:


sa = eval(input())
s, lists = sa // 10, []
if sa == 1:
    lists.append(0)
    lists.append(-1)
for i in range(-5, 5):
    for x in range(-5, 5):
        if i**5 - x**5 == sa:
            lists.append(i)
            lists.append(x)
print(lists[-2], lists[-1])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
X = int(input())
a = 0
while True:
    c  = (X -a**5)**0.2
    b = int(c)
    if c - b < 0.01:
        print(a,-b)
        break
    a += 1

Submission status: Runtime Error

Solution code:
x = int(input())
for b in range(10000000):
    tmp=x+b**5
    if tmp**0.2==int(tmp**0.2):
        print(int(tmp**0.2),b)
        exit()
    tmp=x-b**5
    if tmp**0.2==int(tmp**0.2):
        print(int(tmp**0.2),-b)
        exit()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x=int(input())

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

print(a,b)

Submission status: Runtime Error

Solution code:
can=[0]
for i in range(1,101):
    can.append(pow(i,5))
    can.append(-pow(i,5))
can.sort()

x=int(input())

end=False
for i in range(len(can)):
    for q in range(len(can)):
        if can[i]-can[q]==x:
            
            print(i-100,q-100)
            end=True
            break
    if end:
        break
else:
    raise ValueError("xx")

Submission status: Runtime Error

Solution code:
X = int(input())
t = X**(0.2)
if t.is_integer():
    print(int(t),0)
else:
    b = 1
    while(True):
        k = b**5
        t = (X+k)**(0.2)
        if t.is_integer():
            print(int(t),b)
            break
        t = (X-k)**(0.2)
        if t.is_integer():
            print(int(t),-b)
            break
        b += 1

Submission status: Runtime Error

Solution code:
x = int(input())
list = []
for i in range(0, 100):
    for j in range(-100, 0):
        if ((i**5)-(j**5))==x:
            list.append(i)
            list.append(j)
            break
print(list[0], list[1])

Submission status: Runtime Error

Solution code:
X=int(input())
def PrimeFactor(n):
    ret=[]
    for i in range(2,int(-(-n**0.5//1))+1):
        if i!=2 and i%2==0:
            continue
        cnt=0
        while n%i==0:
            cnt+=1
            n//=i
        if cnt!=0:
            ret.append([i,cnt])
    if n!=1:
        ret.append([n,1])
    return ret
L=PrimeFactor(X)
L.append([1,1])
Y=False
ans=[]
for l in L:
    x=l[0]
    b=-1*x-1
    while True:
        tmp=(b+x)**5-b**5
        if tmp==X:
            Y=True
            ans=[b+x,b]
            break
        if tmp>X and b+x>0:
            break
        b+=1
    if Y:
        break
print(ans[0],ans[1])

Submission status: Runtime Error

Solution code:
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)
    return divisors
x=int(input())
l=make_divisors(x)
if x==0:
  answer=[0,0]
for i in range(math.ceil(pow(x,0.2))):
  for j in l:
    if pow(i,5)-pow(i-j,5)==x:
      answer=[i,i-j]
      break
print(answer[0],answer[1])

Submission status: Runtime Error

Solution code:
import sys
x=int(input())
b=0
while True:
  if ((b**5+x)**(1/5)).is_integer():
    print(int((b**5+x)**(1/5)),b)
    sys.exit()
  elif ((x-b**5)**(1/5)).is_integer():
    print(int((x-b**5)**(1/5)),-1*b)
    sys.exit()
  else:
    b+=1

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
import math


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

    MAX = 10**9
    MIN = 10**(-10)

    for B in range(0, MAX+1):
        a = math.pow(B**5 + X, 1/5)
        if abs(a - int(a)) < MIN:
            print(int(a), B)
            return

        a = math.pow(- B ** 5 + X, 1 / 5)
        if abs(a - int(a)) < MIN:
            print(int(a), B)
            return


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
X = int(input())

FIVES = [x ** 5 for x in range(200)]

for ki,vi in enumerate(FIVES):
    for kj,vj in enumerate(FIVES):
        if and vi - vj == X:
            print(ki,kj)
            exit()
        if vj - vi == X:
            print(kj,ki)
            exit()
        if vi + vj == X:
            print(ki,-kj)
            exit()

Submission status: Runtime Error

Solution code:
X = int(input())

FIVES = [x ** 5 for x in range(200)]

for ki,vi in enumerate(FIVES):
    for kj,vj in enumerate(FIVES):
        if and vi - vj == X:
            print(ki,kj)
            exit()
        if vj - vi == X:
            print(kj,ki)
            exit()
        if vi + vj == X:
            print(ki+1,-(kj+1))
            exit()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# coding: utf-8

x = int(input())
for i in range(-100, 100):
    for j in range(i,1000):
        #print(j**5-i**5)
        if j**5-i**5 == x:
            ans = [j,i]
            break

print(ans)

Submission status: Runtime Error

Solution code:
x=int(input())

x-=1
for i in range(x+1):
    if i**5==x:
        a=i
        break

print(a,-1)

Submission status: Runtime Error

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

x = ii()
l = [0]
i = 0
num = 0
while num < 10**10:
    i += 1
    num = i**5
    l.append(num)
l = set(l)
for item in l:
    if x - item in l or item - x in l:
        print(int(item**0.2),int((x-item)**0.2))
        exit()

Submission status: Runtime Error

Solution code:
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 divisors
x=int(input())
l=make_divisors(x)
for i in range(math.ceil(pow(x,0.2))):
  for j in l:
    if pow(i,5)-pow(i-j,5)==x:
      answer=[i,i-j]
      break
print(answer[0],answer[1])

Submission status: Runtime Error

Solution code:
X = int(input())

A = 1
while True:
    b = (A ** 5 - X)
    c = abs(b) / b
    B = abs(b) ** (0.2)
    if int(B) == B:
        break
    A += 1
print(A, int(c * B))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x = int(input())

rs = [i ** 5 for i in range(300)]

for r in rs:
    if (x - r) in rs:
        print(rs.index(r), - rs.index(x - r))
    elif (x + r) in rs:
        print(rs.index(r), rs.index(x - r))
    else:
        continue
    break

Submission status: Runtime Error

Solution code:
x = int(input())
amax = int(x ** (1/ 5)) + 1
for a in range(amax + 1):
    b5 = a ** 5 - x
    if b5 < 0:
        c = (-b5) ** (1/5)
        if int(c) == c:
            ans = (a, -int(c))
            break
    else:
        c = (b5) ** (1/5)
        if int(c) == c:
            ans = (a, int(c))
            break

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

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>

#define pb push_back
#define eb emplace_back

typedef long long ll;
typedef unsigned long long ull;

using namespace std;




void one_case() {
    ll x;
    cin >> x;
    if (x == 1) {
        cout << "0 -1\n";
        return;
    }

    for (ll d = 1; d * d <= x; ++d) {
        if (x % d) {
            continue;
        }
        ll a = 0;
        while (true) {
            if (a > 1e4) {
                break;
            }
            auto b = a - d;
            ll sec = a * a * a * a +a * a * a * b + b * b * a * a +  b * b * b * a + b * b * b * b;

//            if (sec < 0 or sec > x) {
//                break;
//            }
            if (d * sec == x) {
                cout << a << " " << b << "\n";
                return;
            }
            ++a;
        }
    }
}

int main() {
//    std::ios::sync_with_stdio(false);
//    std::cin.tie(nullptr);

    int t = 1;
//    cin >> t;
    while (t--) {
       one_case();
    }

    return 0;
}

Submission status: Runtime Error

Solution code:
import sys
x = int(sys.stdin.readline())
a = 0.1
b = -10**5
while not a.is_integer():
  a = x-b**5
  a = a**0.2
  b += 1
print(int(a), b-1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math

X = int(input())

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

for j in range(1, 1001):
    if ((X - j ** 5) ** 0.2).is_integer():
        print(int((X - j ** 5) ** 0.2), -j)
        exit()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#保証されている
#分解するとa<10**3となる

x=int(input())

for b in range(10**3):
    a = int((x+b**5)**(1/5))
    for i in range(a-1,a+2):
        if a**5+b**5==x:
            print(a,-b)
            exit()
for b in range(10**3):
    a = int((x-b**5)**(1/5))
    if a<0:
        continue
    for i in range(a-1,a+2):
        if a**5+b**5==x:
            print(a,b)
            exit()

Submission status: Runtime Error

Solution code:
X=int(input())
for a in range(101):
 for b in range(201):
  if a**5-(b-100)**5==X:
   x=str(a)
   y=str(b-100)
L=[x,y]
L=' '.join(L)
print(L)