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

    for i in range(-200, 200):
        x = i ** 5
        for j in range(i + 1, 200):
            y = j ** 5
            if y - x == X:
                print(j, i)
                exit()


main()

Submission status: Accepted

Solution code:
import math
X = int(input())
a1 = math.ceil(X**(1/5))
N = int(1e10)
c = 0
b = 0
while c <= N:
    if b**5 < -X:
        b2 = b + 1
        break
    b -= 1
c = 0
while c <= N:
    c += 1
    b1 = math.floor((a1**5-X)**(1/5))
    a2 = math.floor((X+b2**5)**(1/5))
    if a1**5 - b1**5 == X:
        print(a1, b1)
        break
    elif a2**5 - b2**5 == X:
        print(a2, b2)
        break
    a1 += 1
    b2 += 1

Submission status: Accepted

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

    num = 10**3
    for a in range(-num,num):
        for b in range(-num, num):
            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(10 ** 3):
  for b in range(10 ** 3):
    for ap in (1,-1):
      for bp in (1,-1):
        if (a * ap) ** 5 - (b * bp) ** 5 == X:
          print(a * ap,b * bp)
          exit(0)

Submission status: Accepted

Solution code:
from collections import defaultdict as dc
x = int(input())
d = dc(lambda:0)
for i in range(200):
    d[i**5] = i
# print(d)
f=0
l = list(d.items())
# print(l)
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])
            f=1
            break 
        elif l[i][0] + l[j][0] == x:
            print(l[i][1] ,- l[j][1])
            f=1
            break
    if f == 1:
        break

Submission status: Accepted

Solution code:
X = int(input())#数字

for i in range(10 ** 8):
    for j in range(-10000,10 ** 4):
        if i ** 5 - j ** 5 == X:
            print(i, j)
            exit()

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

Solution code:
import math
x=int(input())
for i in range(120):
 for j in range(-54,i):
  if math.pow(i,5)-math.pow(j,5)==x:print(i,j);exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import floor,ceil,sqrt
import fractions
import collections
import itertools
from collections import deque
X=int(input())
"""
l=[]
for i in range(1,ceil(sqrt(X))+1):
    if X%i==0:
        l.append(i)
        l.append(X//i)
l=list(set(l))
l2=l
for i in range(len(l)):
    l2.append(-l[i])
#print(l2)
l2.sort()
if len(l)!=0:
    for i in l2:
        x=X//i
        #print(i,x)
        n=(x-pow(i,4))/(pow(i,2)+1)
        #print(n)
        if (5*pow(i,4)+20*x)>=0:
            if sqrt((5*pow(i,4)+20*x)).is_integer()==True:
                #print(x,i)
                m=int(sqrt((5*pow(i,4)+20*x)))
                if (-5*i*i+m)%10==0:
                    y=(-5*i*i+m)//10
                    #print(i,y)
                    if pow(i,2)+4*y>=0:
                        if sqrt(pow(i,2)+4*y).is_integer()==True:
                            z=int(sqrt(pow(i,2)+4*y))
                            if (-i+z)%2==0:
                                b=(-i+z)//2
                                a=i+b
                                print(a,b)
                                break
                            elif (-i - z) % 2 == 0:
                                b = (-i - z) // 2
                                a = i + b
                                print(a, b)
                                break
                elif (-5*i*i-m)%10==0:
                    y=(-5*i*i+m)//10
                    #print(i,y)
                    if pow(i,2)+4*y>=0:
                        if sqrt(pow(i,2)+4*y).is_integer()==True:
                            z=int(sqrt(pow(i,2)+4*y))
                            if (-i+z)%2==0:
                                b=(-i+z)//2
                                a=i+b
                                print(a,b)
                                break
                            elif (-i - z) % 2 == 0:
                                b = (-i - z) // 2
                                a = i + b
                                print(a, b)
                                break
"""
flag=0
#こんなことしなくても全探査で通る!
for i in range(-1000,1000):
    for j in range(-1000,1000):
        if pow(i,5)-pow(j,5)==X:
            print(i,j)
            flag=1
            break
    if flag==1:
        break

