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 = [0]
n = 1
while True:
    facts.append(n ** 5)
    if facts[-1] - facts[-2] > X:
        break
    n += 1

facts = set(facts)

for f0 in facts:
    f1 = None
    if abs(f0 - X) in facts:
        f1 = abs(f0 - X)
        r0 = int(f0 ** 0.2)
        r1 = int(f1 ** 0.2)
        if f0 - f1 == X:
            print(r0, r1)
        else:
            print(r0, -r1)
        break

Submission status: Accepted

Solution code:
import sys
def I(): return int(sys.stdin.readline().rstrip())

def Main():
    x = I()
    for a in range(-118,120):
        for b in range(-118,120):
            if a**5-b**5 == x:
                print(a,b)
                exit()
    return

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:
from math import sqrt
x = int(input())

ps = []
for i in range(1, int(sqrt(x)) + 1):
  if x % i == 0:
    ps.append(i)
    ps.append(x // i)

for p_ in ps:
  for p in (-p_, p_):
    for r in (-1, 1):
      for s in (-1, 1):
        try:
            a = (p + r * sqrt(-5 * p**2 + s * (2 * sqrt(5) *
                                              sqrt(p ** 6 + 4 * p * x)) / p) / sqrt(5)) / 2
            if abs(a - round(a)) < 1e-6:
              a = round(a)
              print(a, a - p)
              exit()
        except ValueError:
          pass

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
X=int(input())
X5=X**0.2
#print('X5=',X5,int(X5))
if X5-int(X5)==0:
    a=int(X5)
    b=0
    print(a,b)
    #print(1)
    sys.exit()
for a in range(1,int(X5)+1):
    for mb in range(a):
        if a**5+mb**5==X:
            print(a,-mb)
            #print(2)
            sys.exit()
for a in range(1,2*int(X5)):
    for b in range(a):
        if a**5-b**5==X:
            print(a,b)
            #print(3)
            sys.exit()
#print(4)

Submission status: Accepted

Solution code:
x = int(input())

flag = 0

for a in range(x):
    b5 = a**5 - x
    for b in range(120):
        if abs(b5) == int(b**5):
            if b5 < 0:
                b = -b
            flag = 1
            break
    if flag:
        break

print(a, int(b))

Submission status: Accepted

Solution code:
n = int(input())
tp = ((1,1),(1,-1))
for i in range(200):
    for j in range(200):
        for k in tp:
            a,b = i*k[0],j*k[1]
            if((a**5 - b**5)==n):
                print(a,b)
                exit()

Submission status: Accepted

Solution code:
def calc(X):
    A = 1
    B = 1
    if X == 0:
        return A,B
    else:
        l_bound = 1
        h_bound = 200
        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: Accepted

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

Submission status: Accepted

Solution code:
def main():
    x = int(input())
    for i in range(-200, 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:
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())
MAX=2*int(X**(1/5))+1
MIN=-2*int(X**(1/5))-1
for A in range(MIN,MAX):
    for B in range(MIN,MAX):
        if A**5-B**5==X:
            print(A,B)
            exit()

Submission status: Accepted

Solution code:
X=int(input())
MAX,MIN=0,0
diff=0
while diff<=10**9:
    MAX+=1
    diff=MAX**5-(MAX-1)**5
diff=0
while diff<=10**9:
    MIN-=1
    diff=MIN**5-(MIN-1)**5
for A in range(MIN,MAX):
    for B in range(MIN,MAX):
        if A**5-B**5==X:
            print(A,B)
            exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
def fact(n):
    ans = 1
    for i in range(2, n+1):
        ans*= i
    return ans
def comb(n, c):
    return fact(n)//(fact(n-c)*c)

x = int(input())
a = 0
b = 0
done = False
for f in range(-300, 300):
    for l in range(-300, 300):
        if((f**5)-(l**5)==x):
            a = f
            b = l
            done = True
            break
    if(done):
        break
print(a,b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    X = int(input())
    Y = 2*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: Accepted

Solution code:
import sys
X = int(input())
#%%

for a in range(1000):
    for b in range(-1000, 1000):
        if pow(a, 5) - pow(b, 5) == X:
            print(a,b)
            sys.exit( )

Submission status: Accepted

Solution code:
X=int(input())

n = 0

big = 0
small=0

#print(10**9)

while True:

   if (n**5 - (n-1)**5) > 10**9 :
     break
   big=n
   n += 1

n=0
while True:
   if (n**5 - (n-1)**5) > 10**9 :
     break
   small=n
   n -= 1

a = list(range(0, big,   1))+list(range(-1, small-1, -1))
b = list(range(0, big-1, 1))+list(range(-1, small-2, -1))

stopFlag = False
for ia in a:
   if stopFlag :
      break
   for ib in b:

     if (ia**5) - (ib**5) == X:
        print(ia, ib)
        stopFlag = True
        break

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

Solution code:
def main():
    x = int(input())
    for i in range(-120, 121):
        for j in range(-120, 121):
            if i**5 - j**5 == x:
                print(i, j)
                exit(0)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import glob
import bisect

# 問題ごとのディレクトリのトップからの相対パス
REL_PATH = 'ABC\\166\\D'

# テスト用ファイル置き場のトップ
TOP_PATH = 'C:\\AtCoder'

class Common:

    problem = []
    index = 0

    def __init__(self, rel_path):
        self.rel_path = rel_path

    def initialize(self, path):
        file = open(path)
        self.problem = file.readlines()
        self.index = 0
        return

    def input_data(self):
        try:
            IS_TEST
            self.index += 1
            return self.problem[self.index-1]

        except NameError:
            return input()

    def resolve(self):
        pass

    def exec_resolve(self):
        try:
            IS_TEST
            for path in glob.glob(TOP_PATH + '\\' + self.rel_path + '/*.txt'):
                print("Test: " + path)
                self.initialize(path)
                self.resolve()
                print("\n\n")
        except NameError:
            self.resolve()


class Solver(Common):

    def calc(self, num):
        if num < 2:
            return 0
        return num * (num-1) / 2

    def resolve(self):

        X = int(self.input_data())

        squares = [0]*401
        for i in range(0,401):
            squares[i] = (i-200) ** 5

        finish = False
        for i in range (1,401):
            for j in range(0,400):
                if squares[i] - squares[j] == X:
                    print(str(i-200) + ' ' + str(j-200))
                    finish = True
                    break
            if finish:
                break


solver = Solver(REL_PATH)
solver.exec_resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=int(input())
# an = n^5 - (n - 1)^5
# a -> 120~-119 -> -118~119
# b -> 119~-120 -> -119~118
for i in range(-118,120):
  for j in range(-119,119):
    if i**5-j**5==x:
      print(i,j)
      exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
y = x
if x == 1:
    print('0 -1')
    exit()
v = []
for i in range(0,1001):
    v.append(i*i*i*i*i)
    v.append(i*i*i*i*i*-1)
c = 0
d = 0
for i in range(len(v)):
    y -= v[i]
    for j in range(len(v)):
        if v[j] == y * -1:
            c = i
            d = j
            break
    y = x
if c % 2 == 0: c //= 2
else:
    c = (c-1) // 2
    c *= -1
if d % 2 == 0: d //= 2
else:
    d = (d-1) // 2
    d *= -1
print(c,d)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

X = INT()

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

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()
 
x=int(input())
a=1
while True:
    for b in range(a + 1):
        if a**5+b**5==x:
            print(a,-b)
            sys.exit()
        elif a**5-b**5==x:
            print(a,b)
            sys.exit()
    else:
        a+=1

Submission status: Accepted

Solution code:
import sys

def solve():
    input = sys.stdin.readline
    X = int(input())
    fin = False
    for i in range(-1000, 1001):
        for j in range(-1000, 1001):
            if pow(i, 5) - pow(j, 5) == X:
                print(i, j)
                fin = True
                break
        if fin: break
    else: print(-1)

    return 0

if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
X = int(input())
N = int(X**(1/5))
ans = [0,0]
for i in range(-2*N-1, 2*N+2):
  for j in range(-2*N-1, 2*N+2):
    if i**5-j**5==X:
      ans = [i, j]
ans = [str(i) for i in ans]
ans = ' '.join(ans)
print(ans)

Submission status: Accepted

Solution code:
X = int(input())
for i in range(1,int(X**0.5)+1):
    if X%i==0:
        a = i
        b = X//i
        flag = 0
        for j in range(-1000,1000):
            B = j
            A = j+a
            if A**4+A**3*B+A**2*B**2+A*B**3+B**4==b:
                print(A,B)
                flag = 1
                break
        if flag==1:break
        a = X//i
        b = i
        flag = 0
        for j in range(1,1000):
            B = j
            A = j+a
            if A**4+A**3*B+A**2*B**2+A*B**3+B**4==b:
                print(A,B)
                flag = 1
                break

Submission status: Accepted

Solution code:
from sys import stdin
def main():
    #入力
    readline=stdin.readline
    x=int(readline())
    flag=False
    for a in range(-200,201):
        for b in range(-200,201):
            if a**5-b**5==x:
                print(a,b)
                flag=True
                break
        if flag: break

if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
#from fractions import gcd
#from itertools import combinations # (string,3) 3回
#from collections import deque
from collections import defaultdict
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
x = I()
for a in range(-1005,1005,1):
    for b in range(-1005,1005,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(-118, 120):
    for j in range(-119, 119):
        if x == i**5 - j**5:
            print(i,j)
            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()

Submission status: Accepted

Solution code:
X =int(input())
def jug(n):
    if n>0:
        return 1
    else:
        return -1

ALL = [i**5 for i in range(-200,200+1)]
for a in ALL:
    for b in ALL:
        if a-b ==X:
            ans =[jug(a)*int(abs(a)**(1.0/5)),jug(b)*int(abs(b)**(0.2))]
            print(ans[0],ans[1])
            exit()

Submission status: Accepted

Solution code:
def main():
    x = int(input())
    gojo = [int(i**5) for i in range(-1100, 1100)]
    for i, v1 in enumerate(gojo):
        x1 = i - 1100
        for j, v2 in enumerate(gojo):
            x2 = j - 1100
            if v1 - v2 == x:
                print(x1, x2)
                return


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())
# 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:
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict

d = defaultdict(list)
for i in range(-120, 121):
  for j in range(-120, 121):
    x = i**5 - j**5
    if x >= 1:
      d[x] = [i, j]
    
X = int(input())

print('{0[0]} {0[1]}'.format(d[X]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
def f(a,b):
    return a**5-b**5

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

Submission status: Accepted

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

Submission status: Accepted

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(a, b)
            sys.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:
X = int(input())
y =10**5
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 )
        if X +b**5 >0:
            ans_a =int( (X +b**5 )**0.2 )
        else:
            ans_a = -int( abs(X +b**5 )**0.2 )
        ans_b =b
        break
print(ans_a,ans_b)

Submission status: Accepted

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 )
        if X +b**5 >0:
            ans_a =int( (X +b**5 )**0.2 )
        else:
            ans_a = -int( abs(X +b**5 )**0.2 )
        ans_b =b
        break
print(ans_a,ans_b)

Submission status: Accepted

Solution code:

import sys

X = int(input())
a = [i for i in range(-119, 120)]
b = [i for i in range(-119, 120)]

for i in a:
    for k in b:
        if i**5 == X + k**5:
            print(i,k)
            sys.exit()

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)
            break
    else:
        continue
    break

Submission status: Accepted

Solution code:
x = int(input())
a = [i for i in range(120)] + [-i for i in range(1,119)]
b = [i for i in range(119)] + [-i for i in range(1,120)]

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

Submission status: Accepted

Solution code:
X =int(input())
for A in range(120):
    for B in range(-120,120):
        if X == pow(A,5)-pow(B,5):
            AA =A
            BB =B
            break

print(AA,BB)

Submission status: Accepted

Solution code:
X = int(input())
for i in range(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())
temp=0
for i in range(-120,120):
  for j in range(-120,120):
    if i**5-j**5==x:
      print(i,j)
      temp=1
      break
  if temp==1:
    break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
"""
- I hate Factorization
- A**5 - B**5, >0 A>B (Bminusあり)
"""
X = int(input())
 
for a in range(1000000):
  a5 = a ** 5
  for b in range(a-1,-1000000,-1):
    b5 = b**5
    if a5 - b5 == X:
      print(a,b)
      exit(0)
    elif a5 - b5 > X:
      break

Submission status: Accepted

Solution code:
X = int(input())

# A**5 - B**5, >0 A>B (Bminusあり)

for a in range(1000000):
  a5 = a ** 5
  for b in range(a-1,-1000000,-1):
    b5 = b**5
    if a5 - b5 == X:
      print(a,b)
      exit(0)
    elif a5 - b5 > X:
      break

Submission status: Accepted

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

Submission status: Accepted

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


def main():
    import sys
    input = sys.stdin.readline

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

    print(-1)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
x = int(input())

for a in range(1, 120):
    for b in range(-119, 119):
        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(-119,118):
    if a**5 - b**5 == x:
      print(a,b)
      exit()

Submission status: Accepted

Solution code:
import sys
from functools import lru_cache
from collections import defaultdict
inf = float('inf')
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**6)
def input(): return sys.stdin.readline().rstrip()
def read():
  return int(readline())
