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
input = sys.stdin.readline
#N, K = (int(i) for i in input().split())
#B = [int(x) for x in stdin.readline().rstrip().split()]
#A = [[int(i) for i in input().split()] for i in range(N)]

X = int(input())

for i in range(100):
    res = X + i**5
    p = res ** (1/5)
    if isinstance(p, float):
        if p.is_integer():
            print(int(p), i)
            exit()
    res = X + (-i**5)
    p = res ** (1/5)
    if isinstance(p, float):
        if p.is_integer():
            print(int(p), -i)
            exit()

Submission status: Wrong Answer

Solution code:
from itertools import combinations_with_replacement
#a, b = list(map(int, input().split(" ")))
x = int(input())

fivelist = dict()
for i in range(66):
    fivelist[i] = i**5

for a, ma in fivelist.items():
    for b, mb in fivelist.items():
        if ma + mb == x:
            tmp = -b
            print(f"{a} {tmp}")
            exit(0)
        elif ma - mb == x:
            tmp = - b
            print(f"{a} {tmp}")
            exit(0)

Submission status: Wrong Answer

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

xl = []
for i in range(1,int(X**0.5)+1):
    if X%i==0:
        xl.append(i)
        
for i in xl:
    for j in range(1,int(X**0.2)+1):
        if j**5-(j-i)**5 == X:
            print(j,j-i)
            sys.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)+2):
  if x%i == 0:
    tmp1 = 0
    tmp2 = 0
    a1 = i
    b1 = 0
    a2 = i-1
    b2 = -1
    while tmp1 <= x or 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:
x=int(input())
n = 1000
l = [x**5 for x in range(-n, n)]
for i,y in enumerate(l):
    if y+x in l:
        print(f'{int(l.index(y+x)-len(l)/2+1)} {int(i-len(l)/2+1)}')
        break

Submission status: Wrong Answer

Solution code:
x = int(input())
box = []
c = 0
for a in range(100000):
    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:
def main():
    from builtins import int, map, list, print, len
    import sys
    sys.setrecursionlimit(10 ** 6)

    X = int(input())
    t = []
    i = 0
    while True:
        x = i ** 5
        t.append(x)
        if x > 10 ** 9:
            break
        i += 1
    d = {}
    for i in range(len(t)):
        for j in range(len(t)):
            d[t[i] - t[j]] = [i, j]
            d[t[i] + t[j]] = [i, -j]
            d[-t[i] - t[j]] = [-i, j]
            d[-t[i] + t[j]] = [-i, -j]
    try:
        print(d[X][0], d[X][1])
    except Exception as e:
        print(e)


if __name__ == '__main__':
    main()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
import random

#a , b = 81,79
#x = a**5 - b**5
'''
while x < 1 or x > 10**9:
    a = random.randint(-100, 100)
    b = random.randint(-100, 100)
    x = a**5 - b**5
'''
#print(a,b,x)
x = int(stdin.readline().rstrip())

fivelist = []

i = 0
while True:
    n = i**5
    # print(i,n)
    if n > 2*(10**10):
        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:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
X=int(input())
for B in range(-100,100):
#     print('------------------------------')
#     print('B:', B)
#     print('B**5:', B**5)
    A = (X+(B**5))**(1/5)
    if (abs(A))%1==0:
        print(int(A), B)
        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(len(a)):
            if a[j]-a[i]==x :
                print(j+1,i+1)
                break
            elif a[j]+a[i]==x:
                print(j+1,-i-1)
                break
        break

Submission status: Wrong Answer

Solution code:
x = int(input())
k = 1
for i in range(2,x+1):
    if x % i == 0:
        k = i
        break

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

Submission status: Wrong Answer

Solution code:
X=int(input())
i=0
while (i+1) ** 5 - i** 5 <= X:
    i+=1
    
for ii in range(-i+1,i):
    if i**5 - ii**5==X:
        break

print(i,ii)

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[0])
tmp_num = f_list[0][0] ** f_list[0][1]
tmp_num_2 = X // tmp_num

# count
ans = [0, 0]
for a in range(tmp_num, -1, -1):
    b = a - tmp_num
    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:
