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:
import os

x = int(input())

for a in range(-118,120):
    for b in range(-119,119):
        if a**5-b**5==x:
            print("{} {}".format(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:
n = int(input())

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

Submission status: Accepted

Solution code:
from collections import deque

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

def f(A,B):
    return A**5 - B**5

[X] = getInts()
Q = deque([(0,0)])
V = set()
A, B = 0,0
r = []
while not r:
    (A,B) = Q.pop()
    l = [(A+1,B),(A,B+1),(A+1,B+1)]
    l = filter(lambda x: x not in V, l)
    for each in l:
        V.add(each)
        Q.appendleft(each)
    
    r = list(filter(lambda x: f(*x)==X, [(A,B), (A,-B), (-A,B), (-A, -B)]))

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

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
d = {}
for i in range(1000):
  b = (-1000+i)**5
  d[b] = -1000+i
for i in range(1000):
  a = i**5
  d[a] = i
  if a-x in d:
    b = d[a-x]
    a = i
    break
print(a,b)

Submission status: Accepted

Solution code:
x = int(input())
l = []
d = {}
for i in range(1000):
  b = (-1000+i)**5
  d[b] = -1000+i
for i in range(1000):
  a = i**5
  d[a] = i
  if a-x in d:
    b = d[a-x]
    a = i
    break
print(a,b)

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


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

    for A in range(-119, 120 + 1):
        for B in range(-119, 120 + 1):
            if A ** 5 - B ** 5 == X:
                print(A, B)
                exit()


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main():  
  x = int(input())
  a = 1
  while True:
    c = a**5
    for b in range(-a,a+1):
      d = c - b**5
      if d == x:
        print(a,b)
        return
      if d == -x:
        print(b,a)
        return
    a+=1
  
if __name__ == "__main__":
  main()

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7


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

Submission status: Accepted

Solution code:
def main():
    x = int(input())
    a, b = 1, 0

    while True:
        for b in reversed(range(-a + 1, a)):
            # print(a, b)
            q = a**5 - b**5
            if q == x:
                print(f'{a} {b}')
                return
        a += 1

main()

Submission status: Accepted

Solution code:

x = int(input())

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

factorization(x)

Submission status: Accepted

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

for a in range(150):
  for b in range(150):
    if a**5 - b**5 == X:
      print(a, b)
      sys.exit()
    elif a**5 + b**5 == X:
      print(a, -b)
      sys.exit()

Submission status: Accepted

Solution code:
X = int(input())
from math import pow
for a in range(-120,120,1):
    for b in range(-120,120,1):
        if pow(a,5)-pow(b,5)==X:
            print(a,b);exit()

Submission status: Accepted

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

X = int(input())

A = 1
B = 0

while True:
    while A**5 - B**5 < X:
        B -= 1
    if A**5 - B**5 == X:
        print(A,B)
        exit()
    B = A
    A += 1

Submission status: Accepted

Solution code:
import math

x = int(input())
for i in range(1, 121):
    for j in range(-120, 121):
        if i**5 - j**5 == x:
            print(i, j)
            quit(0)

Submission status: Accepted

Solution code:
X = int(input())
flag = False

for A in range(-120, 120):
    for B in range(-120, 120):
        if A**5 - B**5 == X:
            flag = True
            break
    if flag:
        break

print(A, B)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X=int(input())

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

print(*ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
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)
                return

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
x = int(input())
aa, bb = 0, 0
for i in range(-200, 200):
  for j in range(-200, 200):
    if(i**5 - j**5 == x):
      aa, bb = i, j
    if(aa != 0 or bb != 0):
      break
  if(aa != 0 or bb != 0):
    break
print(str(aa) + " " + str(bb))

Submission status: Accepted

Solution code:
import sys


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


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
x = int(input())


def make_divisors(n):
    lower_divisors, upper_divisors = [], []
    i = 1
    while i * i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n // i)
        i += 1
    return lower_divisors


for i in make_divisors(x):
    a = 0
    while (a - i) < 0 or a**5 - (a - i)**5 < x:
        a += 1
        if a**5 - (a - i)**5 == x:
            print(a, a - i)
            exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    x = int(input())
    for A in range(-118,120):
        for B in range(-119,119):
            if (A**5 - B**5) == x:
                return([A,B])

ans = main()
print(' '.join(str(n) for n in ans))

Submission status: Accepted

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

Submission status: Accepted

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

# 持っているビスケットを叩き、1枚増やす
# ビスケット A枚を 1円に交換する
# 1円をビスケット B枚に交換する
def main():
    x = int(input())
    for a in range(-200, 200):
        for b in range(-200, 200):
            ans = a ** 5 - b ** 5
            if ans == x:
                print(a, b)
                exit()


def bi(num, a, b, x):
    print((a * num) + (b * len(str(b))))
    if (a * num) + (b * len(str(b))) <= x:
        return False
    return True

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


def input_list_str():
    return list(map(str, input().split()))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
def Ii():return int(sys.stdin.buffer.read())
def Mi():return map(int,sys.stdin.buffer.readline().split())
def Li():return list(map(int,sys.stdin.buffer.readline().split()))

x = Ii()

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

Submission status: Accepted

Solution code:
X = int(input())
Rg = 1000
#print(1000**5)
#print(2**5)
for a in range(Rg):
	A = a**5
	for b in range(Rg): 
		B = b**5
		if A-B==X:
			print(a,b)
			exit()
		if A+B==X:
			print(a,-b)
			exit()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
from collections import defaultdict

x = int(input())
pre = [i ** 5 for i in range(1001)] # Fuck it
for i in range(1001):
    for j in range(i + 1):
        if pre[i] - pre[j] == x: print(i, j); exit()
        elif pre[i] + pre[j] == x: print(i, -j); exit()

Submission status: Accepted

Solution code:
X = int(input())

B_max = int(X**(0.25))

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

divisors = get_divisors(X)

flg = False
for div in divisors:
    for B in range(-B_max, B_max+1):
        A = B + div
        A4_B4 = A**4 + A**3 * B + A**2 * B**2 + A * B**3 + B**4
        
        if (div * A4_B4 == X):
            flg = True
            break
    
    if flg:
        break


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

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("{} {}".format(i,j))
      exit()

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

Submission status: Accepted

Solution code:
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

X = int(input())
S = make_divisors(X)

t = 0
for s in S:
    a = s//2
    b = a-s
    while a**5 - b**5 <= X:
        if a**5 - b**5 == X:
            print(a,b)
            break
        a += 1
        b += 1
    if a**5 - b**5 == X:
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

for i in range(1,121):
    for j in range(-121,121+1):
        if i**5 - j**5 == X:
            print(i,j)
            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)
            exit()

Submission status: Accepted

Solution code:
N = int(input())

# 以下がとてもわかりやすい
# https://drken1215.hatenablog.com/entry/2020/06/20/231600

for i in range(-200, 200, 1):
    for j in range(-200, 200, 1):
        if i ** 5 - j ** 5 == N:
            print(f'{i} {j}')
            exit(0)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
flag = 1
for a in range(-119, 119):
    for b in range(-119, 119):
        if a**5 - b**5 == N:
            A = str(a)
            B = str(b)
            flag = 0
    if flag ==0:
        break
print(A + " " +B)

Submission status: Accepted

Solution code:
import sys

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
x = int(input())

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

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(-119, 120):
    for b in range(-119, 120):
        if X == a**5 - b**5:
            la = a
            lb = b
print(la, lb)

Submission status: Accepted

Solution code:
x = int(input())
for a in range(-10 ** 3, 10 ** 3):
    for b in range(-10 ** 3, 10 ** 3):
        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)
            break
    else:
        continue
    break

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