def reads():
  return map(int, readline().split())
x=read()
ls=[]
nums=10**3
ls2=[]
for i in range(nums+1):
  ls.append(i**5)
for i in range(nums,0,-1):
  ls.append(-i**5)
#print(ls)
for i in range(nums+1):
  for j in range(-nums,i):
    #print(ls[i],ls[j])
    if ls[i]-ls[j]==x:
      print("{} {}".format(i,j))
      exit()

Submission status: Accepted

Solution code:
def main():
    x = int(input())
    for a in range(-120, 121):
        for b in range(-120, 121):
            if (a**5-b**5==x):
                print(a, b)
                exit(0)
    

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
#import cython

def main():
    read = lambda: sys.stdin.readline().rstrip()
    import collections
    
    X = int(read())
    for A in range(-120, 120):
        flag = False
        for B in range(-120, 120):
            if X == A**5-B**5:
                print(A, B)
                flag = True
                break
        if flag: break
    


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
x = int(input())
for a in range(-118, 120):
    for b in range(-118, 119):
        if pow(a, 5) - pow(b, 5) == x:
            print(str(a) + " " + str(b))
            exit()

Submission status: Accepted

Solution code:
x = int(input())

if x == 1:
    a = 1
    b = 0
else:
    p = 1
    while True:
        while True:
            if x % p == 0:
                q = int(x / p)
                break
            else:
                p += 1
        ap = p
        am = p
        bp = 0
        bm = 0
        for i in range(200):
            if ap**4 + ap**3 * bp + ap**2 * bp**2 + ap * bp**3 + bp**4 == q:
                a = ap
                b = bp
                break
            elif am**4 + am**3 * bm + am**2 * bm**2 + am * bm**3 + bm**4 == q:
                a = am
                b = bm
                break
            ap += 1
            bp += 1
            am -= 1
            bm -= 1
        else:
            p += 1
            continue
        break

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

