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 random
import functools
import copy
import bisect
import array
import re
import collections
import heapq
import fractions
import itertools
import string
import math
from operator import itemgetter as ig
from bisect import bisect_left, bisect_right, insort_left, insort_right
from itertools import permutations, combinations, product, accumulate, groupby
from heapq import heappush, heappop
from collections import deque, defaultdict, Counter
import sys
sys.setrecursionlimit(10 ** 7)
# import numpy as np

inf = 10 ** 20
INF = float("INF")
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = dd + [(-1, 1), (1, 1), (1, -1), (-1, -1)]
ddn9 = ddn + [(0, 0)]
'''for dx, dy in dd:
        nx = j + dx; ny = i + dy
            if 0 <= nx < w and 0 <= ny < h:'''
"""
from operator import itemgetter
from collections import defaultdict
import sys
import math
sys.setrecursionlimit(10 ** 7)


def wi(): return list(map(int, sys.stdin.readline().split()))
# WideIntPoint


def wip(): return [int(x) - 1 for x in sys.stdin.readline().split()]


def ws(): return sys.stdin.readline().split()


def si(): return int(sys.stdin.readline())  # SingleInt


def ss(): return input()


def hi(n): return [si() for _ in range(n)]


def hs(n): return [ss() for _ in range(n)]  # HeightString


def s_list(): return list(input())


def mi(n): return [wi() for _ in range(n)]  # MatrixInt


def mip(n): return [wip() for _ in range(n)]


def ms(n): return [ws() for _ in range(n)]


def num_grid(n): return [[int(i) for i in sys.stdin.readline().split()[
    0]] for _ in range(n)]  # NumberGrid


def grid(n): return [s_list() for _ in range(n)]


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

# a/b の切り上げ


def round_up(a, b):
    """ a/b の切り上げ """
    c = (a + b - 1) / b
    return c


def lcm(a, b):
    """a,bの最小公倍数"""
    return a * b // gcd(a, b)


def floor(a, b):
    """floor(a/b) 整数値を返す"""
    c = (a - a % b)/b
    return int(c)


def main():
    """
import random
import functools
import copy
import bisect
import array
import re
import collections
import heapq
import fractions
import itertools
import string
import math
from operator import itemgetter as ig
from bisect import bisect_left, bisect_right, insort_left, insort_right
from itertools import permutations, combinations, product, accumulate, groupby
from heapq import heappush, heappop
from collections import deque, defaultdict, Counter
import sys
sys.setrecursionlimit(10 ** 7)
# import numpy as np

inf = 10 ** 20
INF = float("INF")
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = dd + [(-1, 1), (1, 1), (1, -1), (-1, -1)]
ddn9 = ddn + [(0, 0)]
'''for dx, dy in dd:
        nx = j + dx; ny = i + dy
            if 0 <= nx < w and 0 <= ny < h:'''