Solution code:
import math
import sys
X=int(input())
A=-200
B=-200

for i in range(400):
    for j in range(400):
        if A**5-B**5==X:
            print(A,B)
            sys.exit()
        A+=1
    A=-200
    B+=1

Submission status: Accepted

Solution code:
X = int(input())

for b in range(-10**3,10**3):
  z = X + b**5 
  for a in range(-10**3,10**3):
    if a**5 == z:
      print(a,b)
      exit()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')
# from math import ceil, floor, log2
# from collections import deque
# from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
# from heapq import heapify, heappop, heappush
# import numpy as np    # cumsum
# from bisect import bisect_left, bisect_right

def solve():
    X = II()
    for a in range(-1000, 1000):
        a5 = pow(a, 5)
        for b in range(-1000, 1000):
            b5 = pow(b, 5)
            if a5 - b5 == X:
                print(a, b)
                return

if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
import sys

n = int(input())

for i in range(-200,200):
    for j in range(-200,200):
        if i ** 5 - j ** 5 == n:
            print(i,j)
            sys.exit()

Submission status: Accepted

Solution code:
#166D
#I hate Factorization

x=int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
X = int(input())
flag = 0

for a in range(-1000, 1000):
    for b in range(-1000, 1000):
        if a**5 - b**5 == X:
            print(a, b)
            flag = 1
            break
    if flag == 1:
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

