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 math
X = int(input())

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

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

Submission status: Wrong Answer

Solution code:
x = int(input())

c5 = []
iter5 = []
for i in range(-100, 100, 1): # 100
    c5.append(i**5)
    iter5.append(i)

a, b = 0, 0
for i in range(len(c5)):
    for j in range(len(c5)):
        if (c5[i] - c5[j]) == x:
            a, b = iter5[i], iter5[j]
            break

print(a,b)

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*len(str(X))):
            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())
i=0
while True:
    a=(i**5-x)
    if(a<0):
        a*=-1
        ans=a**(1/5)
        a*=-1
    else:
        ans=a**(1/5)
    if(int(ans)**5==a):
        print(i,int(a))
        break
    
    a=(i**5+x)
    if(a<0):
        a*=-1
        ans=a**(1/5)
        a*=-1
    else:
        ans=a**(1/5)
    if(int(ans)**5==a):
        print(int(a),i)
        break
    
    i+=1

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**9):
    b = abs((a**5 - x)**(1/5))
    #print(a, b, (b.is_integer()))

    if b.is_integer():
        b = int(b)
        if (a ** 5) - (-b ** 5) == x:
            print(a, -b)
        else:
            print(-a, b)

        break

Submission status: Wrong Answer

Solution code:
L=[0]*100
X=int(input())
for i in range(100):
  L[i]=pow(i,5)
for i in range(100):
  for j in range(100):
    if L[i]-L[j]==X:
      print(i,j)
      exit()
    if L[i]+L[j]==X:
      print(i,-j)
      exit()

Submission status: Wrong Answer

Solution code:
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))


def main():
    x = ii()

    if x == 1:
        print(0,-1)
        return
    xc = x
    ggg = []
    for i in range(10**9):

        for j in range(2,xc+1):
            if xc%j == 0:
                ggg.append(j)
                xc = xc//j
                break
            if j**2 > xc:
                ggg.append(xc)
                xc = 1
                break
        
        if xc == 1:
            break

    ll = len(ggg)
    idx_list = []
    for i in range(1,2**ll):
        idx = 1
        for j in range(ll):
            if (i >> j) & 1 == 1:
                idx *= ggg[j]

        idx_list.append(idx)
    idx_list2 = list(set(idx_list))

    for i in idx_list2:
        for j in range(10**9):
            b = -1 + j
            a = b+i
            clc = a**5 - b**5
            # print(a,b,clc)
            if clc == x:
                print(a,b)
                return
            if clc > x:
                break


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# D

x = int(input())

a = int(x**(1/5))
b = int(abs(x-a**5)**(1/5))

if a**5 + b**5 != x and a**5 + (-b)**5 != x:
    a = int(x**(1/5))+1
    b = int(abs(x-a**5)**(1/5))
    if a**5 + b**5 == x:
        print(a,b)
    else:
        print(a,-b)
        
elif a**5 + b**5 == x:
    print(a,b)

else:
    print(a,-b)

Submission status: Wrong Answer

Solution code:
try:
  x=int(input())
  for a in range(33):
      for b in range(33,-33,-1):
          if (a**5-b**5)==x:
              m,n=a,b
              break
  print(m,n)
except:
  pass

Submission status: Wrong Answer

Solution code:
import itertools
x=int(input())
if(x!=1):
    for m in itertools.count(2):
        if x%m==0:
            break
else:
    m=1

if(m!=1):
    a=m-1
    b=-1
if(m==1):
    a=0
    b=-1

print(a,b)

Submission status: Wrong Answer

Solution code:
# coding:utf-8
import itertools
x = int(input())
a = 0
b = 0
num_list = [i**5 for i in range(40, -39, -1)]
combi = list(itertools.combinations(num_list, 2))


for item in combi:
    # print(item)
    if item[0] - item[1] == x:
        #print(item[0], item[1])
        a = int(item[0] ** (1 / 5))
        b = int(item[1])
        break


print(a, b)

Submission status: Wrong Answer

Solution code:
import math
x=int(input())
end=0
for i in range(1,63):
    check1=int(math.pow( i+1, 5 )*100000)/100000
    check2=int(math.pow(i-1,5)*100000)/100000
    if check2<x<check1 :
        x=x-pow(i,5)
        if x<0:
            x=-x
            end=1
        b=int(math.pow(x,1/5)*100000)/100000
        out=int(b)
        if out<b<out+1:
            end=0
        if out==b:
            break
if end:
    out=-out
print(i,end=' ')
print(out)

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