Submission status: Accepted

Solution code:
x = int(input())
def f1(a, b): return a**5 - b**5
def f2(a, b): return a**5 + b**5
for f, sign_b in ((f1, 1), (f2, -1)):
    b = 0
    while f(a := b + 1, b) <= 10**9:
        while f(a, b) <= 10**9 and f(a, b) != x:
            a += 1
        if f(a, b) == x:
            print(a, sign_b * b)
            exit(0)
        b += 1

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=int(input())
for i in range(120):
 for j in range(-62,i):
  if i**5-j**5==x:print(i,j);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)
      break
  else:
    continue
  break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 6)  # 再帰関数の再帰の深さを設定
to_index = lambda x: int(x) - 1  # 入力した数字に1を引いたものを返す
print_list_in_2D = lambda x: print(*x, sep="\n")  # リストの要素を改行を挟んで表示する関数

# 入力を整数に変換して受け取る
def input_int():
    return int(input())

def map_int_input():
    return map(int, input())

MII = map_int_input

def MII_split():
    return map(int, input().split())

def MII_to_index():
    return map(to_index, input())

def MII_split_to_index():
    return map(to_index, input().split())

# 入力全てを整数に変換したものの配列を受け取る
def list_int_inputs():
    return list(map(int, input()))

LII = list_int_inputs

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

# 2次元リスト化
def LII_2D(rows_number):
    return [LII() for _ in range(rows_number)]

def LII_split_2D(rows_number):
    return [LII_split() for _ in range(rows_number)]

X = input_int()

for a in range(2000):
    A = a - 1000

    for b in range(2000):
        B = b - 1000
        if A ** 5 - B ** 5 == X:
            print("{} {}".format(A, B))
            exit()

Submission status: Accepted

Solution code:
import time
startTimeProblem=time.time()

import fileinput, sys, itertools, functools
from math import *
from bisect import *
from heapq import *
from collections import *

def lcm(a, b):  
    return (a*b)/gcd(a, b)

class InputHelper:
    def __init__(self):
        self.myinput = fileinput.input()

    def isLocal(self):
        return not fileinput.isstdin()

    def int(self):
        return int(self.myinput.readline().rstrip())

    def ints(self):
        return [int(_) for _ in self.myinput.readline().rstrip().split()]

    def str(self):
        return self.myinput.readline().rstrip()

    def strs(self):
        return [_ for _ in self.myinput.readline().rstrip().split()]

class OutputHelper:
    def int(self, a):
        print(a)    

    def ints(self, a):  
        print(" ".join([str(_) for _ in a]))
    
    def intsNL(self, a):
        for _ in a:
            print(_)
    
    def str(self, s):
        print(s)

    def strs(self, s):
        print(" ".join([_ for _ in s]))

    def strsNL(self, s):
        for st in s:
            print(st)

class ListNode:
    def __init__(self, val):
        self.val = val
        self.next = None
        self.prev = None

In = InputHelper()
Out = OutputHelper()

######################################

X = In.int()

there = dict()

B = 0
B5 = 0

while B5<10**12:
    B5 = B**5
    there[B5] = B
    if B5 != 0:
        there[-B5] = -B
    B+=1

A = 0
A5 = 0

while A5<10**12:
    A5 = A**5
    
    if A5-X in there:
        Out.ints([A, there[A5-X]])
        break
    A+=1

######################################

if len(sys.argv)>2 and sys.argv[2]=="TIMEIT":
    fin = (time.time()-startTimeProblem)*1000
    print("{:.2f}".format(fin) + "ms")

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:
x=int(input())
for i in range(120):
 for j in range(-90,i):
  if i**5-j**5==x:print(i,j);exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=int(input())