def ff(n):
    if(n==0): return 0
    if(n==1): return 1
    i=2
    while(i*i<=n):
        if(n%i==0): return i
        i+=1
    return n

x=int(input())
f=ff(abs(x))
A=0
B=0
for i in range(-100000,100000):
    b,a=i,i+f
    z=a**5-b**5
    if(z==abs(x)):
        A=a
        B=b
        break
if(x<0): A,B=B,A
print(A,B)

Submission status: Wrong Answer

Solution code:
X = int(input())

# Aの数は10**4個ある
# そして二分探索する

nums = [0]
n = 1
while ((n**5) - ((n - 1)**5)) <= X * 2:
    nums.append(n**5)
    n += 1
# print(nums)
ans = None
for num in nums:
    if X - num in nums:
        ans = (num, -(X - num))
        break
    elif X + num in nums:
        ans = (num, X + num)
        break
if ans:
    print(*ans)

Submission status: Wrong Answer

Solution code:
import sys
import math

x = int(sys.stdin.readline().rstrip())
a = 0
b = 0
while True:
  b = math.sqrt(abs(a ** 5 - x))
  if b.is_integer():
    break
  else:
    a += 1

if a ** 5 - x > 0:
  print(a, int(b))
else:
  print(a, - int(b))

Submission status: Wrong Answer

Solution code:
x = int(input())
n = 10
posi = [pow(i, 5) for i in range(n)]
nega = [pow(i, 5) for i in range(0, -n, -1)]
flag = False
for i in range(n):
    for j in range(n):
        if posi[i] - nega[j] == x:
            print(i, -j)
            flag = True
            if flag:
                break
    if flag:
        break

Submission status: Wrong Answer

Solution code:

X = int(input())

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

Submission status: Wrong Answer

Solution code:
import math

x = int(input())
s = math.floor(x ** (1/5)) 
a = 0
b = 0
for i in range(-s, s):
    for j in range(-s, s):
        if (i**5 - j**5) == x:
            a = i
            b = j

print(a,b)

Submission status: Wrong Answer

Solution code:
x = int(input())
sq = []
for i in range(10**2):
    sq.append(i**5)
    sq.append(-i**5)
