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: Wrong Answer

Solution code:
X=int(input())
num_list=[i-100 for i in range(200)]
temp=0
for A in num_list:
  for B in num_list:
    if A**5-B**5==X:
      print(A,B)
      temp=1
      break
  if temp==1:
    break

Submission status: Wrong Answer

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

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

def func(a, b):
    return pow(b, 4) + (a * pow(b, 3)) + (pow(a, 2) * pow(b, 2)) + (pow(a, 3) * b) + pow(a, 4)
    
cands = prime_factorize(x)
ok = False
for c in combinations(cands, min(1, len(cands))):
    y = 1
    for i in c:
        y *= i
    for a in range(1, y + 1):
        b = a - y
        f = func(a, b)
        if (a - b) * f == x:
            print(a, b)
            ok = True
            break
    if ok:
        break

Submission status: Wrong Answer

Solution code:
x = int(input())
s = []
flag = 0

for i in range(-100, 100):
    s.append(i**5)

a = -80

for n in s:
    b = -80
    for m in s:
        if n-m == x:
            print(a,b)
            flag = 1
            break
        if flag:
            break
        b += 1

    a += 1

Submission status: Wrong Answer

Solution code:
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

x = int(input())
if x == 1:
    print("0 -1")
    quit()
p_numbers = prime_factorize(x)
num = p_numbers[0]

for i in range(10000):
    a = num - i
    b = -1 * i
    if x // num == a ** 4 + (a ** 3) * b + (a ** 2) * (b ** 2) + a * (b ** 3) + b ** 4:
        print(str(a) + ' ' + str(b))
        quit()

Submission status: Wrong Answer

Solution code:
X = int(input())
m = 0
n = 0
tip = 0
for i in range(101):
    if (tip == 0):
        p = i ** 5
        q = X - p
        if (q >= 0):
            r = q ** (1/5)
            if (((r - int(r)) == 0) or ((r - int(r)) == 0.0)):
                m = r
                n = ((-1) * i)
                tip = 1
        else:
            tip = -1
for i in range(101):
    if (tip < 1):
        p = i ** 5
        q = X  + p
        if (q >= 0):
            r = q ** (1/5)
            if (((r - int(r)) == 0) or ((r - int(r)) == 0.0)):
                m = r
                n = i
                tip = 1
        else:
            tip = 1

print(int(m), int(n))

Submission status: Wrong Answer

Solution code:
X = int(input())
B = -1
A = int((X + B**5)**(1/5))
print(A,B)

Submission status: Wrong Answer

Solution code:
X = int(input())
xxx = int(X ** (1/5))
for i in range(-1000000, 1000000):
    if xxx ** 5 - (i * i * i * i * i) == X:
        print(xxx, i)
        exit()

Submission status: Wrong Answer

Solution code:
x=int(input())
li=[]

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

step=len(li)

for j in range(len(li)):
    for k in range(len(li)):
        if li[j][1]-li[k][1]==x:
            print(li[j][0],li[k][0])
            exit()

Submission status: Wrong Answer

Solution code:
from sys import stdin
x = int(stdin.readline().rstrip())
k = True
a = 0
c = False
while k:
    b = a**5 - x
    if b < 0:
        b *= (-1)
        c = True
    b = b**(1/5)    
    if b.is_integer():
        k = False
        break
    a += 1
if c:
    b *= -1
print(a,int(b))

Submission status: Wrong Answer

Solution code:
x = int(input())

rs = [i ** 5 for i in range(300)]

for r in rs:
    if r <= x:
        if x - r in rs:
            print(rs.index(r), rs.index(x - r))
            break
    if r > x:
        if r - x in rs:
            print(rs.index(r),  - rs.index(r - x))
            break

Submission status: Wrong Answer

Solution code:
x = int(input())
i = 2
j = 1
while x > i ** 5:
    if x % (i ** 5) == 0:
        j *= i
        x //= i ** 5
        i = 2
    else:
        i += 1
else:
    y = x // j
    for a in range(int(y ** 0.2) + 1):
        b = int((a ** 5 - y).real)
        if a ** 5 - b ** 5 == y:
            print(a * j, b * j)
            break

Submission status: Wrong Answer

Solution code:
from sys import stdin, setrecursionlimit
from collections import defaultdict

setrecursionlimit(10 ** 9)


