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: Accepted

Solution code:
x = int(input())
facts = [i ** 5 for i in range(120)]
for a, a5 in enumerate(facts):
    for b, b5 in enumerate(facts):
        if a5 + b5 == x:
            print(a, -b)
            break
        if a5 - b5 == x:
            print(a, b)
            break
    else:
        continue
    break

Submission status: Accepted

Solution code:
def f(n):
    l, r = 0, 1 << 20
    while r - l > 1:
        m = (l + r) // 2
        if m ** 5 <= n:
            l = m
        else:
            r = m
    return l if l ** 5 == n else 0

X = int(input())
for i in range(1 << 20):
    a = f(X + i ** 5)
    if a:
        print(a, i)
        break
    a = f(X - i ** 5)
    if a:
        print(a, -i)
        break

Submission status: Accepted

Solution code:
x = int(input())

for b in range(-500,500):
    for a in range(-500,500):
        if a**5 == b**5 + x:
            print(a,b)
            exit()

Submission status: Accepted

Solution code:
from bisect import bisect_left
X = int(input())
A = [pow(i,5) for i in range(-1000,1001)]
B = A[:]
for i,a in enumerate(A):
    bi = bisect_left(B,a-X)
    if B[bi]==(a-X):
        print(i-1000,bi-1000)
        break

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

x = int(input())
for a in range(-300,300):
  for b in range(-300,300):
    if pow(a,5)-pow(b,5) == x:
      print(a,b);exit()

Submission status: Accepted

Solution code:
def examA():
    S = SI()
    if S=="ARC":
        ans = "ABC"
    else:
        ans = "ARC"
    print(ans)
    return

def examB():
    N, K = LI()
    snuke = set(range(1,N+1))
    for _ in range(K):
        d = I()
        A = LI()
        for a in A:
            snuke.discard(a)
    ans = len(snuke)
    print(ans)
    return

def examC():
    N, M = LI()
    H = LI()
    good = set(range(1,N+1))
    for _ in range(M):
        a, b = LI()
        if H[a-1]>=H[b-1]:
            good.discard(b)
        if H[b-1]>=H[a-1]:
            good.discard(a)
    ans = len(good)
    print(ans)
    return