Submission status: Accepted

Solution code:
import sys
import itertools
# import numpy as np
import time
import math

sys.setrecursionlimit(10 ** 7)

from collections import defaultdict

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

x = int(input())

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

Submission status: Accepted

Solution code:
X = int(input())
for i in range(130):
  for j in range(-130,130):
    if i**5 - j**5 ==X:
      A = i
      B = j
      break

print(str(A)+str(" ")+str(B))

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(n) for n in input().split()]

L = 200
#while (L + 1) ** 5 -  L ** 5 <= X * 2:
#    L += 1   
#print(L)

for i in range(L+1):
    for j in range(L+1):
        if i ** 5 - j ** 5 == X:
            print('{} {}'.format(i, j))
            exit()
        elif i ** 5 + j ** 5 == X:
            print('{} {}'.format(i, -j))
            exit()

Submission status: Accepted

Solution code:
#abc166d
x=int(input())
for i in range(-118,120):
 for j in range(-119,129):
  if i**5-j**5==x:
   print(i,j)
   exit()

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
X = int(input())

MAX_INT = 201

res = 0

for i in range(MAX_INT):
  for j in range(MAX_INT):
    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:
x = int(input())
for i in range(1,1000):
    for j in range(-1000,1000):
        if x == i**5-j**5:
            print(str(i)+" "+str(j))
            break
    else:
        continue
    break