flag = False
for i in range(-120, 120):
    for j in range(-120, 120):
        if i ** 5 - j ** 5 == X:
            print(i, j)
            flag = True
            break
    if flag:
        break

Submission status: Accepted

Solution code:
from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

def ri():
    return int(input())

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


def solve():
    x = ri()
    fifths = {i**5: i for i in range(10000)}

    a = 0
    while 1:
        if x - a**5 in fifths:
            print (a, -fifths[x - a**5])
            return
        elif a**5 - x in fifths:
            print (a, fifths[a**5 - x])
            return
        a += 1






mode = 's'

if mode == 'T':
    t = ri()
    for i in range(t):
        solve()
else:
    solve()

Submission status: Accepted

Solution code:
x = int(input())
for a in range(1000000):
    b = round(abs(a ** 5 - x) ** (1 / 5))
    if x in [a ** 5 + b ** 5, a ** 5 - b ** 5]:
        if a ** 5 < x: b *= -1
        print(a, b)
        break

Submission status: Accepted

Solution code:
X = int(input())

going = False

for A in range(-120, 121):
    for B in range(-120, 121):
        if A ** 5 - B ** 5 == X:
            print(A, B)
            going = True
            break
    if going:
        break

Submission status: Accepted

Solution code:
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


x = I()
# xの最大値が 10^ 9
# xの最大値となるa, bを考える
# xがより大きくなるのは a^5とb^5 の差が小さい(0ではない)とき
# a と b の差が 1 のとき差が最も小さい
# この場合で xが10^9をギリギリ越さない a, bを考える
# a, bが0以上の場合
# a = 120, b = 119のときがギリギリ
# a, bが0以下の場合
# a = -118, b = -119のときギリギリ
# a は [-118, 121], b は [-119, 119]の範囲で探索
a = list(range(-118, 121))
b = list(range(-119, 120))
ans = [-118, -119]
for i in a:
    for j in b:
        if i ** 5 - j ** 5 == x:
            ans = [i, j]
            break
print(*ans)

Submission status: Accepted

Solution code:
x = int(input())

q = 0

for b in range(-120,120):
    for a in range(b+1,120):
        if a**5 - b**5 == x:
            print(a,b)
            q = 1
            break
    if q == 1:
        break

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, 200):
	for b in range(-200, 200):
		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)
                return

if __name__ == "__main__":
    main()

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(str(i) + ' ' + str(j))
      exit()

Submission status: Accepted

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

for A in range(-119, 121, 1):
    for B in range(-119, 121, 1):
        if A**5 - B**5 == X:
            print("{} {}".format(A, B))
            sys.exit()

