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:
def main():
    x = int(input())
    ans = solve(x)
    print(*ans if ans is not None else '')


def solve(x):
    numbers = {i:i ** 5 for i in range(10 ** 3 + 1)}
    #print(numbers)
    for n1, i in numbers.items():
        for n2, j in numbers.items():
            if i - j == x:
                return n1, n2
            if i + j == x:
                return n1, -n2


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

Solution code:
X=int(input())
for a in range(-118,120):
  for b in range(-118,120):
    if a**5-b**5==X:
      print(a,b)
      exit(0)

Submission status: Accepted

Solution code:
import itertools
import math
import string
import collections
from collections import Counter
from collections import deque
import sys
sys.setrecursionlimit(2*10**5)
INF = 2**60


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


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

x = int(input())
for i in range(-1000, 1001):
    for j in range(-1000, 1001):
        if i**5-j**5 == x:
            print(i, j)
            exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

for A in range(-150,150):
    for B in range(-150,150):
        if A ** 5 - B ** 5 == X:
            print(A,B)
            exit()

Submission status: Accepted

Solution code:
s = list(map(int,input().split()))
x=s[0]
a=0

for i in range(-118,119):
    for j in range(-120,120):
        a=i**5-j**5
        if a==x:
            print(i,j)
            break
    else:
        continue
    break

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
rep = 10**4
for i in range(rep):
    for j in range(rep):
        if i**5-j**5==x:
            print(i,j)
            exit()
        elif i**5+j**5==x:
            print(i,-j)
            exit()

Submission status: Accepted

Solution code:
x = int(input())
a,b = 0,0
f = 0
for i in range(int(x**0.25)+1):
    for j in range(int(x**0.25)+1):
        if i**5 - j**5 == x:
            a = i
            b = j
            f = 1
            break
        elif i**5 + j**5 == x:
            a = i
            b = -j
            f = 1
            break
    if f:
        break
print(a,b)

Submission status: Accepted

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

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)
      exit()

Submission status: Accepted

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

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)
      exit()

Submission status: Accepted

Solution code:
x = int(input())
for a in range(-200, 201):
    for b in range(-200, 201):
        if pow(a, 5) - pow(b, 5) == x:
            print('{} {}'.format(a, b))
            break
    else:
        continue
    break

Submission status: Accepted

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

for a in range(-118,119,1):
    for b in range(-119,118,1):
        if a**5-b**5 == x:
            break

    else:
        continue
    break

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

Submission status: Accepted

Solution code:
X = int(input())
for a in range(-120, 120):
    find = False
    for b in range(-120, 120):
        x = a**5-b**5
        if x == X:
            find = True
            print(a, b)
            break
    if find:
        break

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():

    def main():
        X=int(input())
        for a in range(-200,200):
            for b in range(-200,200):
                if pow(a,5)-pow(b,5)==X:
                    return [a,b]
    print(*main())

resolve()

Submission status: Accepted

Solution code:
X = int(input())

def binary_search(b):
    l, r = -10 ** 9, 10 ** 9
    while r-l > 1:
        m = (l+r)//2
        x = m**5 - b**5
        if x < X:
            l = m
        else:
            r = m
    return r

for b in range(-200, 200):
    a = binary_search(b)
    if a ** 5 - b ** 5 == X:
        print(a, b)
        break

Submission status: Accepted

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,sep=" ")
      break
  else:
    continue
  break

Submission status: Accepted

Solution code:
# D - I hate Factorization

x = int(input())

# a ** 5 - b ** 5 == x となる組 (a,b) を1つ答える.
# 1 <= x <= 10 ** 9
# a >= 0と仮定してもよい. b < aと仮定してよい. bが減ると左辺は増加.

a = 0
while a ** 5 - (a-1) ** 5 <= x:
    b = a - 1
    while a ** 5 - b ** 5 < x:
        b -= 1
    if a ** 5 - b ** 5 == x:
        print(a, b)
        exit()
    a += 1

Submission status: Accepted

Solution code:
x=int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=int(input())

for a in range(-120, 120):
    a5 = a**5
    for b in range(-120, 120):
        if (a5 < x and b >= 0 ) or (a5 > x and b <= 0):
            continue
        if a5 - b**5 == x:
            print(a, b)
            break
    else:
        continue
    break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import math
import sys

X = int(input())

for A in range(-118, 120):
  for B in range(-119, 119):
    val = math.pow(A, 5) - math.pow(B, 5)
    if(val == X):
      print(A, B)
      sys.exit()

Submission status: Accepted