for a in range(1,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 a in range(-200,200):
  for b in range(-200,a):
    if a**5-b**5==x:
      print(a,b)
      exit()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import numpy as np

x = int(input())
flg = 0

for i in range(1, x+1):
    if x % i != 0:
        continue
    else:
        for a in range(x):
            b = a - i
            if a**5 - b**5 == x:
                ans_a = a
                ans_b = b
                flg = 1
                break
            elif a > i and a**5 - b**5 > x:
                flg = -1
                break
        if flg == 1:
            break
        elif flg == -1:
            flg = 0
            continue

print(ans_a, ans_b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

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

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:
            ans=[a,b]
            print(*ans)
            exit()

Submission status: Accepted

Solution code:
from decimal import Decimal
n = int(input())
nn = int(pow(n,1/5)) + 1
for i in range(-200,200):
    cheak = i ** 5 - n
    ans = float(pow(Decimal(abs(cheak)), Decimal("0.2")))

    if type(ans) is float:

        if ans.is_integer():
            if cheak < 0:
                b = -1 * ans
            else:
                b = ans
            print(i,int(b))
            break

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline


def main():
    X = int(input())
    a = [i**5 for i in range(120)]
    for i in range(120):
        for j in range(i+1, 120):
            if a[j]-a[i] == X:
                print(j, i)
                exit()
            if a[j]+a[i] == X:
                print(j, -i)
                exit()


if __name__ == '__main__':
    main()

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

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

Submission status: Accepted

Solution code:
# coding:utf-8
x = int(input())

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())
for i in range(120):
  for j in range(-119,129):
    if i**5 - j**5 == x:
      print(i, j)
      exit()

Submission status: Accepted

Solution code:
import sys
import os
import math
import bisect
import collections
import itertools

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def f(a, b):
    return pow(a, 5) - pow(b, 5)


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    X = ii()

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
import os
import math
import bisect
import collections
import itertools

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def f(a, b):
    return pow(a, 5) - pow(b, 5)


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    X = ii()
    LIST = [i ** 5 for i in range(1001)]

    for a in range(1001):
        for b in range(a + 1, 1001):
            if LIST[b] - LIST[a] == X:
                print(b, a)
                exit()
            if LIST[b] + LIST[a] == X:
                print(b, -a)
                exit()


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
X = int(input())

flag = False
for A in range(-130, 130):
    for B in range(-130, 130):
        # print(A, B)
        if A ** 5 - B ** 5 == X:
            print(A, B)
            flag = True
            break
    if flag:
        break

Submission status: Accepted

Solution code:
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())
stop = False
for A in range(-118, 120):
    for B in range(-119, 129):
        if A ** 5 - B ** 5 == X:
            print(A, B)
            stop = True
    if stop:
        break

Submission status: Accepted

Solution code:
x = int(input())

for a in range(-200, 200):
    for b in range(-200, 200):
        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,129):
    if i**5 - j**5 == x:
      print(i, j)
      exit()

Submission status: Accepted

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)


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

    for a in range(-120,120):
        for b in range(-120,120):
            test = a ** 5 - b ** 5
            if test == X:
                print(a,b)
                sys.exit()




main()

Submission status: Accepted

Solution code:
import sys
from math import pow
def main():
    x = int(input())
    for a in range(-1000,1001):
        for b in range(-1000,1001):
            if pow(a, 5) - pow(b, 5) == x:
                print(a, b)
                sys.exit()

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

  for A in range(-120, 120):
    for B in range(-120, 120):
      if A**5 - B**5 == X:
        print("{0} {1}".format(A, B))
        return True

if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
import math
x = int(input())
for i in range(-118,120):
  for j in range(-119,129):
    if math.pow(i, 5) - math.pow(j, 5) == x:
      print(i, j)
      exit()

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from itertools import combinations
def main():
    X = int(readline())
    p = [int(i) for i in range(-1000, 1001)]
    for b, a in combinations(p, 2):
        if a**5 - b**5 == X:
            A = a
            B = b
            break
    print(A, B)
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
def main():
  x = int(input())
  for i in range(-118,120):
    for j in range(-119,129):
      if math.pow(i, 5) - math.pow(j, 5) == x:
        print(str(i) + ' ' + str(j))
        return