"""


sys.setrecursionlimit(10 ** 7)


def wi(): return list(map(int, sys.stdin.readline().split()))
# WideIntPoint


def wip(): return [int(x) - 1 for x in sys.stdin.readline().split()]


def ws(): return sys.stdin.readline().split()


def si(): return int(sys.stdin.readline())  # SingleInt


def ss(): return input()


def hi(n): return [si() for _ in range(n)]


def hs(n): return [ss() for _ in range(n)]  # HeightString


def s_list(): return list(input())


def mi(n): return [wi() for _ in range(n)]  # MatrixInt


def mip(n): return [wip() for _ in range(n)]


def ms(n): return [ws() for _ in range(n)]


def num_grid(n): return [[int(i) for i in sys.stdin.readline().split()[
    0]] for _ in range(n)]  # NumberGrid


def grid(n): return [s_list() for _ in range(n)]


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

# a/b の切り上げ


def round_up(a, b):
    """ a/b の切り上げ """
    c = (a + b - 1) / b
    return c


def lcm(a, b):
    """a,bの最小公倍数"""
    return a * b // gcd(a, b)


def floor(a, b):
    """floor(a/b) 整数値を返す"""
    c = (a - a % b)/b
    return int(c)


def main():
    x = int(input())
    for a in range(-100, 100):
        for b in range(-100, 100):
            if a**5 - b ** 5 == x:
                print(a, b)
                sys.exit()


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
i=int(input())
f=0
for j in range(-1000,1001):
    for k in range(j,1001):
        if j**5-k**5==i and j**5-k**5==-i:
            print(j, k)
            f=1
            break
    if f==1:
        break

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)

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

Solution code:
x = int(input())
import math
#print(x)
for i in range(1000000):
    a = x + (i ** 5)
    a2 = x - (i ** 5)
    #print("i", i, "a", a, "a2", a2)

    if a > 0:
        v = math.pow(a, 1.0/5.0)
        if v.is_integer():
            v=int(v)
            #print("v1", v)
            print(v, i)
            break
    else:
        v = math.pow(-a, 1.0 / 5.0)
        if v.is_integer():
            v=int(v)
            #print("v2", v)
            print(i, -v)
            break

    if a2 > 0:
        v = math.pow(a2, 1.0/5.0)
        if v.is_integer():
            v=int(v)
            #print("v3", v)
            print(v, -i)
            break
    else:
        v = math.pow(-a2, 1.0 / 5.0)
        if v.is_integer():
            v=int(v)
            #print("v4", v)
            print(i, v)
            break

Submission status: Wrong Answer

Solution code:
def main():
    x = int(input())
    c = x%5
    while x%c!=0:
        c+=5
    ans = (x-c**5)/c/5
    if ans==0:
        print(c,0)
        return
    def f(x):
        return c**3*x + 2*c**2*x**2+2*c*x**3+x**4-ans
    kai=[]
    for i in range(1,abs(int(ans))+1):
        if abs(int(ans))%i==0:
            kai.append(i)
    if f(0)>0:
        for k in kai:
            if f(k*-1)==0:
                print(c+k*-1,k*-1)
                return
    else:
        for k in kai:
            if f(k)==0:
                print(c+k,k)
                return


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
x = int(input())
lim = int(x**(1/5))+1
for i in range(-1000*lim, 1000*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:
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().rstrip())
for A in range(100):
    A_val = A**5
    val = abs(A_val - X)
    l = prime_factorize(val)
    if len(l) == 5 and len(set(l)) == 1:
        B = prime_factorize(A**5 - X)
        print(A, B[0])
        break

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))
    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:
# -*- coding: utf-8 -*-
import itertools
import numpy as np
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()
max_x = pow(10, 9)
v = 0
v_lis = [0]
i = 1
while max_x > v:
    v = pow(i, 5)
    v_lis.append(v)
    i += 1
# print(v_lis)
mainasu = list(np.array(v_lis)*-1)
v_lis.extend(mainasu)
a_minus = False
b_minus = False
for a5, b5 in itertools.combinations_with_replacement(v_lis, 2):
    if (a5 - b5 == x):
        # print(a5, b5)
        if (a5 < 0):
            a_minus = True
            a5 *= -1
        if(a_minus):
            a = int(pow(a5, 1 / 5)) * -1
        else:
            a = int(pow(a5, 1 / 5))

        if (b5 < 0):
            b_minus = True
            b5 *= -1
        if(b_minus):
            b = int(pow(b5, 1/5))*-1
        else:
            b = int(pow(b5, 1/5))

        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:
#!/usr/bin/env python3
import itertools
x = int(input())
l = [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, 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]
for comb in itertools.combinations_with_replacement(l, 2):
    if comb[0] - comb[1] == x:
        print(l.index(comb[0]), l.index(comb[1]))
        exit()
    elif comb[0] + comb[1] == x:
        print(l.index(comb[0]), -(l.index(comb[1])))
        exit()
    elif - comb[0] + comb[1] == x:
        print(-(l.index(comb[0])), -(l.index(comb[1])))
        exit()
    elif - comb[0] - comb[1] == x:
        print(-(l.index(comb[0])), l.index(comb[1]))
        exit()

Submission status: Wrong Answer

Solution code:
x = int(input())

l5 = [i**5 for i in range(0, 100)]
for a5 in l5:
    for b5 in l5:
        if x == a5 - b5:
            print(int(a5**(1/5)), int(b5**(1/5)))
            exit()
        elif x == a5 + b5:
            print(int(a5**(1/5)), int((-1) * b5**(1/5)))
            exit()

Submission status: Wrong Answer

Solution code:
import collections
import sys

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 == 0:
  print("0 0")
  sys.exit()

x = abs(X)
c = prime_factorize(x)
c.append(1)
c = sorted(c)
#print(c)


for i in range(len(c)):
  B = (c[i] // 2) * -1
  A = B + c[i]
  while True:
    Z = A**5 - B**5
    #print(A,B,Z)
    if Z == X:
      if X < 0:
        print(B,A)
      else:
        print(A,B)
      sys.exit()

    if c[i] * Z > X:
      break    
    A += 1
    B += 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,a[i])
    elif((x-a[i]**5)==a[j]):
      print(j,-a[i])

Submission status: Wrong Answer

Solution code:
x = int(input())
ans = 0
for i in range(100):
    a = int(i/2)*(-1)**int(i/2)
    for j in range(400):
        b = int(j/2)*(-1)**int(j/2)
        if a**5 - b**5 == x:
            ans = 1
            break
    if ans == 1:
        break
print(a,b)

Submission status: Wrong Answer

Solution code:
import sys
import itertools
arr = [i for i in range(-56,57)]
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:
# coding: utf-8
# Your code here!
import math
X = int(input())

a = X**(1/5)

a = math.floor(a)

if a > 0:
        
    
    b = (-1)**(2/5)*(-X + a**5)**(1/5)
    print(a,-math.floor(abs(b)))
    
if a < 0:
        
    
    b = (-1)**(2/5)*(-X + a**5)**(1/5)
    print(a,math.floor(abs(b)))

Submission status: Wrong Answer

Solution code:
x=int(input())
a=int(x**0.2)
b=int((x-a**5)**0.2)
print(a,-b)

Submission status: Wrong Answer

Solution code:
x = int(input())
nums = []
i = 0
while i ** 5 <= 10 ** 10:
    nums.append(i ** 5)
    i += 1

for i in range(len(nums)):
    a5 = nums[i]
    for j in range(len(nums)):
        b5 = nums[j]
        if x == a5 - b5:
            print(i, j)
            exit()
        if x == a5 + b5:
            print(i, -j)
            exit()

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
for i in range(-10000,10000+1):
    dum = (x+(i**5))**(1/5)
    #print(dum)
    if type(dum) != complex:
        dum = dum % 1
        if dum % 1 == 0:
            #print(dum)
            print(math.ceil(dum), i)
            break

Submission status: Wrong Answer

Solution code:
def resolve():
    x = int(input())
    five = []
    for i in range(-1000, 1001):
        five.append(i**5)

    for i in range(len(five)):
        for j in range(len(five)):
            if x == five[i]-five[j]:
                print("{} {}".format(i-999, j-999))
                exit()
resolve()

Submission status: Wrong Answer

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

x -= 1

a = math.pow(x,1.0/5.0)

print(int(a),-1)

Submission status: Wrong Answer

Solution code:
import sys
X=int(input())
Y=int(X**(1/5))
for i in range(Y+1,((-1)*Y)-2,-1):
  for j in range(((-1)*Y)-1,Y+2):
    if (i**5)-(j**5)==X:
      print(i,j)
      sys.exit()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import itertools
x = int(input())
l = [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]
for comb in itertools.combinations_with_replacement(l, 2):
    if comb[0] - comb[1] == x:
        print(l.index(comb[0]), l.index(comb[1]))
        exit()
    elif comb[0] + comb[1] == x:
        print(l.index(comb[0]), -(l.index(comb[1])))
        exit()
    elif - comb[0] + comb[1] == x:
        print(-(l.index(comb[0])), -(l.index(comb[1])))
        exit()
    elif - comb[0] - comb[1] == x:
        print(-(l.index(comb[0])), l.index(comb[1]))
        exit()

Submission status: Wrong Answer

Solution code:
x=int(input())

for i in range(int(x**0.2*2)):

    sign=1
    b=(i**5-x)

    if b<0:
        sign=-1
    b=sign*((b*sign)**0.2)
    
    if b==int(b):
        print(i,int(b))
        break

Submission status: Wrong Answer

Solution code:
x=int(input())
factor=1
for i in range(2,int(pow(x,0.5))+1):
    if x%i==0:
        factor=i
        break
e=0
for b in range(-101,101):
    for a in range(b,101,factor):
        if a**5-b**5==x:
            print(a,b)
            e=1
            break
    if e==1:
        break

Submission status: Wrong Answer

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

import math

def main():
     x = int(input())
     # x は 正の整数
     # ans = a^5 - b^5 = x となる a, b

     x_5div = math.floor(pow(x, 1/5)) + 1
     num_list = [pow(i, 5) for i in range(x_5div + 1)]
     
     # print(x_5div)
     # print(num_list)
     for i in range(x_5div + 1):
          for j in range(i, x_5div + 1):
               i_5div = num_list[i]
               j_5div = num_list[j]

               if i_5div - j_5div == x:
                    print('{} {}'.format(i, j))
                    break
               if j_5div - i_5div == x:
                    print('{} {}'.format(j, i))
                    break
               if i_5div + j_5div == x:
                    print('{} {}'.format(i, j * (-1)))
                    break
               if j_5div + i_5div == x:
                    print('{} {}'.format(j, i * (-1)))
                    break

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math
import sys

x = int(input())

for i in range(int((10**9)/2)+1):
    if x-i**5 < 0:
        flag = 1
        b = math.pow(-(x - i ** 5), 1.0 / 5.0)
    else:
        b = math.pow((x-i**5), 1.0/5.0)
        flag = 0
    if b.is_integer():
        if flag == 1:
            print(i, -int(b))
        else:
            print(i, int(b))
        sys.exit()

Submission status: Wrong Answer

Solution code:
def d166(x):

    a = 0
    b = 0

    if x < 0:
        for i in range(100):
            ax = x + i**5
            if ax > 0:
                a = -i
                for w in range(i):
                    if ax-(w**5) == 0:
                        b = -w
                        return str(a) + " " + str(b)
            else:
                a = -i
                for w in range(i):
                    if ax+(w**5) == 0:
                        b = w
                        return str(a) + " " + str(b)

    else:
        for i in range(100):
            ax = x - i**5
            if ax < 0:
                a = i
                for w in range(i):
                    if ax+(w**5) == 0:
                        b = w
                        return str(a) + " " + str(b)
            else:
                a = i
                for w in range(i):
                    if ax-(w**5) == 0:
                        b = -w
                        return str(a) + " " + str(b)

def main():
    x = int(input())
    print(d166(x))
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:

x = int(input())

def gen_divisor(x):
    for i in range(x + 1, 1):
        if x % i == 0:
            yield i

def gen_candidates(limit, divisor):
    for a in range(limit):
        yield (a, a - divisor)


for divisor in gen_divisor(x):
    for a, b in gen_candidates(x + 1, divisor):
        if a**5 - b**5 == x:
            print(a, b)
            break
    else:
        continue
    break

Submission status: Wrong Answer

Solution code:
def solve(x):

    a = -70
    while a < 70:
        b = -70
        while b < 70 :
            if x + b **5 == a**5:
                break
            else:
                b += 1
        if x + b **5 == a**5:
            break
        else:
            a+=1

    return "{0} {1}".format(a,b)

if __name__ == "__main__":
    x = int(input())
    print(solve(x))

Submission status: Wrong Answer

Solution code:
x = int(input())
box = []
c = 0
for a in range(100):
    bbbbb = a**5-x
    b = bbbbb**(1/5)
    try :
        if b.is_integer() == True:
            print(int(a),int(b))
            break
    except:
        c +=1

Submission status: Wrong Answer

Solution code:
import numpy as np
import sys
import math

x=int(input())
A=np.array([i**5 for i in range(0,10001)])
B=A*(-1)
c=x-A
cnt=0
for i in c:
    if i in A:
        print(cnt,(-1)*(np.where(A==i)[0][0]))
        break
    elif i in B:
        print(cnt,(-1)*(np.where(B==i)[0][0]))
        break
    cnt+=1

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import numpy as np
X = int(input())

ans = ""
for i in range(200):
    temp = i ** 5 - X
    if i ** 5 < temp:
        continue
    else:
        temp_pn = temp // abs(temp)
        if (abs(temp) ** (1 / 5)) % 1 == 0:
            ans = "{} {}".format(i, int(temp_pn * (abs(temp) ** (1 / 5))))
            break
print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())
lim = int(x**(1/5))+1
for i in range(-10*lim, 10*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())

def ok(B):
    i=1
    B=abs(B)
    while i**5<B:
        i+=1
    return i**5==B

def get(B):
    i=1
    B=abs(B)
    while i**5<B:
        i+=1
    return i



A_cand=[]
i=0
while i**5<=10**10:
    A_cand.append(i)
    i+=1

#print(A_cand)
for a in A_cand:
    B_5=a**5-X
    if ok(B_5):
        r=get(B_5)
        print(a,r*(-1 if B_5<0 else 1))
        break

Submission status: Wrong Answer

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

for i in range(100):
  a = pow(i, 5)
  for j in range(100):
    b = pow(j, 5)
    if a-b == x:
      print(i, j)
      sys.exit()
    elif a+b == x:
      print(i, -j)
      sys.exit()

Submission status: Wrong Answer

Solution code:
X = int(input())
#a = int(X**0.2) + 2
if X == 0:
  print(0,0)
else:
  for i in range(-65,65):
    for j in range(-65,65):
      if i==j:
        continue
      else:
        if X%(i-j) == 0:
          if X == i**5 - j**5:
            print(i,j)
            exit()

Submission status: Wrong Answer

Solution code:
X = int(input())

for i in range(-1000, 0):
  for j in range(1000):
    B = i**5
    A = j**5
    if (A - B) == X:
      print('{} {}'.format(A,B))
      break

Submission status: Wrong Answer

Solution code:
import math

X = int(input())

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

Submission status: Wrong Answer

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

X = int(input())

for i in range(-100, 101):
    for j in range(-100, 101):
        if pow(i, 5) - pow(j, 5) == X:
            print(i, j)
            exit()

Submission status: Wrong Answer

Solution code:
import math
x=int(input())
for i in range(10**9):
    a=math.pow(x+i**5,1.0/5.0)
    if a.is_integer()==True:
        print(int(i**5),int(a))
        break;

Submission status: Wrong Answer

Solution code:
import sys
import itertools


x = int(input())
for a in itertools.count():
    for b in itertools.count(a):
        a5b5 = b**5 - a**5
        if a5b5 == x:
            print(a, -b)
            sys.exit(0)
        if x < a5b5:
            break

Submission status: Wrong Answer

Solution code:
x = int(input())

for a in range(1001001001):
    _b = a**5 - x
    if _b >= 0:
        if _b**0.2 == int(_b**0.2):
            print(a, int(_b**0.2))
            break
    elif _b < 0:
        if (-1*_b)**0.2 == int((-1*_b)**0.2):
            print(a, int(-1*(-1*_b)**0.2))
            break

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(i+1,len(a)):
            if a[j]-a[i]==x :
                print(i+1,j+1)
            elif a[j]+a[i]==x:
                print(j+1,-i-1)