Solution code:
x=int(input())
for i in range(-120,120):
    for l in range(-120,120):
        g=i**5
        g-=l**5
        if g==x:
            print('{} {}'.format(i,l))
            exit()

Submission status: Accepted

Solution code:
x=int(input())
A = 0
B = 0
for a in range(-120, 120):
    a5 = a**5
    for b in range(-120, 120):
        if (a5 < x and b >=0 ) or (a5 > x and b <= 0):
            continue
        if a5 - b**5 == x:
            A = a
            B = b
            break
print(A, B)

Submission status: Accepted

Solution code:
x=int(input())
A=0
B=0
for a in range(-120, 120):
    a5 = a**5
    for b in range(-120, 120):
        if a5 - b**5 == x:
            A = a
            B = b
            break
print(A,B)

Submission status: Accepted

Solution code:
x = int(input())
lst = [(pow(i, 5), i) for i in range(-200, 200)]
for i in range(len(lst)):
    for j in range(len(lst)):
        if lst[j][0] - lst[i][0] == x:
            print(lst[j][1], lst[i][1])
            exit()

Submission status: Accepted

Solution code:
x=int(input())
A=0
B=0
for a in range(-120,120):
    for b in range(-500,500):
        if a**5-b**5==x:
            A=a
            B=b
            break
print(A,B)

Submission status: Accepted

Solution code:
x=int(input())
A=0
B=0
for a in range(-500,500):
    for b in range(-500,500):
        if a**5-b**5==x:
            A=a
            B=b
            break
print(A,B)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

x=int(input())
A=0
B=0
for a in range(-500,500):
    for b in range(-500,500):
        if a**5-b**5==x:
            A=a
            B=b
            break
print(A,B)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
INF = 10**10
MOD = 10**9 + 7
X = int(input())
MAX_X = 10**9
n = 0
while(1):
    n+=1
    if n**5 - (n-1)**5 > MAX_X:
        break
for i in range(n):
    #for j in range(-n+1,n-1):
    for j in range(-64,n-1):
        if i**5 - j**5 == X:
            print (i,j)
            exit()

Submission status: Accepted

Solution code:
#  =========     /\       /|    |====/|
#      |        /  \       |    |   / |
#      |       /____\      |    |  /  |
#      |      /      \     |    | /   |
#  ========= /        \  =====  |/====|  
#  code

def main():
    x = int(input())
    for i in range(-500 , 500):
        for j in range(-500 , 500):
            if i ** 5 - j ** 5 == x:
                print(i , j)
                return
    return

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math
from collections import defaultdict
 
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res

x = readInt()

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(1000000)


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

    for i in range(-119, 121):
        a5 = i**5
        for j in range(-120, 120):
            b5 = j ** 5
            if a5 - b5 == x:
                print(str(i) + " " + str(j))
                return


main()

Submission status: Accepted

Solution code:
X = int(input())


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

Submission status: Accepted

Solution code:
def f(x):
    return pow(x, 5) - pow(x - 1, 5)


x = int(input())

a_mx = 1
while f(a_mx) < x:
    a_mx += 1

a_mn = 0
while f(a_mn) < x:
    a_mn -= 1

b_mx = a_mx - 1
b_mn = a_mn - 1

for a in range(a_mn, a_mx + 1):
    for b in range(b_mn, b_mx + 1):
        if pow(a, 5) - pow(b, 5) == x:
            print(a, b)
            exit()

Submission status: Accepted

Solution code:
X = int(input())

for i in range(-500, 500):
  for j in range(-500, 500):
    if i**5 - j**5 == X:
      print(i, j)
      exit(0)

Submission status: Accepted

Solution code:
X=int(input())
for a in range(-200,200):
  for b in range(-200,200):
    if(X==a**5-b**5):
      print(a,b)
      exit()

Submission status: Accepted

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

  #-118<=A<=119, -119<=B<=118
  for a in range(-188, 200):
      for b in range(-199, 118):
          if pow(a, 5) - pow(b, 5) == x:
              print(a, b)
              break
      else:
          continue
      break


if __name__ == '__main__':
  main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
MIN = -119
MAX = 120
def calc(A, B):
    return A**5 - B**5

def main():
    X = int(input())
    for i in range(MIN, MAX+1, 1):
        for j in range(MIN, MAX+1, 1):
            if(X == calc(i, j)):
                print(*(i, j))
                return
main()

Submission status: Accepted

Solution code:
def main():
    x = int(input())
    for i in range(200):
        for j in range(-200, 200):
            if i**5-j**5==x:
                print(i, j)
                return
 
 
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
from math import ceil, sqrt
def input(): return sys.stdin.readline().strip()