def input():
    return stdin.readline().strip()


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

    n = X + (- B) ** 5
    if n >= 0:
        A = n ** (1 / 5)
    else:
        A = - (abs(n) ** (1 / 5))
    if A - int(A) == 0.0:
        A = int(A)
        print(A, -B)
        break

Submission status: Wrong Answer

Solution code:
x = int(input())
s = []
flag = 0

for i in range(-80, 80):
    s.append(i**5)

a = -80

for n in s:
    b = -80
    for m in s:
        if n-m == x:
            print(a,b)
            flag = 1
            break
        if flag:
            break
        b += 1

    a += 1

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
x = int(input())
hani = int(pow(x, 1/5))
for a in range(-hani-1, hani+1):
    for b in range(-hani-1, hani+1):
        if (pow(a, 5) - pow(b, 5) == x):
            print(a, b)
            exit()


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


# arr = factorization(x)
# fact = []
# for prime, idx in arr:
#     fact.extend([prime]*idx)

# print(fact)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())

lower = -1
upper = -1
for i in range(0, 10000):
    pow5 = pow(i, 5)
    if lower == -1 and pow5 > x:
        lower = i - 1

    if upper == -1 and pow5 - pow(i-1, 5) > x:
        upper = i
        break

for a in range(lower, upper+1):
    a5 = pow(a, 5)
    for b in range(-1000, a):
        if a5 - pow(b, 5) == x:
            print(a, b)
            exit(0)

print("no")

Submission status: Wrong Answer

Solution code:
import sys

x = int(input())
flag = False
a = 0

while True:
    if x - a**5 <= 0:
        b_sub = pow(abs(x - a**5),1/5)
    else:
        b_sub = (-1)*pow(x - a**5,1/5)
    # if int(b_sub) - b_sub == 0:
    if b_sub.is_integer():
        # flag = True
        print(a,int(b_sub))
        sys.exit()
    a += 1

Submission status: Wrong Answer

Solution code:
x=int(input())
flag=False
for i in range(1,64):
    for j in range(-64,65):
        if i**5-j**5==x:
            print(str(i)+" "+str(j))
            flag=True
            break
    if flag:
        break

Submission status: Wrong Answer

Solution code:
X = int(input())