main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
def main():
  x = int(input())
  for i in range(-120,120):
    for j in range(-120,120):
      if math.pow(i, 5) - math.pow(j, 5) == x:
        print(str(i) + ' ' + str(j))
        return
main()

Submission status: Accepted

Solution code:
X = int(input())

for a in range(-300, 300):
    for b in range(-300, 300):
        if a ** 5 - b ** 5 == X:
            A = a
            B = b

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

Submission status: Accepted

Solution code:
def main():
  x = int(input())
  r = range(-120,120)
  for i in r:
    for j in r:
      if i**5 - j**5 == 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:
      c=a
      d=b
      break
      
print(c,d)

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def main():
    X = int(readline())
    for b in range(-1000, 1001):
        for a in range(b, 1001):
            if a**5 -b**5 == X:        
                A = a
                B = b
                break
    print(A, B)            
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

X = ii()
'''
lim = 10**3

for a in range((-1)*lim, lim+1):
    for b in range((-1)*lim, lim+1):
        if a**5 - b**5 == X:
            print(a, b)
            exit()
'''
i = 0
while True:
    for j in range((-1)*i, i):
        if i**5 - j**5 == X:
            print(i, j)
            exit()
    i += 1

Submission status: Accepted

Solution code:
import sys
import math
sys.setrecursionlimit(10**9)

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

    def search(y):
        left = -10**18
        right = 10**18

        while right - left > 1:
            mid = (right+left)//2

            if mid**5 < y:
                left = mid
            else:
                right = mid

        return right

    for b in range(-1000,1000):
        y = X+b**5
        a = search(y)

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




if __name__ == "__main__":
  main()

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(str(A) + " " + str(B))
      quit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

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

def f(a, b):
  return a**5 - b**5

divs = make_divisors(X)
ans = 0
for div in divs:
  a = -div-120
  b = -120
  while f(a, b) < X and a < 2:
    a += 1
    b += 1
  if f(a, b) == X:
    ans = (a, b)
  a = -120
  b = -div-120
  while f(a, b) > X and b < 2:
    a += 1
    b += 1
  if f(a, b) == X:
    ans = (a, b)
    
print(ans[0], ans[1])

Submission status: Accepted

Solution code:

def resolve():
    X = int(input())
    for a in range(-120, 121):
        for b in range(-120, 121):
            if X == (a**5 - b**5):
                print(a, b)
                return

if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
X = int(input())
C= [i**5 for i in range(1000)]

a = 0
b = 0

for a in range(len(C)):
    for b in range(len(C)):
        if C[a] + C[b] == X:
            print(a, -b)
            exit(0)
        elif C[a] - C[b] == X:
            print(a, b)
            exit(0)

Submission status: Accepted

Solution code:
X = int(input())

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

def f(x, y):
  return x**5 - y**5 - X

Flag = True

for A in range(-120, 120):
  if Flag:
    for i in make_div(X):
      B = A - i
      if f(A, B) == 0:
        print(A, B)
        Flag = False
        break
  else:
    break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
def main():
  x = int(input())
  r = range(-120,120)
  for i in r:
    for j in r:
      if math.pow(i, 5) - math.pow(j, 5) == x:
        print(str(i) + ' ' + str(j))
        return
main()

Submission status: Accepted

Solution code:
x = int(input())

y = 200
s = -200
t = -200

a = 0
b = 0

while s < y:
    t = -y
    while t < y:
        if s ** 5 - t ** 5 == x:
            a = int(s)
            b = int(t)
        t += 1
    s += 1

print(a, b)

Submission status: Accepted

Solution code:
X = int(input())
C= [i**5 for i in range(120)]

a = 0
b = 0

for a in range(len(C)):
    for b in range(len(C)):
        if C[a] + C[b] == X:
            print(a, -b)
            exit(0)
        elif C[a] - C[b] == X:
            print(a, b)
            exit(0)

Submission status: Accepted

Solution code:
x = int(input())
nzk = 1
nzj = 0
while nzk**5 - (nzk-1)**5 < 10**9:
    nzk += 1