# count
ans = [0, 0]
is_ok = False
for f in f_list:
    tmp_num = f_list[0][0] ** f_list[0][1]
    tmp_num_2 = X // tmp_num


    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
            is_ok = True
            break
    if is_ok:
        break

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

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 = A_val - X
    l = prime_factorize(val)
    if len(l) == 5 and len(set(l)) == 1:
        B = prime_factorize(val)
        print(A, B[0])
        break

    l = prime_factorize(-val)
    if len(l) == 5 and len(set(l)) == 1:
        B = prime_factorize(val)
        print(B[0], -A)
        break

Submission status: Wrong Answer

Solution code:
import sys

X = int(sys.stdin.readline())

temp = [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 i, x in enumerate(temp):
    if x >= X:
        for j, y in enumerate(temp):
            if x - y == X:
                print(i, j)
                exit()
        temp_x = temp[i-1]
        for j, y in enumerate(temp):
            if temp_x + y == X:
                print(i-1, -j)
                exit()

Submission status: Wrong Answer

Solution code:
#input
X = int(input())

#output
import math
left = 1
right = 10**2
while left + 1 < right:
    mid = (left + right)//2
    if mid **5  > X:
        right = mid
    else:
        left = mid

A = right
C = A**5 -X

if C >= 0:
    B = pow(C, 1/5)
else:
    B = -pow(-C, 1/5)

left2 = 1
right2 = A
while left + 1 < right:
    mid = (left + right)//2
    D = mid**5 - X
    E = pow(D, 1/5)
    if E.is_integer():
        right = mid
    else:
        left = mid

A = left
C = A**5 - X
if C >= 0:
    B = pow(C, 1/5)
else:
    B = -pow(-C, 1/5) 
print(A, int(B))

Submission status: Wrong Answer

Solution code:
x=int(input())
ans=ansb=0
f=False
m=int(pow(x,0.2))
for a in range(m):
  b=0
  while pow(a,5)-pow(b,5)>=x:
      if pow(a,5)-pow(b,5)!=x:
          b+=1
      else:
          ans=a
          ansb=b
          f=True
          break
  if f:
    break
else:
    f=False
    for a in range(m//2+1):
        for b in range(a,m//2+2):
            if pow(a,5)+pow(b,5)!=x:
                continue
            else:
                ans=a
                ansb=-b
                f=True
                break
        if f:
            break

print(ans,ansb)

Submission status: Wrong Answer

Solution code:
num = int(input())
a = 0
b = 0
for i in range(1, 65):
        for j in range(-i, i):
            if i**5 - j**5 == num:
                a = i
                b = j
print(str(a) + " " + str(b))

Submission status: Wrong Answer

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

for i in range(Y,100001):
    for j in range(101):
        if i**5 + j**5 ==X:
            x=max(i,j)
            y=min(i,j)
            print(x, y)
            exit()
        if i**5 - j**5 ==X:
            x=max(i,j)
            y=min(i,j)
            print(x, y)
            exit()

Submission status: Wrong Answer

Solution code:
X=int(input())
A=0
while True:
    if abs(X-(A**5))==1:
        print(A,1 if X-A==1 else -1)
        break
    A += 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 and chk == 1:
                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 and chk == 1:
                print(a, -b)
                chk = 0
                break
            a -= 1
            b += 1
        if chk == 0:
            break

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math

X = int(input())
A = int(X**(1/5)+0.5)
if A**5-X > 0:
	B = int(math.pow((A**5-X),float(1)/5))
elif A**5-X < 0:
	B = int(-math.pow(abs(A**5-X),float(1)/5))
else:
	B = 0
print(A, B)

Submission status: Wrong Answer

Solution code:
import itertools


max_num = 100
num_list = [i for i in range(-max_num,  max_num+1)]
num_list_5 = [i ** 5 for i in range(-max_num,  max_num+1)]
num_comb = list(itertools.combinations(num_list, 2))

x = int(input().strip())
for comb in num_comb:
    a = comb[0]
    b = comb[1]
    a5 = num_list_5[a]
    b5 = num_list_5[b]
    if a5 - b5 == x:
        print(num_list[a], num_list[b])
        break

Submission status: Wrong Answer

Solution code:
X = int(input())

for A in range(10**18):
    diff = X - A**5
    if diff < 0:
        minus_flg = False
        diff = abs(diff)
    else:
        minus_flg = True
    B = pow(diff, 0.2)
    if (isinstance(B, float)) and B.is_integer():
        break
if minus_flg:
    B = int(B)*-1
print(A, int(B))

Submission status: Wrong Answer

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

ary = []
for i in range(6000):
	y = i**5
	ary.append(y)
	ary.append(-y)
#print (ary)
ary2 = reversed(ary)
for i in ary2:
	for j in ary:
		if i-j == x:
			print (i,j)
			exit()

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}
    q_lis=list(q_lis)
    q_lis.sort()
    for q in 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=q
        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())
for i in range(1,1000):
    if i**5 == x:
        print(i,0)
        exit()
    if i**5 - (-1) == x:
        print(i,-1)
    if i**5 - 1 == x:
        print(i,1)

Submission status: Wrong Answer

Solution code:
import numpy
import math

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)

    return divisors