divisor = []
for i in range(1, int(X ** 0.5) + 1):
    if X % i == 0:
        divisor.append(i)
        if i != X // i:
            divisor.append(X // i)

ok = False
for d in divisor:
    if ok:
        break

    for x in range(-100, 100):
        v = x ** 5 - (x - d) ** 5
        if v == X:
            print(x, x - d)
            ok = True
            break

Submission status: Wrong Answer

Solution code:
x = int(input())

p = 1
while p * p <= x:
    if x % p != 0:
        p += 1
        continue

    q = x // p
    a = 0
    while a < 100:
        b = a - p
        f = a**4 + a**3 * b + a**2 * b**2 + a * b**3 + b**4
        if f == q:
            print(a, b)
            exit(0)
        a += 1
    p += 1

Submission status: Wrong Answer

Solution code:
X=int(input())
num_list=[i-100 for i in range(200)]
for A in num_list:
  for B in num_list:
    if A**5-B**5==X:
      print(A,B)
      break

Submission status: Wrong Answer

Solution code:
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()
    return divisors

x = int(input())
for i in make_divisors(x):
    for j in range(-100, 100, 1):
        if i * (j ** 4 + (j ** 3) * (j - i) + (j ** 2) * ((j - i) ** 2) + j * ((j - i) ** 3) + (j - i) ** 4) == x:
            print(j, j - i) 
            exit()

Submission status: Wrong Answer

Solution code:
from sys import exit

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append(i)

    if temp!=1:
        arr.append(temp)

    if arr==[]:
        arr.append(n)

    return arr

X = int(input())
# Xを因数分解する

lists = factorization(X) 

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

Submission status: Wrong Answer

Solution code:
# Problem D - I hate Factorization

# 素因数分解
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

# input
X = int(input())

# initialization
f_list = factorization(X)
f_list = sorted(f_list, key=lambda x: x[1])
tmp_num = 0
for f in f_list:
    if f[1]==1:
        tmp_num = f[0]
        break
tmp_num_2 = X // tmp_num

# count
ans = [0, 0]
for a in range(tmp_num+1):
    b = -1 * (tmp_num - a)
    if (a**4 + a**3 * b + a**2 * b**2 + a*b**3 + b**4)==tmp_num_2:
        ans[0] = a
        ans[1] = b
        break

# output
print(" ".join(list(map(str, ans))))

Submission status: Wrong Answer

Solution code:
X = int(input())

a = [int( i/2)*((-1)**i) for i in range(1, 1000)]
b = [int( i/2)*((-1)**i) for i in range(1, 1000)]

"""
* Aが正ならBは負または、Aより小さい正
* Aが負ならBは負
* X/(a+b)は、1以上の整数
"""

find = False
if X == 0:
  print(0)
else:  
  for a_ in a:
    for b_ in b:
      if a_ + b_ == 0:
        continue
      if a_ >= 0:
        if b_ >= 0 or b_ > a_:
          continue
      if a_ < 0:
        if b_ >= 0:
          continue
        
      if X%(a_+b_) != 0:
        continue
      
      if (a_**5) - (b_**5) == X:
        print(f"{a_} {b_}")
        find = True
        break
    if find:
      break

Submission status: Wrong Answer

Solution code:
x = int(input())

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

pfs = prime_factorize(x)
for pf in pfs:
  for a in range(1, 101):
    b = a - pf
    if (a**5 - b**5 == x):
      print(a, b)
      break

Submission status: Wrong Answer

Solution code:
x=int(input())
num1=x**(1/5)
if num1==int(num1):
    num1=int(num1)-1
else:
    num1=int(num1)
num2=num1+1
val1=x-(num1**5)
val2=(num2**5)-x
g1=val1**(1/5)
g2=val2**(1/5)
if g1==int(g1):
    print(num1,end=" ")
    print(0-int(g1))
else:
    print(num2,end=" ")
    print(int(g2))

Submission status: Wrong Answer

Solution code:
x = int(input())

flag = 0
for i in range(1, 110):
    for j in range(-100, 100):
        if i ** 5 - j ** 5 == x:
            print(i, j)
            flag = 1
            break
    if flag == 1:
        break

Submission status: Wrong Answer

Solution code:
import sys

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

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

  for i in dn:
    N = i[0]

    for j in range(0, 2*N, 1):
      A = N + j
      B = j

      if A**5-B**5==X:
        print("{0} {1}".format(A, B))
        sys.exit(0)
      
      A = N - j
      B = -j

      if A**5-B**5==X:
        print("{0} {1}".format(A, B))
        sys.exit(0)

if __name__ == "__main__":
  main()

Submission status: Wrong Answer

Solution code:
X = int(input())

for A in range(100):
  C = A ** 5 - X
  B = C ** 0.2
  if isinstance(B, int) == True:
    print(str(A) + " " + str(B))
    break
    
for B in range(100):
  C = B ** 5 + X
  A = C ** 0.2
  if isinstance(A, int) == True:
    print(str(A) + " " + str(B))
    break

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
i = 0
while True:
  t = math.pow(i, 5)-x
  if t >= 0:
    b = math.pow(t, 1/5)
    if b.is_integer():
      print(str(i) + ' ' + str(int(b)))
      break
  else:
    b = math.pow(-t, 1/5)
    if b.is_integer():
      print(str(i) + ' ' + str(int(-b)))
      break
  i += 1

Submission status: Wrong Answer

Solution code:
from sys import stdin

x = int(stdin.readline().rstrip())

fivelist = []

i = 0
while True:
    n = i**5
    # print(i,n)
    if n > 2*(10**9):
        break
    fivelist.append(n)
    i += 1

a = 0
b = 0
ans = False
for i in range(len(fivelist)):
    for j in range(len(fivelist)):
        if x == (fivelist[i] - fivelist[j]):
            a, b = i, j
            ans = True
            break
        if x == (-fivelist[i] - fivelist[j]):
            a, b = -i, j
            ans = True
            break
        if x == (fivelist[i] + fivelist[j]):
            a, b = i, -j
            ans = True
            break
        if x == (-fivelist[i] + fivelist[j]):
            a, b = -i, -j
            ans = True
            break
    if ans:
        break

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

Submission status: Wrong Answer

Solution code:
x = int(input())

#tmp = []
#for i in range(-100,101):
#    tmp.append(i)


a = 0
b = 0
for k in range(-100,101):
    for h in range(-100,101):
        if k**5 - h**5 == x:
            a = k
            b = h
            break

print(a, b)

Submission status: Wrong Answer

Solution code:
X = int(input())

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

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

lst = factorization(X)

ans_A = 0
ans_B = 0
flag = True
for l in lst:
    p = l[0]
    a = p
    b = 0

    if calc(a, b) == X:
        ans_A = a
        ans_B = b
        falg = False
    while flag and calc(a, b) < X:
        a += 1
        b += 1
        if calc(a, b) == X:
            ans_A = a
            ans_B = b
            falg = False

    a = p-1
    b = -1
    if calc(a, b) == X:
        ans_A = a
        ans_B = b
        falg = False
    while flag and calc(a, b) < X:
        a -= 1
        b -= 1
        if calc(a, b) == X:
            ans_A = a
            ans_B = b
            falg = False


print(str(ans_A), str(ans_B))

Submission status: Wrong Answer

Solution code:
X = int(input())

a = [int( i/2)*((-1)**i) for i in range(1, 100)]
b = [int( i/2)*((-1)**i) for i in range(1, 100)]

"""
* Aが正ならBは負または、Aより小さい正
* Aが負ならBは負
* X/(a+b)は、1以上の整数
"""

find = False
if X == 0:
  print(0)
else:  
  for a_ in a:
    for b_ in b:
      if a_ + b_ == 0:
        continue
      if a_ >= 0:
        if b_ >= 0 or b_ > a_:
          continue
      if a_ < 0:
        if b_ >= 0:
          continue
        
      if X%(a_+b_) != 0:
        continue
      
      if (a_**5) - (b_**5) == X:
        print(f"{a_} {b_}")
        find = True
        break
    if find:
      break

Submission status: Wrong Answer

Solution code:
x = int(input())

lower = -1
upper = -1
for i in range(0, 1000):
    pow5 = pow(i, 5)
    if lower == -1 and pow5 > x:
        lower = i - 1

    if upper == -1 and pow5 - pow(i-1, 5) > x:
        upper = i
        break

for a in range(lower, upper+1):
    a5 = pow(a, 5)
    for b in range(-100, a):
        if a5 - pow(b, 5) == x:
            print(a, b)
            exit(0)

print("no")

Submission status: Wrong Answer

Solution code:
from sys import exit

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append(i)

    if temp!=1:
        arr.append(temp)

    if arr==[]:
        arr.append(n)

    return arr

X = int(input())
# Xを因数分解する

lists = factorization(X) 

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

Submission status: Wrong Answer

Solution code:
X=int(input())
A=[]
B=[]
import sys
for i in range(-70,70):
  for j in range(-70,70):
    if i**5-j**5==X:
      print(i,j)
      sys.exit()

Submission status: Wrong Answer

Solution code:
import math

x = int(input())

a = 0
b = 0
while a ** 5 < x:
    a += 1
a -= 1

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

Submission status: Wrong Answer

Solution code:
X = int(input())
xxx = int(X ** (1/5))
for i in range(-1000000, 1000000):
    if xxx ** 5 - i ** 5 == X:
        print(xxx, i)
        exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import *
x=int(input())
a=0
while 1:
  b=a**5-x
  if b<0: b=-pow(-b,0.2)
  else: b=pow(b,0.2)
  if b.is_integer():
    print(a,int(b))
    break
  a+=1

Submission status: Wrong Answer

Solution code:
import math
import itertools

X = int(input())

list = [0]

for i in range(1000):
    val = i**5
    list.append(val)

if X % 2 == 0 and X // 2 in list:
    print(math.pow(X//2, 1/5), 0)
elif X in list:
    print(math.pow(X, 1/5), 0)
else:
    for i in itertools.combinations(list, 2):
        # print(i)
        if i[0] + i[1] == X:
            print(int(math.pow(i[0], 1/5)), -int(math.pow(i[1], 1/5)))
            break
        elif i[0] - i[1] == X:
            print(int(math.pow(i[0], 1/5)), int(math.pow(i[1], 1/5)))
            break

Submission status: Wrong Answer

Solution code:
X = int(input())

running = True
for a in range(-100, 101):
    if not running:
        break
    for b in range(-100, 101):
        if a**5 - b**5 == X:
            print(a, b)
            running = False
            break

Submission status: Wrong Answer

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

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        return 2
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            return f
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
        return n
    return n

A_B = prime_factorize(X)
A = 1
while True:
    if X % A == 0:
        print(A, A - A_B)
        exit()
    A += 1

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

import sys
sys.setrecursionlimit(10**6)
ii = lambda: int(input())
mis = lambda: map(int,input().split())
lmis = lambda: list(mis())
INF = float('inf')

def main():
    x=ii()
    for i in range(100):
        for j in range(-100,100):
            if i**5-j**5==x:
                print(i,j)
                exit()


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
i = 1
while True:
  t = math.pow(i, 5)-x
  if t >= 0:
    b = math.pow(t, 1/5)
    if b.is_integer():
      print(str(i) + ' ' + str(int(b)))
      break
  else:
    b = math.pow(-t, 1/5)
    if b.is_integer():
      print(str(i) + ' ' + str(int(-b)))
      break
  i += 1

Submission status: Wrong Answer

Solution code:
import math


def main():
    x = int(input().strip())
    a = 0
    while True:
        b_5 = a ** 5 - x
        b = math.pow(abs(b_5), 1 / 5)
        if b_5 < 0:
            b *= -1

        if b == int(b):
            break
        a += 1
    print('{} {}'.format(int(a), int(b)))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
X = int(input())

yakusu = {1, X}
X_k = X
for i in range(2, int(X**0.5)+1):
    while X_k % i == 0:
        X_k = X_k // i
        yakusu.add(i)
        yakusu.add(X_k)
        
for k in yakusu:
    for A in range(-1000, 1000):
        value = A**5 - (A-k)**5
        if value == X:
            print(A, A-k)
            break

Submission status: Wrong Answer

Solution code:
from math import floor
from math import ceil
X = int(input())

X_5 = X ** (1/5)

for i in range(-int(ceil(X_5))-1, int(ceil(X_5)) + 1):
    if floor(X_5) ** 5 - i ** 5 == X:
        print(floor(X_5), i)
        exit()

    if ceil(X_5) ** 5 - i ** 5 == X:
        print(ceil(X_5), i)
        exit()

Submission status: Wrong Answer

Solution code:
x = int(input())

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

Submission status: Wrong Answer

Solution code:
import math


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

    # MAX = int(math.pow(10 ** 10, 1 / 5))
    MAX = 10**9

    for b in range(0, MAX + 1):
        a = math.pow(abs(b ** 5 + X), 1 / 5)
        # print(f'b={b} a={a}')
        if a == int(a):
            print(int(a), b)
            return

        a = math.pow(abs(b ** 5 - X), 1 / 5)
        # print(f'b={-b} a={a}')
        if a == int(a):
            print(-int(a), b)
            return

    raise ValueError()


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
x = int(input())
for i in range(10**5):
    if i**5 >= x:
        up = i
        down = i-1
        break

# print(up, down)    
for i in range(10**5):
    if down**5 + i**5 == x:
        print(down, -i)
        exit()
    if down**5 + i**5 > x:
        break

for i in range(10**5):
    if up**5 - i**5 == x: 
        print(up, i)
        exit()
    if up**5 - i**5 < x:
        break

Submission status: Wrong Answer

Solution code:
X = int(input())
b = 0.0
c = True

while c:
    if (abs(X + b**5)**0.2).is_integer():
        c = False
        if X + b**5 > 0:
            a = int(abs(X + b**5)**0.2)
        else:
            a =  int( - 1 * (abs(X + b**5)**0.2))
    elif b == 0:
        b = 1.0
    elif b > 0:
        b = -1.0*b
    else:
        b = -1*b + 1
        
print(a, int(b))

Submission status: Wrong Answer

Solution code:
from sys import stdin

x = int(stdin.readline().rstrip())

fivelist = []

i = 0
while True:
    n = i**5
    # print(i,n)
    if n > (10**9):
        break
    fivelist.append(n)
    i += 1

a = 0
b = 0
ans = False
for i in range(len(fivelist)):
    for j in range(len(fivelist)):
        if x == (fivelist[i] - fivelist[j]):
            a, b = i, j
            ans = True
            break
        if x == (-fivelist[i] - fivelist[j]):
            a, b = -i, j
            ans = True
            break
        if x == (fivelist[i] + fivelist[j]):
            a, b = i, -j
            ans = True
            break
        if x == (-fivelist[i] + fivelist[j]):
            a, b = -i, -j
            ans = True
            break
    if ans:
        break

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

Submission status: Wrong Answer

Solution code:
x = int(input())

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

Submission status: Wrong Answer

Solution code:

x = int(input())
for i in range(-10,10):
    for j in range(-10,10):
        if i**5 - j**5 - x == 0:
            print(i,j)
            break

Submission status: Wrong Answer

Solution code:
X = int(input())
a = 1

while True:
    b5 = X - a**5
    if b5 == 0: print(a, 0); break
    elif b5 < 0:
        b = -1
        while b**5 >= b5:
            if b**5 == b5: print(a, b); break
            b -= 1
        else:
            a += 1; continue
    else:
        b = 1
        while b**5 <= b5:
            if b**5 == b5: print(a, b); break
            b += 1
        else:
            a += 1; continue
    break

Submission status: Wrong Answer

Solution code:
n = int(input())

for i in range(1,n+1):
    if n%i!=0:
        continue
    x,y = i,n//i
    a=1
    b=1-x
    while 1:
        tmp = a**5-b**5
        if tmp>n:
            break
        if tmp==n:
            print(a,b)
            exit()
        a+=1
        b+=1
    a=1
    b=1-y
    while 1:
        tmp = a**5-b**5
        if tmp>n:
            break
        if tmp==n:
            print(a,b)
            exit()
        a+=1
        b+=1

Submission status: Wrong Answer

Solution code:
import sys

def divisors(n):
  res = set()
  for i in range(1, int(n ** 0.5) + 1):
    if n % i: continue
    res.add(i)
    res.add(n // i)
  return res

x = int(sys.stdin.readline().rstrip())

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

def binary(d):
    lo, hi = 0, 10 ** 9
    while lo + 1 < hi:
        a = (lo + hi) // 2 
        b = a - d 
        if f(a, b) >= x:
            hi = a 
        else:
            lo = a
    return hi, hi - d

def main():
    diffs = divisors(x)
    for d in diffs:
        a, b = binary(d)
        if f(a, b) == x:
            print(a, b)
            return 

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
X = int(input())

cand = int(pow(X, 0.2))
diff = - (X - pow(cand, 5))

other = 0
for i in range(-cand, cand + 1):
    if diff == int(pow(i, 5)):
        other = i

print(cand, other)

Submission status: Wrong Answer

Solution code:
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()
    return divisors
x=int(input())
l=make_divisors(x)
ll=[(i,i-j) for i in range(100) for j in l]
for a,b in ll:
  if a**5-b**5==x:
    print(a,b)
    break

Submission status: Wrong Answer

Solution code:
## coding: UTF-8
X = int(input())

a = [-100 + i for i in range(201)]
b = [-100 + i for i in range(201)]

A = -1000
B = -1000
for i in range(201):
    for j in range(201):
        #print('a[i]:{}, b[j]:{}'.format(a[i], b[j]))
        #print(a[i] ** 5)
        #print(b[j] ** 5)
        #print(a[i] ** 5 - b[j] ** 5)
        if(a[i] ** 5 - b[j] ** 5 == X):
            A = a[i]
            B = b[j]
print('{} {}'.format(A, B))

Submission status: Wrong Answer

Solution code:
x = int(input())

lower = -1
upper = -1
for i in range(0, 1000):
    pow5 = pow(i, 5)
    if lower == -1 and pow5 > x:
        lower = i - 1

    if upper == -1 and pow5 - pow(i-1, 5) > x:
        upper = i
        break

for a in range(lower, upper+1):
    print(a)
    a5 = pow(a, 5)
    for b in range(-100, a):
        if a5 - pow(b, 5) == x:
            print(a, b)
            exit(0)

print("no")

Submission status: Wrong Answer

Solution code:
import math
def solve():
  X = int(input())

  for i in range(1,int(math.sqrt(X))+1):
    if X % i == 0:
      A = 1
      B = A - i
      while A**5-B**5<=X:
        if A**5-B**5==X:
          print(A,B)
          return
        A = A + 1
        B= A - i
        
solve()

Submission status: Wrong Answer

Solution code:
x=int(input())
ab=[]
for i in range(64):
    ab.append(i**5)
found=0
for a in range(64):
    for b in range(64):
        if found==1:
            break
        if ab[a]-ab[b]==x:
            print(a,b)
            found=1
        elif ab[a]+ab[b]==x:
            print(a,-b)
            found=1
        else:
            continue

Submission status: Wrong Answer

Solution code:
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()
    return divisors

X = int(input())
divs = make_divisors(X)
# print(divs)
for d in divs:
    if pow(d - 1, 5) + 1 == X:
        print(d - 1, -1)
        exit()