b = False
for i in range(len(sq)):
    for j in range(len(sq)-i):
        if sq[-i-1]-sq[j] == x:
            if i%2 == 0:
                m = -1
            else:
                m = 1
            if j%2 == 0:
                n = 1
            else:
                n = -1
            print(m*(100-(i//2+1)), n*(j//2))
            b = True
            break
    if b:
        break

Submission status: Wrong Answer

Solution code:
import queue
n = int(input())

a = 0
aa = 0
ab = 0
q = queue.Queue()

while(1):
    a += 1
    aa = a ** 5
    q.put(aa)
    if aa >= n:
        ab = (a-1)**5
        break

b = 0
if aa == n:
    print(str(a) + " 0")
    exit()

for i in range(1,a+1):
    b = q.get()
    if aa - b == n:
        print(str(a) + " " + str(i))
        exit()
    if ab + b == n:
        print(str(a - 1) + " " + str(-i))
        exit()

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]

    for i in range(1, l[1]+1):
        a = p*i
        b = 0
        if calc(a, b) == X:
            ans_A = a
            ans_B = b
            flag = False
        while flag and calc(a, b) < X:
            a += 1
            b += 1
            if calc(a, b) == X:
                ans_A = a
                ans_B = b
                flag = False

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

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


        a = 1
        b = 0
        if calc(a, b) == X:
            ans_A = a
            ans_B = b
            flag = False

if flag == True:
    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 = 0
    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:
import collections
import itertools

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

a = prime_factorize(X)
L = len(a)

for i in range(L+1):
    d = list(itertools.combinations(a,i))
for i in range(L+1):
    d = itertools.combinations(a,i)
    Y = 1
    if i != 0:
        for j in d:
            Y *= j[0]
    A = 0
    while A < 10**5:
        if A ** 5 - (A-Y)**5 == X:
            print(A,A-Y)
            exit()
        else:
            A += 1

Submission status: Wrong Answer

Solution code:
x=int(input())
n = 200
l = [x**5 for x in range(-n, n)]
for i,y in enumerate(l):
    if y+x in l:
        print(f'{int(l.index(y+x)-len(l)/2+1)} {int(i-len(l)/2+1)}')
        break

Submission status: Wrong Answer

Solution code:
hoge = {}
for i in range(100):
    hoge[i] = i**5
for i in range(100):
    hoge[-i] = -i**5
x = int(input())
for i in hoge.items():
    for j in hoge.items():
        if i[1] - j[1] == x:
            print(i[0], j[0])

Submission status: Wrong Answer

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

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

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

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

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


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


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

    X = ii()

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
x = int(input())

xset = set([])

for i in range(100000):
    xset.add(i**5)
    xset.add(-i**5)

for xx in xset:
    if xx+x in xset:
        a5 = xx
        b5 = xx+x

if a5 < 0:
    a = -pow(-a5, 0.2)
else:
    a = pow(a5, 0.2)

if b5 < 0:
    b = -pow(-b5, 0.2)
else:
    b = pow(b5, 0.2)

print(int(a), int(b))

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
  if (A - B) == X:
    break

Submission status: Wrong Answer

Solution code:
#coding: utf-8

import sys

X = int(input())

powers = {}
num = 100
for i in range(num):
    powered = pow(num, 5)
    powers[i] = powered
for a in range(num-1, 0, -1):
    for b in range(0, num):
        poweredA = powers[a]
        poweredB = powers[b]
        if poweredA - poweredB == X:
            print(a, b)
            sys.exit()
        elif poweredA + poweredB == X:
            print(a, -b)
            sys.exit()

Submission status: Wrong Answer

Solution code:
# region
import sys

DEBUG = True if (len(sys.argv) > 1 and sys.argv[1] == "DEBUG") else False


def dp(value):
    if DEBUG:
        print(value)
    return


def input_text(split=" "):
    # 入力
    result = []
    while True:
        try:
            row = list(
                map(lambda x: int(x) if x.isdecimal() else x, input().split(split))
            )
            result.append(row)
        except EOFError:
            break
    return result


# endregion
it = input_text()

x = it[0][0]  # 道の数
a = 1
b = 0

if x == 0:
    print(0, 0)
    sys.exit()

while True:
    bb = b ** 5
    if bb + 1 == x:
        print(1, b)
        break

    if bb - 1 == x:
        print(-1, b)
        break

    if -bb + 1 == x:
        print(1, -b)
        break

    if -bb - 1 == x:
        print(-1, -b)
        break

    b += 1

Submission status: Wrong Answer

Solution code:
X = int(input())

for i in range(-20000, 20000):
    if (i+3)**5 - (i+2)**5 == X:
        # print(i, (i+3)**5 , (i+2)**5)
        print((i+3), (i+2))
        break
    elif (i+3)**5 + (i+2)**5 == X:
        # print(i, (i+3)**5 , (i+2)**5)
        print((i+3), -(i+2))
        break
    elif -(i+3)**5 - (i+2)**5 == X:
        # print(i, (i+3)**5 , (i+2)**5)
        print(-(i+3), (i+2))
        break
    elif -(i+3)**5 + (i+2)**5 == X:
        # print(i, (i+3)**5 , (i+2)**5)
        print(-(i+3), -(i+2))
        break

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
end = 0
x = int(input())

for b in range(200):
    for s in [1, -1]:
        n = x+(b*s)**5
        m = n < 0
        if m:
            n = n * -1
        a = n**0.2
        if isinstance(a, float) and a.is_integer():
            end = 1
            print(int(a) * (-1 if m else 1), b * s)
            break
    if end:
        break

Submission status: Wrong Answer

Solution code:
x=int(input())
n = 200
l = [x**5 for x in range(-n, n)]
for i,y in enumerate(l):
    if y+x in l:
        print(i)
        print(f'{int(l.index(y+x)-len(l)/2+1)} {int(i-len(l)/2+1)}')

Submission status: Wrong Answer

Solution code:
x=int(input())
for b in range(-10**5, 10**5, 1):
    a = (b**5+x)**(1/5)
    if type(a) is float:
        if a==a//1:
            break
print(int(a),b)

Submission status: Wrong Answer

Solution code:
import bisect as bs
import sys

x = int(input())

dic = {}

i = 1
while True:
  dic[i ** 5] = i
  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())

for i in range(-10, 10):
    for j in range(-10, 10):
        if pow(i, 5) - pow(j, 5) == X:
            print(i, j)
            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 or 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:
import sys
import os
import math
import bisect
import collections
import itertools

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

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

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

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


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


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

    X = ii()

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
# 約数列挙
def find_divisor(n):
    divisors=[]
    for i in range(1, int(sqrt(n)) + 1):
        if n % i == 0:
            divisors.append(i)
            if i*i!=n:
                divisors.append(n // i)
    return divisors


def main():
    X=I()
    S=set()
    for i in range(10**5):
        S.add(i**5)
        S.add(-i**5)
    for s in S:
        if(X-s in S):
            B=int(pow(abs(X-s),1/5))
            if(X-s<0):
                B*=-1
            A=int(pow(abs(s),1/5))
            if(s<0):
                A*=-1
            print(A,B)
            break

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math


def GetMulti(a, b):
    return pow(a, 4)+pow(a, 3)*b+pow(a, 2)*pow(b, 2)+pow(b, 3)*a+pow(b, 4)


def IsPossible(p, q):
    a = -1
    b = -1
    # for i in range(-p*q,p*q):
    # l = max(p,q)
    l = int((p*q)**(1/5))
    for i in range(l+1):
        # print(p, q, i, GetMulti(i, p-i), GetMulti(i, -i))
        if GetMulti(i, i-p) == q:
            a = i
            b = i-p
            break
        elif GetMulti(i, i-q) == p:
            a = i
            b = i-q
            break
    
    return a,b

X = int(input())
ok = False
for i in range(1,int(math.sqrt(X))+1):
    if X%i==0:
        p = i
        q = X//i
        # print(p,q)
        result = IsPossible(p, q)
        # ok = False
        for r in result:
            if r is not -1:
                ok = True
        if ok:
            # print(result)
            break

if ok:
    print("%d %d" % (result[0], result[1]))

Submission status: Wrong Answer

Solution code:
X = int(input())
As = [0]*121
for i in range(1,121):
  As[i] = i**5

flag = 0
for i in range(1,121):
  a = As[i]
  for j in range(i+1):
    b = As[j]
    if a + b == X:
      print(a,b)
      flag = 1
      break
    elif a - b == X:
      print(a, -b)
      flag = 1
      break
  if flag == 1:
    break

Submission status: Wrong Answer

Solution code:
X=int(input())
for j in range(2,int(X**0.5)+1):
    if X%j==0:
        for a in range(10**6):
            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())
if x == 0:
    a = b = 1
    print(a,b)
else:
    for a in range(10**3):
        for d in range(1,10**2):
            if x % d !=0:
                break
            else:
                val = a**4 + (a**3)*(a-d) + (a**2)*((a-d)**2) + a*((a-d)**3) + (a-d)**4
                if val == x//d:
                    b = a - d
                    print(a,b)
                    break
        else:
            continue
        break

Submission status: Wrong Answer

Solution code:
### ----------------
### ここから
### ----------------

import sys
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline
    x=int(readline())
    to=1000
    memo=[0]*to
    #memo={}
    for i in range(to):
        memo[i]=i**5

    a=0
    b=0
    if x==0:
        print(a,b)
        return

    for i in range(to):
        z1=x-memo[i]
        z2=memo[i]-x
        if z1 in memo:
            a=i
            for j in range(to):
                if memo[j]==z1:
                    b=j*-1
            break
        if z2 in memo:
            a=i
            for j in range(to):
                if memo[j]==z1:
                    b=j
            break
    if a!=0 or b!=0:
        print(a,b)
        return
    
    b=1000**5
    for i in range(1001,100000000):
        a=b
        b=i**5
        if (b-a)==x:
            print(b,a)
            return

    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

### ----------------
### ここまで 
### ----------------

Submission status: Wrong Answer

Solution code:
from math import factorial as fact
import math
import sys
import itertools
import numpy as np
from collections import Counter
import datetime


#入力:N(int:整数)
def input1():
	return int(input())

#入力:N,M(int:整数)
def input2():
	return map(int,input().split())

#入力:[n1,n2,...nk](int:整数配列)
def input_array():
	return list(map(int,input().split()))

def keta(N):
	return len(str(N))


def input_daytime(input_time):
	time,distance=input_time.split()
	t=time.split(":")
	se=str(t[-1]).split(".")
	dt1 = datetime.timedelta(hours=int(t[0]),minutes=int(t[1]),seconds=int(se[0]),milliseconds=int(se[1]))
	return dt1

def combinations(n,r):
	return list(itertools.combinations(range(n),r))



def all_sets(num_list):
	subsets=[]
	for i in range(2,len(num_list) + 1):
		for c in combinations(num_list, i):
			subsets.append(c) 
	return subsets

#公約数の列挙
def ch(x1):
	cf=[]
	for i in range(2,math.sqrt(x1)+1):
		if x1 % i==0:
			cf.append(i)
	return cf

def CountOneRoots(x,y):
	#x:縦，y:横
	return fact(x+y)/fact(x)/fact(y)

# 素因数分解
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=input1()
if x>1:
	prime=prime_factorize(x)
else:
	prime=[1,1]
for i in range(x):
	a=i
	b=a-prime[0]
	if x==a**5-b**5:
		print(a,b)
		break

Submission status: Wrong Answer

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

def main():
    x=int(input())
    x_lis=make_divisors(x)
    q_lis=set()
    for xx in x_lis:#xの約数
        xx_lis=make_divisors(xx)
        for q in xx_lis:#xの約数の約数
            q_lis|={q}

    for q in list(q_lis):
        a=0
        b=a-q
        while a**5-b**5<=x:
            if a**5-b**5==x:
                print(a,b)
                sys.exit()
            a+=1
            b+=1
        a=0
        b=q-a
        while a**5-b**5<=x:
            if a**5-b**5==x:
                print(a,b)
                sys.exit()
            a+=1
            b-=1


if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
x = int(input())

lower = -1
upper = -1
for i in range(0, 1000000):
    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(-10000, a+1):
        if a5 - pow(b, 5) == x:
            print(a, b)
            exit(0)

# 0, 0
print(0, 0)

Submission status: Wrong Answer

Solution code:
X=int(input())
m = X
pf={}
if X == 1:
    pf[1] = 1
else:
    for i in range(2,int(m**0.5)+1):
        while m%i==0:
            pf[i]=pf.get(i,0)+1
            m//=i
    if m>1:pf[m]=1

for p in pf.keys():
    for i in range(100):
        if pow(i,5) - pow(i-p,5) == X:
            print(i,i-p)
            exit()

Submission status: Wrong Answer

Solution code:
X = int(input())

for i in range(-200, 200):
    if (i+3)**5 - (i+2)**5 == X:
        # print(i, (i+3)**5 , (i+2)**5)
        print((i+3), (i+2))
        break
    elif (i+3)**5 + (i+2)**5 == X:
        # print(i, (i+3)**5 , (i+2)**5)
        print((i+3), -(i+2))
        break
    elif -(i+3)**5 - (i+2)**5 == X:
        # print(i, (i+3)**5 , (i+2)**5)
        print(-(i+3), (i+2))
        break
    elif -(i+3)**5 + (i+2)**5 == X:
        # print(i, (i+3)**5 , (i+2)**5)
        print(-(i+3), -(i+2))
        break

Submission status: Wrong Answer

Solution code:
import itertools

x = int(input())

y = itertools.combinations(range(-50,50), 2)
i = 0
for n in y:
    if (n[0]**5 - n[1]**5) == x:
        print(n[0], n[1])
        break
    elif (n[1]**5 - n[0]**5) == x:
        print(n[1], n[0])
        break
#print("miss")

Submission status: Wrong Answer

Solution code:
x=int(input())
for b in range(-10**2, 10**2, 1):
    a = (b**5+x)**(1/5)
    if type(a) is float:
        if a==a//1:
            break
print(int(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))
            break
        if (n-1)**5+i**5==x:
            print('{} {}'.format(n-1,-i))
            break