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

# #nを素因数分解したリストを返す
# def prime_decomposition(n):
#   i = 2
#   table = []
#   while i * i <= n:
#     while n % i == 0:
#       n /= i
#       table.append(i)
#     i += 1
#   if n > 1:
#     table.append(n)
#   return table
def divisor(n): #nの約数を全て求める
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table

D = divisor(X)

for d1 in D:
    for a in range(300):
        b = d1 - a
        d2 = X // d1
        if a**5-b**5 == X:
            print(a, b)
            exit()









# for d in D:
#     ab = d
#     Z = ab // d
#     print(ab, Z)
#     # print((X ** (1/5)))
#     for b in range(int(sqrt(X)) + 1):
#         a = ab - b
#         if a**5-b**5 == X:
#             print("a, b:", a, b)



# for d in divisor(X):
#     ab = d
#     z = X // d
#     for a in range(10 ** 9):
#         b = a - d
#         dot = 
    # for b in range():

Submission status: Wrong Answer

Solution code:
X = int(input())
a = -100
b = -100
for i in range(201):
    for k in range(201):
        if (a+i)**5 - (b+k)**5 == X:
            print(a+i,b+k)
            break
    else:
        continue
    break

Submission status: Wrong Answer

Solution code:
import sys

x=int(input())
for i in range(1,101):
    for j in range(-100,101):
        if i**5-j**5==x:
            print(i,j)
            sys.exit()

Submission status: Wrong Answer

Solution code:
import math

X = int(input())

for i in range(-int(X**0.2),int(1e6)):
    tmp = (X+i**5)**0.2
    if tmp%1 == 0:
        print(int(tmp),i)
        exit()

Submission status: Wrong Answer

Solution code:
x = int(input())

x2 = int(x**0.5)
if x2**5 == x:
  print(x2, 0)
  exit()
elif x2**5-1 == x:
  print(X2, -1)
  exit()
  
for i in range(1, int(x**0.5)+1):
  if x%i == 0:
    tmp1 = 0
    tmp2 = 0
    a1 = i
    b1 = 0
    a2 = i-1
    b2 = -1
    while tmp1 <= x and tmp2 <= x:
      tmp1 = a1**5 - b1**5
      tmp2 = a2**5 - b2**5
      if tmp1 == x:
        print(a1, b1)
        exit()
      elif tmp2 == x:
        print(a2, b2)
        exit()
      a1+=1
      b1+=1
      a2-=1
      b2-=1

Submission status: Wrong Answer

Solution code:
# /usr/bin/python3
# -*- coding: utf-8 -*-
from queue import Queue
from queue import LifoQueue as Stack
from math import sqrt, floor, ceil, log2, log10, pi, pow
from fractions import gcd
from itertools import permutations, combinations
from operator import itemgetter
from functools import cmp_to_key


INF=1001001001
__MOD__=(10**9)+7
yn = 'YNeos'
judge = False
cnt = 0
ans = None


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

def intinput():
    return int(input())

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

def lineinputs(func=intinput):
    datas = []
    while True:
        try:
            datas.append(func())
        except EOFError:
            break
    return datas