Submission status: Accepted

Solution code:
X = int(input())
for i in range(-201, 201):
    done = False
    for j in range(-201, 201):
        if i ** 5 - j ** 5 == X:
            print(i, j)
            done = True
            break
    if done:
        break

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

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

ans=[]
for i in range(-501,501):
    for j in range(-500,501):
        sum = i**5 - j**5
        if sum == X:
            ans.append(i)
            ans.append(j)
            print(*ans)
            exit()

Submission status: Accepted

Solution code:
import sys

x = int(input())

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

Submission status: Accepted

Solution code:
import sys
X = int(input())
L = []
for i in range(1000):
    a = int(i**5)
    L.append(a)
    for j in range(len(L)):
        if X == a-L[j]:
            print(i, j)
            sys.exit()
        elif X == a+L[j]:
            ans = j*-1
            print(i, ans)
            sys.exit()

Submission status: Accepted

Solution code:
def ABC166D(x):
    for a in range(-118, 120):
        for b in range(-119, 119):
            if a**5 - b**5 == x:
                print(a, b)
                return

x = int(input())
ABC166D(x)

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:
x=int(input())
i=1
flag=0
for i in range(200):
    for j in range(-200,200):
        if(i**5+j**5==x):
            flag=1
            print(i,-j)
            exit(0)

Submission status: Accepted

Solution code:
x=int(input())
i=1
flag=0
for i in range(10000):
    for j in range(-1000,1001):
        if(i**5+j**5==x):
            flag=1
            print(i,-j)
            exit(0)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
a = [0]*1000
for i in range(1000):
    tmp = i**5
    a[i] = tmp
for i in range(1000):
    for j in range(1000):
        if((a[i]-x) == (a[j])):
            print(i,j)
            exit()
        elif(x-a[i]==a[j]):
            print(i,-j)
            exit()

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())
a=[]
for i in range(-100,200):
  for j in range(-100,200):
    if i**5-j**5==X:
      a.append(str(i))
      a.append(str(j))
      break
  else:
    continue
  break  
print(' '.join(a[0:2]))

Submission status: Accepted

Solution code:
X=int(input())
a=[]
for i in range(-100,200):
  for j in range(-100,200):
    if i**5-j**5==X:
      a.append(str(i))
      a.append(str(j))
      break
print(' '.join(a[0:2]))

Submission status: Accepted

Solution code:
X = int(input())

found = False
for a in range(-200, 200):
    if found: break;
    for b in range(-200, 200):
        if a ** 5 - b ** 5 == X:
            print(a, b)
            found = True
            break

Submission status: Accepted

Solution code:
# +の場合
i = 0
ans = 0
while ans <= 1000000000:
   i += 1
   ans = i**5 - (i-1)**5
# i: 120

# -の場合
i = 0
ans = 0
while ans <= 1000000000:
   i -= 1
   ans = i**5 - (i-1)**5 
# i: -119

n = int(input())
l = [_**5 for _ in range(120)]

for i in range(1,120):
    for j in range(120):
        if l[i] - l[j] == n:
            print(int(l[i]**0.2), int(l[j]**0.2))
            exit()
        if l[i] + l[j] == n:
            print(int(l[i]**0.2), int(-1*l[j]**0.2))
            exit()

Submission status: Accepted

Solution code:
import sys
X=int(input())
l=[i**5 for i in range(1000)]
for i in range(1000):
    for j in range(-999,0):
        if l[i]+l[j*-1]==X:
            print(i,j)
            sys.exit()
    for j in range(i):
        if l[i]-l[j]==X:
            print(i,j)
            sys.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:
# A^5-B^5=(B+d)^5-B^5

X=int(input())

div=[1,X]