X = int(input())
lis = make_divisors(X)

for i in range(len(lis)):
    Y = lis[i]
    Z = X // Y
    tmp = numpy.roots([5, 10*Y, 10*pow(Y, 2), 5*pow(Y, 3), pow(Y, 4)-Z])
    ans = []
    for j in range(len(tmp)):
        if math.isclose(tmp[j].imag, 0):
            ans.append(int(tmp[j].real))
    if len(ans) == 2:
        break

print(' '.join(map(str, ans)))

Submission status: Wrong Answer

Solution code:
import math

x = int(input())

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

b = -(x - a ** 5)

f = False
if b < 0:
    b = -b
    f = True
    
for i in range(5):
    b = math.sqrt(b)

if f == True:
    b = -int(b)
print(a , b)

Submission status: Wrong Answer

Solution code:
def mapint_inp():
    return map(int, input().split())

def intinp():
    return int(input())

X = intinp()

dict_of_5th_p = dict()

i = 0
while True:
    i_5th_p = i**5
    if i_5th_p > X:
        break
    dict_of_5th_p[i] = i_5th_p
    i += 1

ans_A, ans_B = None, None

outf = False
for i in dict_of_5th_p:
    Cand_B = -(X - dict_of_5th_p[i])
    for j in dict_of_5th_p:
        if Cand_B == -(dict_of_5th_p[j]):
            ans_A = j
            ans_B = -i
            outf = True
            break
    if outf:
        break

print(ans_A, ans_B)

Submission status: Wrong Answer

Solution code:
x = int(input())
start = int(pow(x,0.5))
for i in range(-start,start+1):
    k = pow(x + pow(i,5),0.2)
    if type(k) != type(1+1j) and k == int(k):
        print(int(k),i)
        exit()

Submission status: Wrong Answer

Solution code:
N = int(input())
t = []
i=0
s=2
ans1 =0
ans2 =0
while (i**5<10**9):
    t.append(i**5)
    i+=1
for j in t:
    if(N + j) in t:
       ans1 = j
       ans2 = N + j
       s = 0
       break
    elif(N-j) in t:
        ans1 = -j
        ans2 = N - j
        s = 1
        break
if(s==0):
    ans3 = t.index(j) 
    ans4 = t.index(ans2)
else:
    ans3 = (t.index(j))*(-1)
    ans4 = t.index(ans2)
print(ans4,ans3)

Submission status: Wrong Answer

Solution code:
X = int(input())

for a in range(-100, 100):
  for b in range(-100, 100):
    #print(a,b)
    if a**5 - b**5 == X:
      print(a, b)
      exit()

Submission status: Wrong Answer

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

N=input()

#約数列挙
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)
    return divisors

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

L=make_divisors(N)

for yakusu in L:
    for a in range(N):
        b=a-yakusu
        ret=func(a,b)
        if ret==N:
            print a,b
            quit()
        elif N<ret:
            break

Submission status: Wrong Answer

Solution code:
import itertools


max_num = 70
num_list = [i for i in range(-max_num,  max_num+1)]
num_list_5 = [i ** 5 for i in range(-max_num,  max_num+1)]
num_comb = list(itertools.combinations(num_list, 2))

x = int(input().strip())
for comb in num_comb:
    a = comb[0]
    b = comb[1]
    a5 = num_list_5[a]
    b5 = num_list_5[b]
    if a5 - b5 == x:
        print(num_list[a], num_list[b])
        break

Submission status: Wrong Answer

Solution code:
X = int(input())
A = -1
Flg = True
while Flg:
    A += 1
    Y1 = X + A**5
    Z1 = Y1**(1/5)
    Y2 = X - A**5
    if Y2 > 0:
        Z2 = Y2**(1/5)
    else:
        Z2 = 0.5
    if Z1.is_integer():
        B = Z1
        Flg = False
    elif Z2.is_integer():
        B = -Z2
        Flg = False
    else:
        pass