def main():
    X = int(input())
    """
    # ここで丸め誤差が出たせいで数学的にはTrueなものがFalse扱いされていた！！！
    # （例：3125**(1/5) = 5.000000000000001）
    x = int(X ** (1/5))
    if x == X ** (1/5):
        print("{} {}".format(x, 0))
        return
    # 正しくは以下：
    """
    x = round(X ** (1/5))
    if x ** 5 == X:
        print("{} {}".format(x, 0))
        return
    
    for B in range(1, x + 1):
        """
        # ここも丸め誤差が出るので修正が必要
        A = (X - B**5) ** (1/5)
        if A < B: break
        if int(A) == A:
            print("{} {}".format(int(A), -B))
            return
        """
        A = round((X - B**5) ** (1/5))
        if A < B: break
        if A ** 5 + B ** 5 == X:
            print("{} {}".format(int(A), -B))
            return
    
    """
    ここも修正
    y = sqrt(X)
    if int(y) == y:
    """
    y = round(sqrt(X))
    if y ** 2 == X:
        upper = y + 1
    else:
        upper = y

    for d in range(1, upper):
        if X % d == 0:
            B = 1
            while (B + d) ** 5  < B ** 5 + X:
                B += 1
            if (B + d) ** 5 == B ** 5 + X:
                print("{} {}".format(B + d, B))
                return
            
            e = X // d
            B = 1
            while (B + e) ** 5  < B ** 5 + X:
                B += 1
            if (B + e) ** 5 == B ** 5 + X:
                print("{} {}".format(B + e, B))
                return
       


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from itertools import combinations

x = int(input())
num = [i**5 for i in range(1000)]

for a, b in combinations(num, 2):
    if a - b == x:
        print(int(a**0.2), int(b**0.2))
    elif a + b == x:
        print(int(a**0.2), -int(b**0.2))
    elif b - a == x:
        print(int(b**0.2), int(a**0.2))
    else:
        continue
    break

Submission status: Accepted

Solution code:
import math
from collections import defaultdict
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:(input())

"""========main code==============="""
def fast(a,b):
    res=1
    while(b>0):
        if(b&1):
            res*=a
        a*=a    
        b>>=1
    return res
x=ii()
f=0
for i in range(-2001,2001):
    k=fast(i,5)
    for j in range(i,2001):
        p=fast(j,5)
        #print(k,p,i,j,p-k)
        if((p-k)==x):
            print(j,i)
            f=1
            break
        elif(k-p==x):
            print(i,j)
            f=1
            break
    if f:
        break

Submission status: Accepted

Solution code:
import math
from collections import defaultdict
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:(input())

"""========main code==============="""
def fast(a,b):
    res=1
    while(b>0):
        if(b&1):
            res*=a
        a*=a    
        b>>=1
    return res
x=ii()
f=0
for i in range(-201,201):
    k=fast(i,5)
    for j in range(i,201):
        p=fast(j,5)
        #print(k,p,i,j,p-k)
        if((p-k)==x):
            print(j,i)
            f=1
            break
        elif(k-p==x):
            print(i,j)
            f=1
            break
    if f:
        break

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
INF = 10**10
MOD = 10**9 + 7
X = int(input())
MAX_X = 10**9
n = 0
while(1):
    n+=1
    if n**5 - (n-1)**5 > MAX_X:
        break
for i in range(n):
    for j in range(-n+1,n-1):
        if i**5 - j**5 == X:
            print (i,j)
            exit()

Submission status: Accepted

Solution code:
# https://ja.wolframalpha.com/input/?i=1<%3D+x^5-y^5<%3D10^9
from itertools import*
x=int(input());r=range(-200,200)
for a,b in product(r,r):
 if a**5-b**5==x:print(a,b);exit()

Submission status: Accepted

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

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)
            exit()

Submission status: Accepted

Solution code:
x = int(input())

def bf(x):
    for i in range(-120, 120):
        for j in range(-120, 120):
            if i**5 - j**5 == x:
                print(i, j)
                return

bf(x)

Submission status: Accepted

Solution code:
X = int(input())

for i in range(-1000, 1001):
    for j in range(-1000, 1001):
        if i**5 - j**5 == X:
            print(i, j)
            exit()

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)

X = int(readline().rstrip())

lim = 0
N = 0
while True:
    N += 1
    tmp = (N ** 5) - (N - 1) ** 5
    if tmp > X:
        lim = N
        break

for A in range(0, N):
    for B in range(-N, N):
        tmp = (A ** 5) -  (B ** 5)
        if tmp == X:
            print(A, B)
            exit()

Submission status: Accepted

Solution code:
X = int(input())