def examD():
    X = I()
    #print(1000**5-999**5)
    for a in range(-1000,1000):
        for b in range(-1000,1000):
            if a**5-b**5==X:
                print(a,b)
                return
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(readline())
def LI(): return list(map(int,readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

sys.setrecursionlimit(10**7)

if __name__ == '__main__':
    examD()

"""
142
12 9 1445 0 1
asd dfg hj o o
aidn
"""

Submission status: Accepted

Solution code:
def main():

    X = int(input())
    for a in range(500):
        for b in range(-500, a):
            if a ** 5 - b ** 5 == X:
                return str(a) + " " + str(b)


print(main())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

Solution code:

X = int(input())
import sys

for a in range(-201,201):

    for b in range(-201,201):

        if a**5 - b**5 == X:
            print (a,b)
            sys.exit()

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

Solution code:
x = int(input())
if x == 2:
    print(1, -1)
    exit(0)
for d in range(1, int(x ** 0.5) + 1):
    for w in [-d, -x // d, d, x // d]:
        for a in range(-1000, 1000):
            if a ** 5 - (a - w) ** 5 == x:
                print(a, a - w)
                exit(0)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

X = input_int()

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

import sys

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

Submission status: Accepted

Solution code:
x = int(input())
for i in range(200):
    ii = i**5
    for j in range(-200, 200):
        jj = j**5
        if ii-jj == x:
            print(i, j)
            exit()

Submission status: Accepted

Solution code:
x=int(input())
lim=500
owari=False
for a in range(-lim,lim+1):
    if(owari):
        break
    for b in range(-lim,lim+1):
        if(a**5-b**5==x):
            print(a,b)
            owari=True
            break

Submission status: Accepted

Solution code:
x=int(input())
d={}
for a in range(10000000000000000000000000):
  aa=a**5
  m=x-aa
  if m in d:print(a,d[m]);exit()
  d[-aa]=a

  aa=-aa
  m=x-aa
  if m in d:print(a,d[m]);exit()
  d[-aa]=-a

Submission status: Accepted

Solution code:
from collections import defaultdict
import sys
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7
input = sys.stdin.readline


def inp():
    return int(input())


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


X = inp()
MAX = 5000
for a in range(-MAX, MAX + 1):
    for b in range(-MAX, MAX + 1):
        tmp = pow(a, 5) - pow(b, 5)
        if X == tmp:
            print(a, b)
            exit()


assert False

Submission status: Accepted

Solution code:
x = int(input())

r = 500

for a in range(-r,r):
    for b in range(-r,r):
        if a**5 - b**5 == x:
            print(f"{a} {b}")
            exit()

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
import sys
readline = sys.stdin.readline
read = sys.stdin.read

n = int(input())
#a = [int(i) for i in read().split()]

a = [i**5 for i in range(1000)]
for i in range(1000):
    for j in range(i+1,1000):
        if a[j]-a[i] == n:
            print(j,i)
            exit()
        if a[j]+a[i] == n:
            print(j,-i)
            exit()

Submission status: Runtime Error

Solution code:
x=int(input())
y=0
while True:
  z=x+y**5
  if z**(1/5)==int(z**(1/5)):
    print(int(z**(1/5)), y)
    exit()
  w=x-y**5
  if w**(1/5)==int(w**(1/5)):
    print(int(w**(1/5)), -y)
    exit()
  y+=1

Submission status: Runtime Error

Solution code:
x=int(input())
y=0
while True:
  z=x+y**5
  if z**(1/5)==int(z**(1/5)):
    print(int(z**(1/5)), y)
    exit()
  z=x-y**5
  if z**(1/5)==int(z**(1/5)):
    print(int(z**(1/5)), -y)
    exit()
  y+=1

Submission status: Runtime Error

Solution code:
X=int(input())
flagp=False
flagm=False
for A in range(-10**3,10**3):
    B5=A**5-X
    for B in range(10**3):
        if B5==B**5:
            flagp=True
            break
        elif B5==-B**5:
            flagm=True
            break
        else:
            raise Exception
    else:
        continue
    break
if flagp:
    print(A,B)
else:
    print(A,-B)

Submission status: Runtime Error

Solution code:
X=int(input())
for A in range(int(X**(1/5))+2):
    if X>=A**5:
        if int((X-A**5)**(1/5))==((X-A**5)**(1/5)):
            B=-int((X-A**5)**(1/5))
            break
    else:
        if int((A**5-X)**(1/5))==((A**5-X)**(1/5)):
            B=int((A**5-X)**(1/5))
            break
print(A,B)

Submission status: Runtime Error

Solution code:
X=int(input())
for A in range(int(X**(1/5))+2):
    if int((X-A**5)**(1/5))==((X-A**5)**(1/5)):
        B=-int((X-A**5)**(1/5))
        break
print(A,B)

Submission status: Runtime Error

Solution code:
x=int(input())
for a in range(-100,101):
	b5=a**5-x
	if int(b**0.2)**5==b:
		print(a,int(b**0.2))
		break

Submission status: Runtime Error

Solution code:
X = int(input())
cnt=0
for a in range(-1000, 1001):
	for b in range(-1000, 1001):
		if a**5 - b**5 == X:
        	print('a'+' b')
            exit()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
X = int(input())
for a in range(1, math.ceil(X ** (1 / 4)) + 1):
    tmp = abs(a ** 5 - X)**(1/5)
    if tmp % 1 == 0:
        A = a
        if a ** 5 - X > 0:
            B = int((a ** 5 - X)**(1 / 5))
        else:
            B = int((X - a ** 5)**(1 / 5)) * -1
print(A, B)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
for i in range(10**9):
    a = i**5 + x
    if a*(1/5) == a*(1/5)//1:
        print(a,i)
        break

Submission status: Runtime Error

Solution code:
x = int(input())

a = 0
b = -1

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

a = str(a)
b = str(b)
print(a + ' ' + b)

Submission status: Runtime Error

Solution code:
X = int(input())
Ans = 0
for A in range(1,100):
    for B in range(-A,A):
        Tar = A**5 - B**5
        if Tar == X:
            Ans = [A,B]
            break
    if Ans != 0:
        break
print(*Ans)

Submission status: Runtime Error

Solution code:
def resolve():
    X = int(input())
    powered = set()
    for i in range(100):
        powered.add(i**5)
    for b in powered:
        if X+b in powered:
            a = int((b+X)**(1/5))
            b = int(b**(1/5))
            print(a, b)
            return
        if X-b in powered:
            a = int((b+X)**(1/5))
            b = -int(b**(1/5))
            print(a, b)
            return
            
    assert False


if '__main__' == __name__:
    resolve()

Submission status: Runtime Error

Solution code:
def resolve():
    X = int(input())
    b = 0
    while b < 10**6:
        a = (X-(b**5))**(1/5)
        if a.is_integer():
            print(int(a), b)
            return
        b += 1
    raise Exception("NOT FOUND")


if '__main__' == __name__:
    resolve()

Submission status: Runtime Error

Solution code:
import sys
import numpy as np
from math import ceil as C, floor as F, sqrt
from collections import defaultdict as D, Counter as CNT
from functools import reduce as R
 
ALP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
alp = 'abcdefghijklmnopqrstuvwxyz'
def _X(): return sys.stdin.readline().rstrip().split(' ')
def _S(ss): return tuple(ss) if len(ss) > 1 else ss[0]
def S(): return _S(_X())
def Ss(): return list(S())
def _I(ss): return tuple([int(s) for s in ss]) if isinstance(ss, tuple) else int(ss)
def I(): return _I(S())
def _Is(ss): return list(ss) if isinstance(ss, tuple) else [ss]
def Is(): return _Is(I())

x = I()

As = []
Bs = []

for i in range(64):
  n = i ** 5
  As.append(n)
  Bs.append(n)
  Bs.append(-n)

xs = [(a, x-a) for a in As]
for x in xs:
  if x[1] in Bs:
    print(x[0], -int(pow(x[1], 1/5)))
    break

Submission status: Runtime Error

Solution code:
def solve():
    X = int(input())
    memo = {}
    for A in range(100):
        for B in range(100):
            memo[A**5-B**5] = (A,B)
            memo[A**5+B**5] = (A,-B)
    A,B = memo[X]
    print(A, B)

if __name__ == "__main__":
    solve()

Submission status: Runtime Error

Solution code:
x = int(input())

p5 = []
for i in range(-100, 101):
    p5.append(i**5)

for ci in range(201):
    if p5[ci] - x in p5:
        a = [ci-100, p5.index(p5[ci] - x)-100]
        break
a = [str(i) for i in a]
print(' '.join(a))

Submission status: Runtime Error

Solution code:
x = int(input())
n = [i**5 for i in range(63+1)]

a = 0
b = 0
res = False
i = 0
while not res:
    sign = 1 - 2*(n[i] < x)
    for j in range(i+1):
        if (n[i] - n[j] * sign) == x:
            print(i,j*sign)
            res = True
    i += 1

Submission status: Runtime Error

Solution code:
x = int(input())
n = [i**5 for i in range(63)]

a = 0
b = 0
res = False
i = 0
while not res:
    sign = 1 - 2*(n[i] < x)
    for j in range(i+1):
        if (n[i] - n[j] * sign) == x:
            print(i,j*sign)
            res = True
    i += 1

Submission status: Runtime Error

Solution code:
x = int(input())
n = [i**5 for i in range(63)]

a = 0
b = 0
for i in range(len(n)-1):
    now = abs(n[i]-x)
    next = abs(n[i+1]-x)
    if (now<next) or (i+1 == len(n)-1):
        a = i
        break

sign = 1 - 2*(n[a] < x)
pos = 0
while True:
    if (n[a] - n[pos]*sign) == x: 
        b = pos
        break
    pos += 1
print(a,b*sign)

Submission status: Runtime Error

Solution code:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from itertools import product
def main():
    x = int(input())
    n5 = [i**5 for i in range(65)]
    c = product(n5, repeat=2)
    for ce in c:
        if ce[0] + ce[1] == x:
            r = (int(ce[0]**0.2), int(ce[1]**0.2)* -1)
            break
        elif ce[0] - ce[1] == x:
            r = (int(ce[0] ** 0.2), int(ce[1] ** 0.2))
            break
    print(*r, sep=' ')
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from itertools import combinations
def main():
    x = int(input())
    n5 = [i**5 for i in range(-100,1000)]
    c = combinations(n5, 2)
    for ce in c:
        if ce[0] + ce[1] == x:
            r = (int(ce[0]**0.2), int(ce[1]**0.2)* -1)
            break
        elif ce[0] - ce[1] == x:
            r = (int(ce[0] ** 0.2), int(ce[1] ** 0.2))
            break
    print(*r, sep=' ')
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from itertools import combinations
def main():
    x = int(input())
    n5 = [i**5 for i in range(65)]
    c = combinations(n5, 2)
    for ce in c:
        if ce[0] + ce[1] == x:
            r = (int(ce[0]**0.2), int(ce[1]**0.2)* -1)
            break
        elif ce[0] - ce[1] == x:
            r = (int(ce[0] ** 0.2), int(ce[1] ** 0.2))
            break
    print(*r, sep=' ')
if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
NUM=100

X=int(input())

flg=False

for i in reversed(range(NUM)):
    for j in range(-1*NUM,NUM):
        res=(i**5)-(j**5)
        if res==X:
            ans_A=i
            ans_B=j
            flg=True
            break
    if flg:
        break

print(ans_A,ans_B)

Submission status: Runtime Error

Solution code:
import math
X = int(input())
is_prime = [False] * 2 + [True] * (X + 5)
prime_factors = {}
sup = int(math.sqrt(X)) + 5
ans = (0, 0)
# t := A - B
# A - B > 0 and A >= 0
def dfs(t, key_prime):
    global prime_factors, X, ans
    if key_prime >= len(prime_factors):
        return

    a = 0
    b = a - t
    Y = (a ** 5 - b ** 5) // t
    temp_X = X // t
    while Y <= temp_X:
        if Y == temp_X:
            ans = (a, b)
            return
        a += 1
        b = a - t
        Y = (a ** 5 - b ** 5) // t
        
    dfs(t, key_prime + 1)
    num_prime = list(prime_factors.keys())[key_prime]
    for _ in range(num_prime):
        t *= num_prime
        a = 0
        b = a - t
        Y = (a ** 5 - b ** 5) // t
        temp_X = X // t
        while Y <= temp_X:
            if Y == temp_X:
                ans = (a, b)
                return
            a += 1
            b = a - t
            Y = (a ** 5 - b ** 5) // t
        dfs(t, key_prime + 1)



for i in range(2, sup):
    if is_prime[i]:
        for j in range(i * i, X + 7, i):
            is_prime[j] = False

temp_X = X
for i in range(X + 5):
    if is_prime[i] and temp_X % i == 0:
        prime_factors[i] = 0
        while temp_X % i == 0:
            prime_factors[i] += 1
            temp_X //= i

if X == 1:
    print(1, 0)
else:
    dfs(1, 0)
    print(ans[0], ans[1])

Submission status: Runtime Error

Solution code:
X = int(input())
ans = None

for i in range(32):
    if ans == None:
        for t in range(-32,32):
            if i**5 - t**5 == X:
                ans = i,t
                break
            else:
                continue
    else:
        break

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

Submission status: Runtime Error

Solution code:

x = int(input())
for a in range(1,100):
    a_5 = a**5
    
    if a_5 > x:
        b = 1
        s = 0
        while s > x:
            s = a_5 - b**5
            if s == x:
                print(a, b)
                sys.exit()
            b += 1
            
    elif a_5 < x:
        b = -1
        s = 0
        while s < x:
            s = a_5 - b**5
            if s == x:
                print(a, b)
                sys.exit()
            b -= 1
    else:
        print(a,0)
        sys.exit()

Submission status: Runtime Error

Solution code:
import collections


def main():
    X = int(input())
    A, B = 0, 0
    for i in range(-120, 120):
        if A == 0 and B == 0:
            for j in range(-120, 120):
                if i ** 5 - j ** 5 = X:
                    A, B = i, j
                    break
        else:
            break

    print("{} {}".format(A, B))


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
x = int(input())

b = int(pow(x, 1/5))

for i in range(100000):
  A =  x + (b-i)**5
  a = pow(A, 1/5)
  if float(a).is_integer():
    exit(print(int(a), int(b+i)))

Submission status: Runtime Error

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

import math
x = int(input())

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
X=int(input())

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

Submission status: Runtime Error

Solution code:
X=int(input())

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

Submission status: Runtime Error

Solution code:
X= int(input())

Bp = -1*math.floor(X**0.2)
Bn = 0
while True:
    Bp += 1
    A = (X+Bp**5)**0.2
    if A == int(A):
        print(int(A),Bp)
        exit()

Submission status: Runtime Error

Solution code:
X = int(input())

Bp = 0
Bn = 0
while True:
    Bp += 1
    A = (X+Bp**5)**0.2
    if A == int(A):
        print(A,Bp)
        exit()

    Bn -= 1
    A = (X+Bn**5)**0.2
    if A == int(A):
        print(int(A),Bn)
        exit()

Submission status: Runtime Error

Solution code:
x=int(input())
for i in range(-200,200):
  for j in range(-200,200):
    if i**5-j**5==x:
      prtin(i,j)
      exit()

Submission status: Runtime Error

Solution code:
x=int(input())
for i in range(-200,200):
  for j in range(-200,200):
    if i**5-j**5==x
    prtin(i,j)
    exit()

Submission status: Runtime Error

Solution code:
def getInts():
    return [ int(x) for x in input().split() ]

def f(B):
    return (X + B**5 ) ** (1/float(5))

[X] = getInts()

BP = 0
BN = 0
while not f(BP).is_integer() and not f(BN).is_integer():
    BP += 1
    BN -= 1

if f(BP).is_integer():
    print(str(int(f(BP))) + " " + str(BP))
else:
    print(str(int(f(BN))) + " " + str(BN))

Submission status: Runtime Error

Solution code:
import sys


def resolve(in_):
    x = int(in_.read())
    for a in range(-118, 119 + 1):
        for b in range(-118, 119 + 1):
            if x == a ** 5 - b ** 5:
                return a, b
    raise ValueError()


def main():
    answer = resolve(sys.stdin.buffer)
    print('{} {}'.format(answer))


if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import collections
x = int(input())
dd = collections.defaultdict(int)
for i in range(-100,100,1):
    dd[i**5]=i
for i in range(-sqrt(x),sqrt(x),1):
    if(dd[i**5-x]!=0):
        print(i, dd[(i**5-x)])
        exit()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x = int(input())

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

print(a, b)

Submission status: Runtime Error

Solution code:
x = int(input())

for i in range(200):
    for j in range(-200, 0):
        if i ** 5 - j ** 5 == x:
            a=i
            b=j

print(a, b)

Submission status: Runtime Error

Solution code:
import math

x = int(input())
x_pow = round(math.pow(x, 1/5))
ok = 0

for a in range(-x_pow-10, x_pow+10):
  for b in range(-x_pow-10, x_pow+10):
    if a**5 - b**5 == x:
      print(a,b)
      ok = 1
      eixt()

Submission status: Runtime Error

Solution code:
def calc(X):
    A = 1
    B = 1
    if X == 0:
        return A,B
    else:
        l_bound = int(X**0.2)
        h_bound = l_bound * 2
        for i in range(l_bound,h_bound):
            for j in range(0,i+1):
                if i ** 5 - j ** 5 == X:
                    A = i
                    B = j
                    return A,B
                if i ** 5 + j ** 5 == X:
                    A = i
                    B = -j
                    return A,B
def resolve():
    X = int(input())
    A,B = calc(X)  
    print(str(A) + " " + str(B))
resolve()

Submission status: Runtime Error

Solution code:
def calc():
    X = int(input())
    A = 1
    B = 1
    if X == 0:
        return A,B
    if X == 2:
        B = -1
        return A,B
    else:
        l_bound = int(X**0.2)
        h_bound = l_bound * 2
        for i in range(l_bound,h_bound):
            for j in range(0,i):
                if i ** 5 - j ** 5 == X:
                    A = i
                    B = j
                    return A,B
                if i ** 5 + j ** 5 == X:
                    A = i
                    B = -j
                    return A,B 
def resolve():
    A,B = calc()  
    print(str(A) + " " + str(B))
resolve()

Submission status: Runtime Error

Solution code:
def calc():
    X = int(input())
    A = 1
    B = 1
    if X == 0:
        return A,B
    else:
        l_bound = int(X**0.2)
        h_bound = l_bound * 2
        for i in range(l_bound,h_bound):
            for j in range(0,i):
                if i ** 5 - j ** 5 == X:
                    A = i
                    B = j
                    return A,B
                if i ** 5 + j ** 5 == X:
                    A = i
                    B = -j
                    return A,B 
def resolve():
    A,B = calc()  
    print(str(A) + " " + str(B))
resolve()

Submission status: Runtime Error

Solution code:
def calc():
    X = int(input())
    A = 1
    B = 1
    if X == 0:
        return A,B
    else:
        l_bound = int(X**0.2)
        h_bound = l_bound * 2
        for i in range(l_bound,h_bound):
            for j in range(0,i):
                if i ** 5 - j ** 5 == X:
                    A = i
                    B = j
                    return A,B
                if i ** 5 + j ** 5 == X:
                    A = i
                    B = -j
                    return A,B 

def resolve():
    A,B = calc()  
    print(str(A) + " " + str(B))
resolve()

Submission status: Runtime Error

Solution code:
x = int(input())

for a in range(1000):
    for b range(1000):
        if a ** 5 - b ** 5 == x:
            print(a,b)
            exit()

Submission status: Runtime Error

Solution code:
def main():
    X = int(input())
    Y = int(X**(1/5))+1
    for A in range(-Y,Y):
        for B in range(-Y,Y):
            if A**5 - B**5==X:
                return A,B

if __name__ == "__main__":
    A,B=main()
    print("{} {}".format(A,B))

Submission status: Runtime Error

Solution code:
x=int(input())

for i in range(-118,120):
  for j in range(-119,119):
    if i**5-j**5==x:
      print(i,j)
      exit(1)

Submission status: Runtime Error

Solution code:
x=int(input())

for i in range(-118,120):
  for j in range(-118,120):
    if i**2-j**2==x:
      print(i,j)
      exit(1)

Submission status: Runtime Error

Solution code:
X = int(input())
print(X)
# Xの素因数分解をうまくつかう
# A^5 - B^5 =(A-B)(A^4+A^3B+A^2B^2+AB^3+B^4)
# どっちが正負かは決まらない
# AB(A^2+B^2)+(A^2+B^2)^2-A^2B^2
# AB((A-B)^2+2AB)+((A-B)^2+2AB)^2 - A^2B^2
# A-B = P
# AB = Q
# A^5-B^5 = P(Q(P^2+2Q)+(P^2+2Q)^2-Q^2) = P(P^4+5P^2Q+5Q^2) = P(5Q^2+5P^2Q+P^4)
# Qは整数解なので
# 5Q^2+5P^2Q+P^4が整数解を持つ楽な方法は(Q+P)^2の形の時、つまり2P = P^2+2, 
# X = PRとする
# R-P^4は5の倍数になる

#Aの上限を求める
# X<10^9
# A-B = 1がAを最大にできる

maxA = 126
maxX = pow(10, 9)

flag = 0
for A in range(-126, 126):
    for B in range(-127, A):
        result = pow(A, 5) - pow(B, 5)
        if result > maxX:
            next
        if result == X:
            print(A, B)
            flag = 1
            break
    if flag == 1:

Submission status: Runtime Error

Solution code:
X = int(input())
import sys
for a in range(-118, 120, 1):
    for b in range(-119, 119, 1):
        if x == pow(a,5) - pow(b,5):
            print(x)
            sys.exit()

Submission status: Runtime Error

Solution code:
X = int(input())
y =120
a ={i**5 for i in range(-y,y)}
ans_a =0
ans_b =0
for b in range(-y,y):
    if X +b**5 in a:
        #ans_a =int( (X +b**5 +1)**0.2 )
        ans_a =int( (X +b**5 )**0.2 )
        ans_b =b
        break
print(ans_a,ans_b)

Submission status: Runtime Error

Solution code:
X = int(input())
y =2*10**2
a ={i**5 for i in range(-y,y)}
ans_a =0
ans_b =0
for b in range(-y,y):
    if X +b**5 in a:
        #ans_a =int( (X +b**5 +1)**0.2 )
        ans_a =int( (X +b**5 )**0.2 )
        ans_b =b
        break
print(ans_a,ans_b)

Submission status: Runtime Error

Solution code:
X = int(input())
a ={i**5 for i in range(-10**5,10**5)}
ans_a =0
ans_b =0
for b in range(-10**5,10**5):
    if X +b**5 in a:
        #ans_a =int( (X +b**5 +1)**0.2 )
        ans_a =int( (X +b**5 )**0.2 )
        ans_b =b
        break
print(ans_a,ans_b)