for i in range(2,X):
    if X%i==0:
        div.append(i)
        div.append(X//i)
    if i*i>=X:
        break

for d in div:
    for j in range(-100000,100000):
        A=j+d
        B=j
        if A**5-B**5==X:
            print(str(A)+" "+str(B))
            exit(0)

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

Submission status: Accepted

Solution code:
def calc(a, b):
  return a ** 5 - b ** 5

x = int(input())
even = 0
if x % 2 == 0:
  even = 1
flag = 0
if even:
  a = 2
else:
  a = 1
b = 0
while (True):
  while (True):
    if calc(a,b) == x:
      flag = 1
      break
    elif calc(a,b) > x:
      break
    b -= 2
  if flag == 1:
    break
  a += 1
  if even:
    b = a - 2
  else:
    b = a - 1
print(a, b)

Submission status: Accepted

Solution code:
def main():
    x = int(input())
    a = 1
    b = 1
    
    for i in range(-118, 120):
        a = i
        for j in range(-118, 120):
            b = j
            if x == a**5 - b**5:
                ans = str(a) + ' ' + str(b)
                print(ans)
                return


if __name__ == '__main__':
    main()

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:
# D - I hate Factorization
M = 1000
N = [0]
for i in range(1,M+1):
    N.append(i)
    N.append(-i)

def main(X):
    global N
    for i in N:
        for j in N:
            if i**5-j**5==X:
                return i,j

X = int(input())
A,B = main(X)
print(A,B)

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:
import numpy as np

X=int(input())
ans=[0,0]

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

print("{} {}".format(ans[0],ans[1]))

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:
            a=i
            b=j

print(a, b)

Submission status: Accepted

Solution code:
'''
5乗なのでグラフは十分疎である
AとBが連続する整数(B = A-1)だった時の値で絞り込む
A^5-(A-1)^5 の値はA=120で今回のX=10^9を超える
同様に下限はA=-119である
その時のBの範囲も、与式>=1によりA-B>0だから同様の範囲だろうと推測できる
'''

X = int(input())
for i in range(-120, 120):
    for j in range(-120,120):
        if i**5 - j**5 == X:
            print(i, j)
            break
    else:
        continue
    break

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

Submission status: Accepted

Solution code:
X = int(input())


def f(X):

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


f(X)

Submission status: Accepted

Solution code:
X = int(input())
# A>=0で考えられる
div_list = []
for a in range(1, int(X**0.5)+1):
    if X % a == 0:
        div_list.append((a, X//a))

#print(div_list)
for x, y in div_list:
    for a in range(int(X**0.5)+1):
        b = a - x
        #print(a, b)
        y_hat = a**4 + b*a**3 + b**2*a**2 + b**3*a + b**4
        #print(y_hat)
        if y_hat == y:
            print(a, b)
            exit()

Submission status: Accepted

Solution code:
x = int(input())

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

print(a, b)

Submission status: Accepted

Solution code:
x = int(input())
d= {}
for a in range(10**25):
    #print(a,d)
    a5 = a**5
    b5 = a5-x
    if b5 in d:
        print(a,d[b5])
        exit()
    d[a5] = a
    #print('--------------',a,d)
    a5 = -a5
    b5 = a5-x
    if b5 in d:
        print(a,d[b5])
        exit()
    d[a5] = -a

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
 
x = int(input())
x_pow = round(math.pow(x, 1/5))
ok = 0
 
for a in range(-300,300):
  for b in range(-300,300):
    if a**5 - b**5 == x:
      print(a,b)
      ok = 1
      exit()

Submission status: Accepted

Solution code:
# input() to take in input
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 a in range(-130,130):
  for b in range(-130,130):
    if a**5 - b**5 == x:
      print(a,b)
      exit()

Submission status: Accepted

Solution code:
X = int(input())

for a in range(121):
    for b in range(121):
        if a ** 5 - b ** 5 == X:
            print(a, b)
            break
        elif a ** 5 + b ** 5 == X:
            print(a, -b)
            break
    else:
        continue
    break