# 素数と個数を求める
def factorize(n):
    res = list()
    i = 2
    while i*i <= n:
        if n%i == 0:
            c = 0
            while n%i == 0:
                n /= i
                c += 1
            res.append([i,c])
        i += 1
    if n != 1:
        res.append([n,1])
    return res

for a in range(-200,200+1):
    a5 = a**5
    b5 = a5 - X
    sign = 1
    if b5 < 0:
        b5 = -b5
        sign = -1

    pc = factorize(b5)

    b = 1
    if b5 == 0: b = 0
    for p,c in pc:
        if c == 5:
            b *= p
        else:
            break

    if b**5 == b5:
        print(a, sign*b)
        break

Submission status: Accepted

Solution code:
x = int(input())
done=False
l=6200
for a in range(-l,l+1):
  for b in range(-l,l+1):
    if(not done and a**5-b**5==x):
      print(a,b)
      done=True

Submission status: Accepted

Solution code:
X = int(input())

# 素数と個数を求める
def factorize(n):
    res = list()
    i = 2
    while i*i <= n:
        if n%i == 0:
            c = 0
            while n%i == 0:
                n /= i
                c += 1
            res.append([i,c])
        i += 1
    return res

# for a in range(200+1):
for a in range(-200,200+1):
    a5 = a**5
    b5 = a5 - X
    sign = 1
    if b5 < 0:
        b5 = -b5
        sign = -1

    pc = factorize(b5)

    b = 1
    if b5 == 0: b = 0
    for p,c in pc:
        if c == 5:
            b *= p
        else:
            break

    if b**5 == b5:
        print(a, sign*b)
        break

Submission status: Accepted

Solution code:
x = int(input())
done=False
for a in range(-6000,6001):
  for b in range(-6000,6001):
    if(not done and a**5-b**5==x):
      print(a,b)
      done=True

Submission status: Accepted

Solution code:
import sys
input = lambda:sys.stdin.readline().strip()
x = int(input())
ok = False
for a in range(120):
    for b in range(-120,a):
        if a**5-b**5==x:
            print(a,b)
            ok = True
            break 
    if ok:
        break

Submission status: Accepted

Solution code:
x = int(input())
done=False
for a in range(-5000,5001):
  for b in range(-5000,5001):
    if(not done and a**5-b**5==x):
      done=True
      print(a,b)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from itertools import combinations
import numpy as np
import math
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

divisors = make_divisors(X)

for d in divisors:
    f = lambda x: (x + d) ** 5 - x ** 5
    if f(d / -2) <= X and f(10 ** 3) > X:
        ok = d / -2
        ng = 10 ** 3
        for _ in range(100):
            c = (ok + ng) / 2
            if f(c) <= X:
                ok = c
            else:
                ng = c
        if math.isclose(ok, round(ok)):
            print(round(ok) + d, round(ok))
            exit()
    if f(d / -2) <= X and f(-10 ** 3) > X:
        ok = d / -2
        ng = -10 ** 3
        for _ in range(100):
            c = (ok + ng) / 2
            if f(c) <= X:
                ok = c
            else:
                ng = c
        if math.isclose(ok, round(ok)):
            print(round(ok) + d, round(ok))
            exit()

Submission status: Accepted

Solution code:
import sys, math
x = int(sys.stdin.readline())

L = [i**5 for i in range(10000)]
flag = False
for i in range(10000):
    for j in range(10000):
        if L[i] - L[j]==x:
            print(i, j)
            flag = True
            break
        elif L[i] + L[j]==x:
            print(i, -j)
            flag = True
            break
    if flag ==True:
        break
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=int(input())

for a in range(301):
    aa = pow(a,5) - x
    for b in range(301):
        if aa == pow(b,5):
            print(a,b)
            exit()

        if -aa == pow(b,5):
            print(a,-b)
            exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

for i in range(-118,120):
  for j in range(-118,120):
    if pow(i, 5) - pow(j, 5) == n:
      print(i,j)
      quit()

Submission status: Accepted

Solution code:
from sys import stdin
x = int(stdin.readline().rstrip())

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

Submission status: Accepted

Solution code:
X = int(input())

ans = [0,0]
for i in range(-500,500):
  for j in range(-500,500):
    if i**5 - j**5 == X:
      ans[0] = i
      ans[1] = j
      break

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

Submission status: Accepted

Solution code:
#n = int(input())
#a,b = map(int,input().split())
#a_L = list(map(int,input().split()))
# (ａ－ｂ)(ａ⁴＋ａ³ｂ＋ａ²ｂ²＋ａｂ³＋ｂ⁴) = X
x = int(input())

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