while nzj**5 - (nzj-1)**5 < 10**9:
    nzj -= 1
for i in range (nzj, nzk+1):
    for j in range(nzj, nzk+1):
        if x ==  i ** 5 - j ** 5:
            print(i, j)
            break
    else:
        continue
    break

Submission status: Accepted

Solution code:
from math import pow
from itertools import combinations
x = int(input())

def func(a, b):
    return pow(a, 5) - pow(b,5)

ok = False
for a in range(-200, 200):
    for b in range(-200, 200):
        if func(a, b) == x:
            print(a, b)
            ok = True
            break
    if ok:
        break

Submission status: Accepted

Solution code:
# coding: utf-8
import sys

stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip() # ignore trailing spaces


def main():
    x = ni()
    memo = [0.1 for _ in range(-125, 125)]
    xmod10 = x%10
    for a in range(-125, 125):
        for b in range(-125, 125):
            if (a-b)%10 == xmod10:
                if memo[a+125] == 0.1:
                    memo[a+125] = pow(a, 5)
                if memo[b+125] == 0.1:
                    memo[b+125] = pow(b, 5)
                if memo[a+125] - memo[b+125] == x:
                    print(a,b)
                    return
    print("Erorr")
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math


X = int(input())

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

Submission status: Accepted

Solution code:
def d_i_hate_factorization(RANGE=range(-119, 120)):
    X = int(input())

    for a in RANGE:
        for b in RANGE:
            if a**5 - b**5 == X:
                return f'{a} {b}'

print(d_i_hate_factorization())

Submission status: Accepted

Solution code:
x=int(input())
value=0
index=0
hashmap=dict()
while value<int(1e18)+1:
    value=pow(index,5)
    hashmap[value]=index
    index+=1
for i in range(1,1000):
    b1=x+int(pow(i,5))
    b2=x+int(pow(-i,5))
    if hashmap.get(b1)!=None:
        print(hashmap[b1],i)
        break
    if hashmap.get(b2)!=None:
        print(hashmap[b2],-i)
        break

Submission status: Accepted

Solution code:
x = int(input())
d = {}
for a in range(-200, 200):
    for b in range(-200, 200):
        k = a**5 - b**5
        d[k] = [a, b]
print(*d[x])

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(300000)

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')



X = I()
for a in range(-1000, 1001):
    for b in range(-1000, 1001):
        if a ** 5 - b ** 5 == X:
            print(a, b)
            exit(0)

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

Submission status: Accepted

Solution code:
# coding: utf-8
import sys

stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip() # ignore trailing spaces


def main():
    x = ni()
    memo = [pow(i,5) for i in range(-125,125)]
    xmod10 = x%10
    for a in range(-125, 125):
        for b in range(-125, 125):
            if (a-b)%10 == xmod10:
                if memo[a+125] - memo[b+125] == x:
                    print(a,b)
                    return
    print("Erorr")
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
x=int(input())
value=0
index=0
hashmap=dict()
while value<int(1e18)+1:
    value=pow(index,5)
    hashmap[value]=index
    index+=1

for i in range(1,1000):
    b1=x+int(pow(i,5))
    b2=x+int(pow(-i,5))
#    print(i,b1,b2)
    if hashmap.get(b1)!=None:
        print(hashmap[b1],i)
        break
    if hashmap.get(b2)!=None:
        print(hashmap[b2],-i)
        break

Submission status: Accepted

Solution code:
X = int(input())
flag = False
for A in range(-120, 121):
    if flag == True:
        break
    for B in range(-121, A):
        if A**5 - B**5 == X:
            flag = True
            print(A, B)
            break

Submission status: Accepted

Solution code:

X = int(input())

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

def f(x, y):
  return x**5 - y**5 - X

Flag = True

for A in range(-1000, 1000):
  if Flag:
    for i in make_div(X):
      B = A - i
      if f(A, B) == 0:
        print(A, B)
        Flag = False
        break
  else:
    break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

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

        elif j ** 5 - i ** 5 == X:
            print(j, i)
            exit()