Submission status: Accepted

Solution code:
X = int(input())

# B < 0
a_max = int(X**0.2) + 1
b_min = - a_max
for a in range(a_max + 1):
    for b in range(0, b_min - 1, -1):
        if a**5 == X + b**5:
            print(a, b)
            exit()

# B > 0
a_max = int(X**0.25) + 1
b_max = a_max

for a in range(a_max + 1):
    for b in range(b_max + 1):
        if a**5 == X + b**5:
            print(a,b)
            exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

x = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
a = 0
b = 0
if not x == 0:
  for i in range(1000):
    for j in range(-100,1000):
      if i**5 - j**5 == x:
        a = i
        b = j
      if a != 0 or b != 0:
        break
    if a != 0 or b != 0:
        break
    
print(str(a)+" "+str(b))

Submission status: Accepted

Solution code:
# 暴力即可
# 範囲指定 A=100 B=-100で20000000000とかになるしどっちも|100|程度でいいのではないか
# なんか足りんみたい（なんで？）なので4X^2<=10^9なる最大のXを求めよう
# 2X = 1000ちょい だから500くらいあればいいのか
# 1000^2なので時間的には間に合いそう
x = int(input())
for a in range(-500, 501):
    for b in range(-500, 501):
        if a**5 - b**5 == x:
            print(a, b)
            exit()