# a = x+b**5
# if a**(1/5).is_integer():
# print(int(a**(1/5)),b)
# exit()

Submission status: Accepted

Solution code:
def sol(n):
    d = {}
    N = 1000
    for i in xrange(-N, N+1):
        d[i**5]=i
    for i in d:
        j = n+i
        if j in d:
            print d[j], d[i]
            return

def main():
    n = input()
    sol(n)
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
X = int(input())

for A in range(-1000, 1000):
    for B in range(-1000, 1000):
        if A ** 5 - B ** 5 == X:
            print(A, B)
            exit()

Submission status: Accepted

Solution code:
X = int(input())
def add(a,b):
  return a**4+a**3*b+a**2*b**2+a*b**3+b**4
for i in range(-118,120):
  for j in range(-118,120):
    if (i-j)*add(i,j) == X:
      print(i,j)
      quit()

Submission status: Accepted

Solution code:
x = int(input())
for a in range(-300,301):
  if(a<0):
    for b in range(-300,a):
      if(a**5-b**5==x):
        print(a,b)
        break
    else: continue
    break
  else:
    for b in range(-300,a):
      if(a**5-b**5==x):
        print(a,b)
        break
    else: continue
    break

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
A = 0
B = 0
for i in range(-1000,1000):
  if i**5 + x >= 0 and float.is_integer(round((i**5 + x)**0.2,5)) == True:
    A = (i**5 + x)**0.2
    B = i
    break

print(int(A),B)

Submission status: Accepted

Solution code:
import math
X=int(input())
c=0
for i in range(200):   
  for j in range(-200,200):
    if i**5-j**5==X:
      c=1
      break
      
  if c==1:
    break
      
print(i,j)

Submission status: Accepted

Solution code:
from __future__ import print_function

import sys
sys.setrecursionlimit(500000)

import re
import array
import copy
import functools
import operator

import math
import string
import fractions
from fractions import Fraction

import collections
import itertools
import bisect

import random
import time

import heapq
from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace
from queue import PriorityQueue as pq
from queue import Queue

from itertools import accumulate

from collections import deque
from collections import Counter

from operator import mul
from functools import reduce

input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return

# from fractions import gcd
# from math import gcd

# def lcm(n, m):
#     return int(n * m / gcd(n, m))


# def coprimize(p, q):
#     common = gcd(p, q)
#     return (p // common, q // common)


# def find_gcd(list_l):
#     x = reduce(gcd, list_l)
#     return x


def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


def main():
    # inputs
    x = int(input().strip())

    # a,b > 0
    for a in range(0,200):
        for b in range(0,a+1):
            if a**5 - b**5 ==x:
                print(a,b)
                return

    # a >0 and b < 0
    for a in range(0,100):
        for b in range(-100,1):
            if a**5 - b**5 == x:
                print(a,b)
                return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from __future__ import print_function

import sys
sys.setrecursionlimit(500000)

import re
import array
import copy
import functools
import operator

import math
import string
import fractions
from fractions import Fraction

import collections
import itertools
import bisect

import random
import time

import heapq
from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace
from queue import PriorityQueue as pq
from queue import Queue

from itertools import accumulate

from collections import deque
from collections import Counter

from operator import mul
from functools import reduce

input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return

# from fractions import gcd
# from math import gcd

# def lcm(n, m):
#     return int(n * m / gcd(n, m))


# def coprimize(p, q):
#     common = gcd(p, q)
#     return (p // common, q // common)


# def find_gcd(list_l):
#     x = reduce(gcd, list_l)
#     return x


def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


def main():
    # inputs
    x = int(input().strip())

    # a,b > 0
    for a in range(0,2000):
        for b in range(0,a+1):
            if a**5 - b**5 ==x:
                print(a,b)
                return

    # a >0 and b < 0
    for a in range(0,100):
        for b in range(-100,1):
            if a**5 - b**5 == x:
                print(a,b)
                return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
X=int(input())
for a in range(-118,120):
  for b in range(-118,a+1):
    if a**5-b**5==X:
      print("%s %s" % (a,b))
      exit()

Submission status: Accepted

Solution code:
from copy import deepcopy
from sys import exit,setrecursionlimit
import math
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac
import fractions
from functools import reduce
from operator import mul
import bisect
import sys
import logging
import heapq
import itertools

logging.basicConfig(level=logging.ERROR)

#input = sys.stdin.readline

setrecursionlimit(1000000)


def main():
    x = int(input())
    for a in range(-200,201):
        for b in range(-200,201):
            if(a**5-b**5 == x):
                print(a,b)
                return

main()