print(int(A),int(B))

Submission status: Wrong Answer

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

def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct

def main():
    X = int(readline())
    if X == 1:
        print(0, -1)
        return
    fct = factorize(X)
    if len(fct) == 1:
        fct.append(1)
    f1 = fct[0]
    f2 = fct[1]
    ai = math.ceil(f1/2) - 2
    bi = ai - f1
    for i in range(X):
        if ai**4+ai**3*bi+ai**2*bi**2+ai*bi**3+bi**4 == f2:
            print(ai, bi)
            return
        ai += 1
        bi += 1


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

import sys
import math
import bisect

debug = False

def log(text):
    if debug:
        print(text)


def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        # for line in sys.stdin:
        #     lines.append(line)
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]
    
    (x, ) = [int(e) for e in lines[0].split(' ')]

    return (x, )


def solve(x):


    result = [0, 0]
    for a in range(-100, 101):
        for b in range(-100, 101):
            if a**5 - b**5 == x:
                result = [a, b]

    return result

def main():
    # 出力
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':
  
    main()

Submission status: Wrong Answer

Solution code:
kai = int(input())
for x in range(-1000,kai):
    for y in range(-1000,kai):
        if x**5 - y**5 == kai:
            print(x,y)

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(min(prime)):
	a=i
	b=a-prime[0]
	if x==a**5-b**5:
		print(a,b)
		break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X=int(input())
l=[]
for y in range(1,X//2+2):
	if X%y==0:
		l.append(y)
K=len(l)
A=-1
for y in range(0,K):
	KKK=0
	A=0
	while KKK<X:
		A=A+1
		KKK=A**5-(A-l[y])**5
	if KKK==X:
		print(A,A-l[y])
		break

Submission status: Wrong Answer

Solution code:
# Code for D - I hate Factorization
# Use input() to fetch data from STDIN
import sys

LIMIT = 10 ** 9
X = int(input())
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

divs = make_divisors(X)
for div in divs:
    x = X / div
    for a in range(1, LIMIT):
        b = a - div
        t = (a ** 4 + (a ** 3) * b + (a ** 2) * (b ** 2) + a * (b ** 3) + b ** 4)
        if t > x or t <= 0:
            break

        if t == x:
            print(a, b)
            sys.exit()

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 = 64  # int(pow(X, 1/5))+1
    nums = []
    for i in range(digit+1):
        num = i**5
        nums.append((i, num))
        nums.append((-1*i,-1*num))

    for a in nums:
        for b in nums:
            if a[1] - b[1] == X:
                print(a[0], b[0])
                exit()

Submission status: Wrong Answer

Solution code:
X = int(input())

for A in range(10**9):
    diff = X - A**5
    if diff < 0:
        minus_flg = False
        diff = abs(diff)
    else:
        minus_flg = True
    B = pow(diff, 0.2)
    if (isinstance(B, float)) and B.is_integer():
        break
if minus_flg:
    B = int(B)*-1
print(A, int(B))

Submission status: Wrong Answer

Solution code:
x = int(input())

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)

    return divisors
    
div = make_divisors(x)

for c in div:
    if (c-1)**5 + 1 == x:
        print(c-1, -1)

Submission status: Wrong Answer

Solution code:
def main():
    X=int(input())
    for x in range(-100,100):
        for y in range(-100,100):
            if x**5-y**5 == X:
                print(x,y)
                exit()
main()

Submission status: Wrong Answer

Solution code:
import sys
X = int(input())
b = 0
if X**(1/5) == int(X**(1/5)):
    print("{0} {1}".format(int(X**(1/5)),0))
    sys.exit(0)
b = 1
if (X+1)**(1/5) == int((X+1)**(1/5)):
    print("{0} {1}".format(int((X+1)**(1/5)),1))
    sys.exit(0)
b = -1
if (X-1)**(1/5) == int((X-1)**(1/5)):
    print("{0} {1}".format(int((X-1)**(1/5)),-1))
    sys.exit(0)

Submission status: Wrong Answer

Solution code:
import math
import sys

x = int(input())

for i in range(1, int((10**9)/2)+1):
    if x-i**5 < 0.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:
from itertools import combinations_with_replacement
#a, b = list(map(int, input().split(" ")))
x = int(input())

fivelist = dict()
for i in range(-100, 100):
    fivelist[i] = i**5

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