class ModInt():
    def __init__(self, x):
        self.__x = (x % __MOD__)
    def __add__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x + other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x + other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __radd__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x + self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x + self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __sub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x - other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x - other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rsub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x - self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x - self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __mul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rmul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x * self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x * self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __truediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rtruediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x * self.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x * self.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __pow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(self.__x, other.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(self.__x, other.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")
    def __rpow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(other.__x, self.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(other.__x, self.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")

    def __modinv(self, m=__MOD__):
        a = self.__x
        if a == 0:
            raise ZeroDivisionError()
        if gcd(a, m) != 1:
            raise Exception("%sの逆数は求まりません。" % a)
        b, u, v = m, 1, 0
        while b != 0:
            t = a//b;
            a -= t*b
            a, b = b, a
            u -= t * v
            u, v = v, u
        u %= m
        if u < 0:
            u += m
        return u
    def __int__(self):
        return self.__x
    def __str__(self):
        return str(self.__x)



if __name__ == '__main__':
    X = intinput()
    digit = int(pow(X, 1/5))+1
    nums = []
    for i in range(digit+1):
        num = i**5
        nums.append(num)
        nums.append(-1*num)

    for a in nums:
        for b in nums:
            if a - b == X:
                if a < 0:
                    a = -1 * int(pow(-1*a, 1/5))
                else:
                    a = int(pow(a, 1/5))
                if b < 0:
                    b = -1 * int(pow(-1*b, 1/5))
                else:
                    b = int(pow(b, 1/5))
                print(a, b)
                exit()

Submission status: Wrong Answer

Solution code:
#D

X=int(input())
flag=True

#B=0
for a in range(1,100):
    if a**5==X:
        flag=False
        print(a,0)
        break

#A>0>B
if flag:
    br=False
    for a in range(1,101):
        for b in range(a+1,101):
            if a**5+b**5==X:
                flag=False
                br=True
                print(a,-b)
                break
        if br:
            break
        
#A>B>0
if flag:
    br=False
    for a in range(1,201):
        for b in range(a+1,201):
            if X%(a-b)==0:
                if a**4+(a**3)*b+(a**2)*(b**2)+a*(b**3)+(b**4)==int(X/(a-b)):
                    print(a,b)
                    br=True
                    break
        if br:
            break

Submission status: Wrong Answer

Solution code:
from itertools import combinations
import numpy as np
X = int(input())
if X == 0:
    print(1, 1)
    exit()

def prime_factorize(n):
    a = [1]
    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 judge(a, b):
    right = a ** 4 + a ** 3 * b + a ** 2 * b ** 2 + a * b ** 3 + b ** 4
    if (a - b) * right == X:
        return True
    else:
        return False

prime = prime_factorize(X)
cand = []
if len(prime) == 1:
    cand = prime
else:
    for r in range(1, len(prime)):
        for i in list(combinations(prime, r)):
            tmp = np.prod(np.array(list(i)))
            if tmp * tmp <= X:
                cand.append(tmp)
    cand = set(cand)

for c in cand:
    for a in range(-c, c + 1)[::-1]:
        b = a - c
        if judge(a, b):
            print(a, b)
            exit()

Submission status: Wrong Answer

Solution code:
x = int(input())
i = 0
while i**5 < x and (i + 1)**5 < x:
    i += 1
tmp1 = i ** 5
tmp2 = (i+1) ** 5
rest1 = x - tmp1
rest2 = tmp2 - x
j = 0
while j <= rest1:
    if j ** 5 == rest1:
        print(i, -j)
        break
    elif j ** 5 == rest2:
        print(i+1, j)
        break
    else:
        j += 1

Submission status: Wrong Answer

Solution code:
x=int(input())
a=[]
for i in range(0,200):
  a.append(i**5)
for i in range(0,len(a)):
  for j in range(i,len(a)):
    if((a[i]**5-x)==a[j]):
      print(j,i)
    elif((x-a[i]**5)==a[j]):
      print(j,-i)

Submission status: Wrong Answer

Solution code:
X=int(input())
for j in range(1,int(X**0.5)+1):
    if X%j==0:
        for a in range(j):
            b=a-j
            S=j*(a**4+b**4+(a**3)*b+(a**2)*(b**2)+a*(b**3))
            if S==X:
                print(a,b)
                exit(0)
for j in range(X,int(X**0.5)):
    if X%j==0:
        for a in range(j):
            b=a-j
            S=j*(a**4+b**4+(a**3)*b+(a**2)*(b**2)+a*(b**3))
            if S==X:
                print(a,b)
                exit(0)

Submission status: Wrong Answer

Solution code:
x = int(input())
lim = int(x**(1/5))+1
for i in range(-10000*lim, 10000*lim):
    if x + i**5 < 0:
        continue
    if (x+i**5)**(1/5) == int((x+i**5)**(1/5)):
        print(int((x+i**5)**(1/5)), i)
        exit()

Submission status: Wrong Answer

Solution code:
X = int(input())
import sys
for i in range(-100, 100):
    b5 = pow(i, 5)
    a5 = X + b5
    a = pow(a5, 1/5)
    if isinstance(a, float) and a.is_integer():
        print(int(a), int(i))
        sys.exit(0)

Submission status: Wrong Answer

Solution code:
from sys import stdin

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 fn(a, x):
    return 5*a*(a**3 - 2*x*a**2 +2*(x**2)*a - x**3)

X =  int(stdin.readline().rstrip())
factors = factorization(X)

combi = []
combination = 1
for i in range(len(factors)):
    combi.append(factors[i][1])
    combination*=combi[i]+1

aa = [0 for _ in range(len(factors))]
candidate_list = []
for i in range(combination):
    candidate = 1
    for j in range(len(factors)):
        candidate *= factors[j][0]**aa[j]
    candidate_list.append(candidate)

    temp_pos = len(aa)-1

    while(True):
        aa[temp_pos] += 1
        if aa[temp_pos] > combi[temp_pos]:
            aa[temp_pos] = 0
            temp_pos -=1
            continue
        elif temp_pos==0 and aa[temp_pos] > combi[temp_pos] :
            break
        else:
            break




for i in range(len(candidate_list)):
    # 5A(A**3 )
    x = candidate_list[i]
    a=1
    flag=0
    comp = X/x - x**4
    while(True):
        val = fn(a,x)
        if val ==comp:
            flag=1
            print(a, a-x)
            break
        #elif (a**3 > x**3*2) and check < a:
        elif val > comp:
            break
        a+=1
    if flag==1:
        break
        
if flag==0:
    print("1 1")

Submission status: Wrong Answer

Solution code:
n = int(input())
x = 1
y = 0
while x**5 < n:
	y = (n - x**5);
	y = int(y)
	if (x**5 + y**5 == n):
		print(x, -1 * y, sep = " ");
		break
	x+=1
if (x**5 + y**5 != n):
	x = 1
	while True:
		y = int((x**5 + n) ** (1/5))
		if (x**5 + n == y**5):
			print(y,x,sep = " ")
			break
		x+=1

Submission status: Wrong Answer

Solution code:
X = int(input())
C= [0, 1, 32, 243, 1024, 3125, 7776, 16807, 32768, 59049, 100000, 161051, 248832, 371293, 537824, 759375, 1048576, 1419857, 1889568, 2476099, 3200000, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176, 69343957, 79235168, 90224199, 102400000, 115856201, 130691232, 147008443, 164916224, 184528125, 205962976, 229345007, 254803968, 282475249, 312500000, 345025251, 380204032, 418195493, 459165024, 503284375, 550731776, 601692057, 656356768, 714924299, 777600000, 844596301, 916132832, 992436543]

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

Solution code:
x = int(input())
pow5 = [i**5 for i in range(64)]
powp = []
pown = []
for i in range(64):
    powp.append(pow5[i])
    pown.append(-pow5[i])
# print(pown)
for i, ii in enumerate(pow5):
    for j, ji in enumerate(powp):
        if ii - ji == x:
            # print('pp')
            print(i, j)
            exit()
    for j, ji in enumerate(pown):
        if ii - ji == x:
            # print('p1')
            print(i, -j)
            exit()

Submission status: Wrong Answer

Solution code:
ans = int(input())
res = round(ans**0.2)

for i in range(-res, res+1):
    for j in range(-res, res+1):
        if i**5 - j**5 == ans:
            print(i,j)
            exit()

Submission status: Wrong Answer

Solution code:
x = int(input())

for d in range(1, int(x**0.5)+1):
    if x % d == 0:
        for a in range(1,d+1):
            b = a - d
            if a**5 - b**5 == x:
                print(a, b)
                exit()

Submission status: Wrong Answer

Solution code:
x = int(input())

i = -1
b = 0
judge = 0
flag = True
while flag:
    i += 1
    judge = i ** 5 - x
    if judge < 0:
        b = -1
        judge = - judge
        temp = - b ** 5
        while temp <= judge:
            if temp == judge:
                flag = False
                break
            else:
                b -= 1
                temp = - b ** 5
    elif judge == 0:
        b = 0
        break
    else:
        b = 1
        temp = b ** 5
        while temp <= judge:
            if temp == judge:
                flag = False
                break
            else:
                temp = b ** 5
                b += 1
        
print(i, b)

Submission status: Wrong Answer

Solution code:
#!/bin/bash
''':'
docker run --rm -it -v $(cd $(dirname $0) && pwd):/vo:ro pypy:3-2.4.0 \
   /bin/bash -c "pypy3 /vo/$(basename $0) < /vo/input.txt"
exit $?
'''
import sys
from math import ceil


def _i(): return int(sys.stdin.readline().strip())


def main():
    x = _i()
    i = ceil((x/2)**(0.2))
    i5 = i**5
    for j in range(-i+1, i+1):
        if i5 - j**5 == x:
            return f"{i} {j}"


if __name__ == "__main__":
    print(main())

Submission status: Wrong Answer

Solution code:
x = int(input())

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

Submission status: Wrong Answer

Solution code:
x = int(input())
for a in range(10**9):
  if a**5 >= x:
    b = (a**5 -x)**(0.2)
  else:
    b = -(x-a**5)**(0.2)
  if b == int(b):
    print(a,int(b))
    exit()

Submission status: Wrong Answer

Solution code:
x = int(input())

x_5 = x**0.2
x_5_i = int(x_5)

a = 0
b = 0

for i in range(x_5_i + 1):
  i5 = i**5
  if x - i5 == 1:
    a = i
    b = -1
print(a,b)

Submission status: Wrong Answer

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

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    X = int(input())
    import math
    for i in range(0,10,1):
        for j in range(0,-1000000,-1):
            if i == j:
                 continue
            if X % (i - j) == 0:
                if (i-j) * (pow(i,4) + pow(i,3)*j + pow(i,2)*pow(j,2) + i*pow(j,3) + pow(j,4)) == X:
                    print(i,j)
                    exit()
if __name__ == '__main__':
  main()

Submission status: Wrong Answer

Solution code:
x = int(input())
b = (-1)
for i in range(10**6):
    a = i
    if (a-b)*(a**4+(a**3)*b+(a**2)*(b**2)+a*(b**3)+b**4) == x:
        print(a,b)
        break

Submission status: Wrong Answer

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

x = int(read())
memo = []
for i in range(x):
    memo.append(i ** 5)
    memo.append((-i) ** 5)
    if len(str(memo[-1])) > 10:
        break
for i in range(10 ** 7):
    v = i ** 5 - x
    if v in memo:
        print(i, memo.index(v))
        exit()

Submission status: Wrong Answer

Solution code:
import math
X = int(input())
for i in range(10**9):
    A = i**5
    if A <= X:
        p = (X-A)**0.2
        r = 1
    if A > X:
        p = (A-X)**0.2
        r = 0
    if float.is_integer(p):
        B = math.floor(p)
        if A <= X:
            B = -B
        print(str(A) + " " + str(B))
        exit()

Submission status: Wrong Answer

Solution code:
X = int(input())
xi = int(X ** (1/5))
for i in range(-xi, xi):
    for j in range(-xi, xi):
        if i**5 - j**5 == X:
            A, B = i, j
            print(A, B)

Submission status: Wrong Answer

Solution code:
if __name__=='__main__':
    x = int(input())
    n = 0
    while x > n**5:
        n+=1 
    for i in range(n):
        if n**5-i**5==x:
            print('{} {}'.format(n,i))
        if (n-1)**5+i**5==x:
            print('{} {}'.format(n-1,-i))

Submission status: Wrong Answer

Solution code:
def test(x):
    # x = int(input())

    t = int(x**0.2)

    for i in range(int(x**0.2)+1):
        for j in range(-int(x**0.2)-1,int(x**0.2)+1):
            d = i**5-j**5
            if(x == d):
                print(x,i,j)
                return()
def test2(x):
    t = int((x//2)**0.2)
    if(t**5 == x):
        print(t,-t)
    else:
        j = -int(x**0.2)
        i = int((x + j**5)**0.2)

        print(i,j)
# for i in range(1,100000):
#     test(i)
#     test2(i)


x = int(input())
test2(x)

Submission status: Wrong Answer

Solution code:
num = int(input())
list = [i ** 5 for i in range(1000)]
ans = []
for a in range(1000):
    for b in range(1000):
        if list[a] - list[b] == num: 
            ans = [a, b]
            break
        if list[a] + list[b] == num:
            ans = [a, b * (-1)]
            break
print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())
d = [[0 for i in range(110)] for j in range(110)]
for i in range(110):
    d[0][i] = i**5
    d[i][0] = i**5
for i in range(1,110):
    for j in range(1,110):
        d[i][j] = d[0][j]+d[i][0]
for m in range(110):
    if x in d[m]:
        print(m,-d[m].index(x))
        break

Submission status: Wrong Answer

Solution code:
from itertools import product
X =int(input())
a = [i ** 5 for i in range(-64, 65)]
b = [(-i) ** 5 for i in range(-64, 65)]
for i, j in product(range(len(a)), range(len(b))):
    if a[i] - b[j] == X:
        print(f'{i} {-j}')
        break

Submission status: Wrong Answer

Solution code:
import bisect as bs
import sys

x = int(input())

dic = {}

i = 1
while True:
  dic[i ** 5] = i
  if i ** 5 >= 10 ** 10:
    break
    
  i += 1
  

for i in range(100):
  tmp = x + (i ** 5)
  if tmp in dic.keys():
    print(dic[tmp], i)
    sys.exit(0)
    
  tmp = x - (i ** 5)
  if tmp in dic.keys():
    print(dic[tmp], -i)
    sys.exit(0)

Submission status: Wrong Answer

Solution code:
x = int(input())
import math
for i in range(10**5):
    z = (x - i ** 5)
    if z == 0:
        b = 0
    else:
        b = pow((x - i ** 5), -5)
    #print(i, b)
    if i ** 5 - math.floor(abs(b)) ** 5 == x:
        print(i, math.floor(abs(b)))
        exit()
    if i ** 5 - (-math.floor(abs(b))) ** 5 == x:
        print(i, -math.floor(abs(b)))
        exit()
    if i ** 5 - math.ceil(abs(b)) ** 5 == x:
        print(i, math.ceil(abs(b)))
        exit()
    if i ** 5 - (-math.ceil(abs(b))) ** 5 == x:
        print(i, -math.ceil(abs(b)))
        exit()

Submission status: Wrong Answer

Solution code:
import math
a=[1, 32, 243, 1024, 3125, 7776, 16807, 32768, 59049, 100000, 161051, 248832, 371293, 537824, 759375, 1048576, 1419857, 1889568, 2476099, 3200000, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176, 69343957, 79235168, 90224199, 102400000, 115856201, 130691232, 147008443, 164916224, 184528125, 205962976, 229345007, 254803968, 282475249, 312500000, 345025251, 380204032, 418195493, 459165024, 503284375, 550731776, 601692057, 656356768, 714924299, 777600000, 844596301, 916132832, 992436543, 1073741824, 1160290625, 1252332576, 1350125107, 1453933568, 1564031349, 1680700000, 1804229351, 1934917632, 2073071593, 2219006624, 2373046875, 2535525376, 2706784157, 2887174368, 3077056399, 3276800000, 3486784401, 3707398432, 3939040643, 4182119424, 4437053125, 4704270176, 4984209207, 5277319168, 5584059449, 5904900000, 6240321451, 6590815232, 6956883693, 7339040224, 7737809375, 8153726976, 8587340257, 9039207968, 9509900499, 10000000000, 10510100501, 11040808032, 11592740743, 12166529024, 12762815625, 13382255776, 14025517307, 14693280768, 15386239549, 16105100000, 16850581551, 17623416832, 18424351793, 19254145824, 20113571875, 21003416576, 21924480357, 22877577568, 23863536599, 24883200000]
x=int(input())
if x==1:
    print(0,-1)
else:
    for i in range(len(a)):
        for j in range(len(a)):
            if a[j]-a[i]==x :
                print(j+1,i+1)
            elif a[j]+a[i]==x:
                print(j+1,-i-1)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
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())

    fact = factorization(x)
    fact = [[1]] + fact
    chk = 1
    for q in fact:
        p = q[0]
        a = p
        b = 0
        y = p ** 5
        while y <= x and chk == 1:
            y = a ** 5 - b ** 5
            if x == y:
                print(a, b)
                chk = 0
                break
            a += 1
            b += 1
        if chk == 0:
            break

        a = p
        b = 0
        while a >= b:
            z = a ** 5 + b ** 5
            if x == z:
                print(a, -b)
                chk = 0
                break
            a -= 1
            b += 1
        if chk == 0:
            break

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a = int(input())
lister = []
dicter = dict()
for i in range(0, 100):
    lister.append(i ** 5)
    lister.append(-i ** 5)
    dicter[i ** 5] = i
    dicter[- i ** 5] = -i

for i in range(1, 101):
    no = i ** 5 - a
    if no in lister:
        print(i, dicter[no])
        break

Submission status: Wrong Answer

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

for a in range(1, 1000):
    for b in range(-1, 1000):
        an = (a-b)*((a**4) + (a**3)*b + (a**2)*(b**2) + a*(b**3) + b**4)

        if an == X:
            print(a, b)
            exit()

Submission status: Wrong Answer

Solution code:
#48:35
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

fact = prime_factorize(x)

n = (fact[0] if len(fact) > 0 else 1)
r = x / n

for a in range(x):
    b = (a - n)
    c = pow(a+b, 4) - 3 * pow(a, 3) * b - 5 * pow(a, 2) * pow(b, 2) - 3 * a * pow(b, 3)

    if c == r:
        print(a, b)
        exit()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import collections
import itertools as it
import math
#import numpy as np
 
#  = input()
x  = int(input())
#  = map(int, input().split())
#  = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#
# c = collections.Counter()

for a in range(1, 10**8):
    b = abs((a**5 - x)**(1/5))
    #print(a, b, (b.is_integer()))

    if b.is_integer():
        b = int(b)
        print(-a, b)

        break

Submission status: Wrong Answer

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

for a in range(10**5):
  b5=(int(a**5)-X)
  if b5<0:
    b5=-b5
    tmp=True
  b=int(b5**0.2)
  
  if tmp==True:
    b=-b
    
  if a**5-b**5==X:
    print(a,b)
    break

Submission status: Wrong Answer

Solution code:
x=int(input())
a=int(x**(0.2))
for f in range(0,a+1):
    b=((f**5)-x)
    if b<0:
        b=-b
        e=b**(0.2)
        if e%1==0:
            print(f,int(-e))
            break
    else:
        e=b**(0.2)
        if e%1==0:
            print(f,int(e))
            break

Submission status: Wrong Answer

Solution code:
x = int(input())
# (a-b)(a**4 + a**3 * b + a**2 * b**2 + a * b**3 + b**4) = x を満たすa,b を出力
i = int(x**(1/5))
for root_range in range(-i,i):
    r = x + (root_range**5)
    r_int = int(r)
    if r == r_int:
        print(r_int, root_range)
        break

Submission status: Wrong Answer

Solution code:
X = int(input())
Y = int(pow(X, 1/5))

for a in range(1, Y+1, 1):
  r = (a ** 5) - X
  b = 0
  if r >= 0:
    b = pow(r, 1/5)
  else:
    b = -pow(-r, 1/5)
  if b % 1 == 0:
    print(a, int(b))
    break

Submission status: Wrong Answer

Solution code:
X = int(input())
import sys
for i in range(-70, 71):
    b5 = pow(i, 5)
    a5 = X + b5
    a = pow(a5, 1/5)
    if isinstance(a, float) and a.is_integer():
        print(int(a), int(i))
        sys.exit(0)

Submission status: Wrong Answer

Solution code:
m=int(input())
flag=True
for i in range(1000000):
    n=(m+i**5)**0.2
    if n==int(n):
        if n**5-i**5==m:
            print(int(n),i)
            break
    if flag:
        n=(m-i**5)**0.2
        if type(n)==complex:
            flag=False
        elif n==int(n):
            if n**5+i**5==m:
                print(int(n),-i)
                break

Submission status: Wrong Answer

Solution code:
X=int(input())
A = []
a=0
while a**5 < 10.0**9:
    A.append(a**5)
    a+=1

for i, a_5 in enumerate(A):
    for j, b_5 in enumerate(A[i+1:]):
        if b_5 - a_5 == X:
            print(str(i+j+1) + ' ' + str(i))
            exit()
        elif b_5 + a_5 == X:
            print(str(i+j+1) +' ' + str((-1)*i))
            exit()

Submission status: Wrong Answer

Solution code:
X = int(input())
if X==1:
    print(0,-1) 
else:
    d = 2
    while(X%d!=0):
        d+=1
    b = -1
    a = b+d
    print(a,b)

Submission status: Wrong Answer

Solution code:
x=int(input())
a=int(x**(1/5))+1
l=list(range(a+1))
s=[]
m=0
for i in l:
  k=i**5
  l[i]=k
for i in l:
  s.append(i*-1)
p=l+s
for i in p:
  if m==1:
    break
  for q in p:
    if x==i-q:
      print(int(i**(1/5)),end=" ")
      m+=1
      if p.index(q)<=a+1:
        print(p.index(q))
      else:
        print((p.index(q)-a-1)*-1)
      break

Submission status: Wrong Answer

Solution code:
x = int(input())
y = []
count = 0
for i in range(0, 70):
  y.append(i*i*i*i*i)
for i in y:
  count += 1
  for j in y[:count]:
    y2 = i + j
    y3 = i - j
    if y2 == x:
      print(str(i) + " " + str(j))
      break;
    if y3 == x:
      print(str(i) + " -" + str(j))
      break;

Submission status: Wrong Answer

Solution code:
import sys
import itertools
arr = [i for i in range(-100,100)]
X = int(input())
t = len(arr)

for v in itertools.permutations(arr,2):
   if v[0]**5 - v[1]**5==X:
      print("{0} {1}".format(v[0],v[1]))
      sys.exit()

Submission status: Wrong Answer

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

for a in range(1, 101):
    for b in range(-1, 101):
        an = (a-b)*((a**4) + (a**3)*b + (a**2)*(b**2) + a*(b**3) + b**4)

        if an == X:
            print(a, b)
            exit()