print(3 / 0)  # はい

Submission status: Accepted

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

def solve(X: int):

    for i in range(-150, 150):
        for j in range(-150, 150):
            if j**5 - i**5 == X:
                print(j, i)
                return
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  # type: int
    solve(X)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
'''
x = 0
while (x+1)**5 - x**5 < 1000000000:
    x += 1
print(x)
'''
maximum = 120
minimum = -120

x = int(input())

for i in range(minimum+1, maximum):
    for j in range(minimum, maximum-1):
        if i**5 - j**5 == x:
            a = i
            b = j

print(a, b)

Submission status: Accepted

Solution code:
x = int(input())

for a in range(-200, 201):
    for b in range(-200, 201):
        if a**5 - b**5 == x:
            print(a, b)
            break
    else:
        continue
    break
else:
    print(-1)

Submission status: Accepted

Solution code:
x=int(input())

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

Submission status: Accepted

Solution code:
a=[i**5 for i in range(100001)]
b=[i**5 for i in range(50001)]
x=int(input())
k=0
for i in a:
  for j in b:
    if i - j == x:
      k = 1
      print(a.index(i),b.index(j))
      break
    if i + j ==x:
      k=1
      print(a.index(i),-b.index(j))
  if k==1:
    break

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
import bisect
import numpy as np
import math
from collections import deque
from collections import defaultdict
from math import gcd

X = int(input())

maxi = 125
mini = -125

for a in range(mini, maxi):
    for b in range(mini, maxi):
        if a**5 - b**5 == X:
            print("{} {}".format(a, b))
            sys.exit()

Submission status: Accepted

Solution code:
def pow_kai(a, n):
    x = 1
    while(n > 0):
        if(n&1):
            x = x*a
        a = a*a
        n >>= 1
    return x


def main():
    X = int(input())
    pow5 = []

    for i in range(0,10**9):
        pow5.append(pow_kai(i,5))
        for k in range(0, i+1):
            if pow5[i]-X == pow5[k]:
                print(i, k)
                return
            elif pow5[i]-X == -pow5[k]:
                print(i, -k)
                return

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
X = int(input())
import sys 
for i in range(-500,500):
    for j in range(-500, 500):
        if i**5 - j**5 == X:
            print(i, j)
            sys.exit(0)