Problem:


Score : 400 points

Problem Statement

Give a pair of integers (A, B) such that A^5-B^5 = X.
It is guaranteed that there exists such a pair for the given integer X.

Constraints

1 \leq X \leq 10^9

X is an integer.

There exists a pair of integers (A, B) satisfying the condition in Problem Statement.

Input

Input is given from Standard Input in the following format:

X

Output

Print A and B, with space in between.
If there are multiple pairs of integers (A, B) satisfying the condition, you may print any of them.

A B

Sample Input 1

33

Sample Output 1

2 -1

For A=2 and B=-1, A^5-B^5 = 33.

Sample Input 2

1

Sample Output 2

0 -1



Sample input:
33


Sample output:
2 -1

Submission status: Wrong Answer

Solution code:
X = int(input())
N = int(X**(1/5))
ans = [0,0]
for i in range(N+1):
  for j in range(-N, i+1):
    if i**5-j**5==X:
      ans = [i, j]
ans = [str(i) for i in ans]
ans = ' '.join(ans)
print(ans)

Submission status: Wrong Answer

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

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
x = I()
for a in range(-105,105,1):
    for b in range(-105,105,1):
        if pow(a,5) - pow(b,5) == x:
            print(a,b)
            exit()

Submission status: Wrong Answer

Solution code:
def main():
    x = int(input())
    gojo = [int(i**5) for i in range(-1100, 1100)]
    for i, v1 in enumerate(gojo):
        for j, v2 in enumerate(gojo):
            if v1 - v2 == x:
                print(i, j)
                return


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
x = int(input())
for a in range(-118,120):
  for b in range(-119,119):
    if a**5-b**5==x:
      print(a,b)

Submission status: Wrong Answer

Solution code:
import sys

X = int(input())
a = [i for i in range(-10,101)]
b = [i for i in range(-10, 100)]

for i in a:
    for k in b:
        if i**5 == X + k**5:
            print(i,k)
            sys.exit()

Submission status: Wrong Answer

Solution code:
import sys

X = int(input())
a = [i for i in range(101)]
b = [i for i in range(-1, 100)]

for i in a:
    for k in b:
        if i**5 == X + k**5:
            print(i,k)
            sys.exit()

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x=int(input())
for i in range(-100,200):
  for j in range(-200,100):
    if x==(i**5-j**5):
      print(i,j)
      break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


def main():
    x = int(readline().rstrip())
    a, b, c = 1, 0, 1

    while a < 100:
        c = 1 if a ** 5 - x > 0 else - 1
        b = c * (c * (a ** 5 - x)) ** 0.2
        if b - int(b) == 0:
            print(a, int(b))
            return
        a += 1


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
from functools import lru_cache
from collections import defaultdict
inf = float('inf')
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**6)
def input(): return sys.stdin.readline().rstrip()
def read():
  return int(readline())
def reads():
  return map(int, readline().split())
x=read()
ls=[]
nums=10**3
ls2=[]
for i in range(nums+1):
  ls.append(i**5)
for i in range(nums,0,-1):
  ls.append(-i**5)
print(ls)
for i in range(nums+1):
  for j in range(-nums,i):
    #print(ls[i],ls[j])
    if ls[i]-ls[j]==x:
      print("{} {}".format(i,j))
      exit()

Submission status: Wrong Answer

Solution code:
X = int(input())
limit = int(X**0.2) + 1
for a in range(limit):
    b = -(X - a**5)**0.2
    if b.is_integer():
        print(a,int(b))
        break

Submission status: Wrong Answer

Solution code:
x = int(input())

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

Submission status: Wrong Answer

Solution code:
(X, ) = [int(n) for n in input().split()]

L = 0
while L ** 5 <= X * 2 + 1:
    L += 1

for i in range(L+1):
    for j in range(L+1):
        if i ** 5 - j ** 5 == X:
            print('{} {}'.format(i, j))
            exit()
        elif i ** 5 + j ** 5 == X:
            print('{} {}'.format(i, -j))
            exit()

Submission status: Wrong Answer

Solution code:
(X, ) = [int(n) for n in input().split()]

L = 0
while L ** 5 <= X:
    L += 1

for i in range(L+1):
    for j in range(L+1):
        if i ** 5 - j ** 5 == X:
            print('{} {}'.format(i, j))
            exit()
        elif i ** 5 + j ** 5 == X:
            print('{} {}'.format(i, -j))
            exit()

Submission status: Wrong Answer

Solution code:
x = int(input())
for i in range(1,101):
    for j in range(-100,201):
        if x == i**5-j**5:
            print(str(i)+" "+str(j))
            break
    else:
        continue
    break

Submission status: Wrong Answer

Solution code:
x = int(input())
print(x)
a = 0
b = 0
for i in range(500):
  for j in range(-500, 500):
    if i**5 - j**5 == x:
      a = i
      b = j
      break
print("{0} {1}".format(a, b))

Submission status: Wrong Answer

Solution code:
x = int(input())
print(x)
a = 0
b = 0
for i in range(1000):
  for j in range(-500, 500):
    if i**5 - j**5 == x:
      a = i
      b = j
      break

print(a, b)

Submission status: Wrong Answer

Solution code:
x = input()
print(x)
a = 0
b = 0
for i in range(1000):
  for j in range(-500, 500):
    if i**5 - j**5 == x:
      a = i
      b = j
      break


print(a, b)

Submission status: Wrong Answer

Solution code:
import math
import sys

X = int(input())
 
for i in range(100):
  for j in range(-100, 100):
    if math.pow(i, 5) - math.pow(j, 5) == X:
      print("%d %d" % (i, j))
      sys.exit()

Submission status: Wrong Answer

Solution code:
import math

X = int(input())

for i in range(-100, 100):
  for j in range(-100, 100):
    if	math.pow(i, 5) - math.pow(j, 5)	== X:
      print("%d %d" % (i, j))
      exit()

Submission status: Wrong Answer

Solution code:
x = int(input())

for i in range(10**99):
  tmp1 = (x + i**5)**0.2
  c = i**5 - x
  tmp2 = abs(c)
  
  if tmp1 == int(tmp1):
    a = tmp1
    b = i
    break
  if tmp2**0.2 == int(tmp2**0.2):
    a = i
    b = (-1) * (tmp2**0.2)
    break
    
print(int(a),int(b))

Submission status: Wrong Answer

Solution code:
x = int(input())

for i in range(10**10):
  tmp1 = (x + i**5)**0.2
  c = i**5 - x
  tmp2 = abs(c)
  
  if tmp1 == int(tmp1):
    a = tmp1
    b = i
    break
  if tmp2**0.2 == int(tmp2**0.2):
    a = i
    b = (-1) * (tmp2**0.2)
    break
    
print(int(a),int(b))

Submission status: Wrong Answer

Solution code:
import math
import sys
x=int(input())
for i in range(0,100):
    for j in range(-200,i):
        if i**5-j**5==x:
            print(i,j)
            sys.exit()

Submission status: Wrong Answer

Solution code:
import math
import sys
x=int(input())
for i in range(-100,100):
    for j in range(-100,i):
        if i**5-j**5==x:
            print(i,j)
            sys.exit()

Submission status: Wrong Answer

Solution code:
import math
import sys
x=int(input())
for i in range(0,100):
    for j in range(-100,i):
        if i**5-j**5==x:
            print(i,j)
            sys.exit()

Submission status: Wrong Answer

Solution code:
x = int(input())

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

Submission status: Wrong Answer

Solution code:
x = int(input())

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

Submission status: Wrong Answer

Solution code:
x = int(input())

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

Submission status: Wrong Answer

Solution code:
a=[i**5 for i in range(101)]
b=[i**5 for i in range(51)]
x=int(input())
k=0
for i in a:
  for j in b:
    if i - j == x:
      k = 1
      print(a.index(i),b.index(j))
      break
    if i + j ==x:
      k=1
      print(a.index(i),-b.index(j))
  if k==1:
    break

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

Solution code:
x = int(input())
d = 0
for a in range(-100,100):
  for b in range(-100,100):
      if(a**5 - b**5 == x):
        d = 1
        break
  if(d ==1):
    break
print(a,b)

Submission status: Wrong Answer

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

m = math.ceil((x / 2) ** (1 / 5))
M = int(x ** (1 / 5))
for i in range(m, M + 1):
    n = (x - i ** 5) ** (1 / 5)
    if n == int(n):
        print(str(int(i)) + ' ' + str(int(-n)))
        break

l = M
L = math.ceil((x / 5) ** (1 / 4) + 1)
for i in range(l + 1, L):
    n = (i ** 5 - x) ** (1 / 5)
    if n == int(n):
        print(str(int(i)) + ' ' + str(int(n)))
        break

Submission status: Wrong Answer

Solution code:
x = int(input())
a = [pow(i, 5) for i in range(-64, 65)]
flag = 0
for i in range(len(a)):
    for j in range(i+1, len(a)):
        if a[i] - a[j] == x:
            print(i-64, j-64)
            flag = 1
            break
        elif a[j] - a[i] == x:
            print(j-64, i-64)
            flag = 1
            break
    if flag == 1:
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
for a in range(-100,100):
  for b in range(-100,100):
    if(a**5 - b**5 == x ):
      print(a,b)
      break

Submission status: Wrong Answer

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

  i = 0
  while True:
    tmp = X + i**5
    tmp5 = tmp**0.2

    if abs(tmp5 - int(tmp5)) < 1e-8:
      print("{} {}".format(i, int(tmp5)))
      return 0

    if abs(tmp5 - int(-tmp5)) < 1e-8:
      print("{} {}".format(i, int(-tmp5)))
      return 0
    
if __name__ == '__main__':
  main()

Submission status: Wrong Answer

Solution code:
X=int(input())

A=0
B=0

while True:
    A=0
    while A**5<=X+B**5:
        if A**5==X+B**5:
            print(A,-1*B)
            exit()
        elif A**5==X-B**5:
            print(A,B)
            exit()
        A+=1
    B+=1

Submission status: Wrong Answer

Solution code:
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
x = int(input())
a = 0
b = 0
comp = 0
while comp == 0 :
    aa = a**5
    tmp = aa - x
    if tmp < 0:
        b = -(pow(-tmp,1/5))
    elif tmp == 0:
        b = 0
    else:
        b = pow(tmp,1/5)
    b = Decimal(str(b)).quantize(Decimal('0.00000001'), rounding=ROUND_HALF_UP)
    b = float(b)
    if b.is_integer():
        b = int(b)
        comp = 1
    if a <= 0:
        a = abs(a)+1
    else:
        a = -a
print(a,b)

Submission status: Wrong Answer

Solution code:

x = int(input())

a = 0
b = 0
comp = 0
# print('{:.2f}'.format(pow(3125,1/5)))
while comp == 0 :
    aa = a**5
    tmp = aa - x
    if tmp < 0:
        b = -(pow(-tmp,1/5))
        b = '{:.2f}'.format(b)
    elif tmp == 0:
        b = 0
    else:
        b = pow(tmp,1/5)
        b = '{:.2f}'.format(b)
    b = float(b)
    if b.is_integer():
        b = int(b)
        comp = 1
    else:
        a += 1
print(a,b)

Submission status: Wrong Answer

Solution code:

x = int(input())

a = 0
b = 0
comp = 0
while comp == 0 :
    aa = a**5
    tmp = aa - x
    if tmp < 0:
        b = -(pow(-tmp,1/5))
    elif tmp == 0:
        b = 0
    else:
        b = pow(tmp,1/5)
    if b.is_integer():
        b = int(b)
        comp = 1
    else:
        a += 1
print(a,b)

Submission status: Wrong Answer

Solution code:

from itertools import permutations

def power(base, exp):
  """ Fast power calculation using repeated squaring """
  if exp < 0:
      return 1 / power(base, -exp)
  ans = 1
  while exp:
      if exp & 1:
          ans *= base
      exp >>= 1
      base *= base
  return ans

def parse():
  return int(input())

def main():
  X = parse()

  A = None
  B = None

  # Z = [i for i in range(0, 5)]
  # print(Z)
  # print(list(permutations(range(0, 5), 2)))
  # print(list(permutations(range(0, 5), 2)))
  # exit(0)

  max_val = 10
  signs = [[1, 1], [-1, 1], [1, -1], [-1, -1]]

  for i in range(0, max_val + 1):
    for j in range(0, max_val + 1):
      for sign in signs:
        # A5 = 
        # print(i * sign[0], j * sign[1])
        if power(i * sign[0], 5) - power(j * sign[1], 5) == X:
          A = i * sign[0]
          B = j * sign[1]
          break

  print(A, B)

if __name__ == "__main__":
  main()

Submission status: Wrong Answer

Solution code:

from itertools import permutations

def power(base, exp):
  """ Fast power calculation using repeated squaring """
  if exp < 0:
      return 1 / power(base, -exp)
  ans = 1
  while exp:
      if exp & 1:
          ans *= base
      exp >>= 1
      base *= base
  return ans

def parse():
  return int(input())

def main():
  X = parse()

  A = None
  B = None

  # Z = [i for i in range(0, 5)]
  # print(Z)
  # print(list(permutations(range(0, 5), 2)))
  # print(list(permutations(range(0, 5), 2)))
  # exit(0)

  max_val = 5
  signs = [[1, 1], [-1, 1], [1, -1], [-1, -1]]

  for i in range(0, max_val + 1):
    for j in range(0, max_val + 1):
      for sign in signs:
        # A5 = 
        # print(i * sign[0], j * sign[1])
        if power(i * sign[0], 5) - power(j * sign[1], 5) == X:
          A = i
          B = j
          break

  print(A, B)

if __name__ == "__main__":
  main()

Submission status: Wrong Answer

Solution code:

from itertools import permutations

def power(base, exp):
  """ Fast power calculation using repeated squaring """
  if exp < 0:
      return 1 / power(base, -exp)
  ans = 1
  while exp:
      if exp & 1:
          ans *= base
      exp >>= 1
      base *= base
  return ans

def parse():
  return int(input())

def main():
  X = parse()

  A = None
  B = None

  # Z = [i for i in range(0, 5)]
  # print(Z)
  # print(list(permutations(range(0, 5), 2)))
  # print(list(permutations(range(0, 5), 2)))
  # exit(0)

  max_val = 2
  signs = [[1, 1], [-1, 1], [1, -1], [-1, -1]]

  for i in range(0, max_val + 1):
    for j in range(0, max_val + 1):
      for sign in signs:
        # A5 = 
        # print(i * sign[0], j * sign[1])
        if power(i * sign[0], 5) - power(j * sign[1], 5) == X:
          A = i
          B = j
          break

  print(A, B)

if __name__ == "__main__":
  main()

Submission status: Wrong Answer

Solution code:
import sys
INF = 10**9
sys.setrecursionlimit(INF)


def main():
    x, = map(int, open(0).read().split())

    """
    x=a^5-b^5=(a-b)(a^4+a^3b+a^2b^2+ab^3+b^4)
    x//(a-b)=int>0
    a-b>0
    """

    a = round(x**(1 / 5))
    x -= a**5
    # print(a, x)
    b = None
    for i in range(-a, a + 1):
        # print(i)
        if -i**5 == x:
            b = i
            break

    ans = f'{a} {b}'
    print(ans)
    return(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
x = int(input())
for a in range(-118,119):
    for b in range(-119,118):
        if x == a**5-b**5:
            break

print(a,b)

Submission status: Wrong Answer

Solution code:
X=int(input())

b=0
while not ((X+b**5)**(1/5)).is_integer():
    b+=1

a=(X+b**5)**(1/5)
print((X+b**5)**(1/5).is_integer())
print('{} {}'.format(int(a),b))

Submission status: Wrong Answer

Solution code:
X = int(input())
for A in range(-100, 100+1):
  for B in range(-100, 100+1):
    if A*A*A*A*A-B*B*B*B*B == X:
      print(A, B)
      exit()
print(-1)

Submission status: Wrong Answer

Solution code:
x = int(input())
resA = 0
resB = 0
for a in range(65):
  for b in range(-64,65):
    A = a**5
    B = b**5
    if A-B==x:
      resA = a
      resB = b
      break
    else:
      pass
  if A-B==x:
    break
print(resA,resB)

Submission status: Wrong Answer

Solution code:
x = int(input())
resA = 0
resB = 0
for a in range(101):
  for b in range(-100,101):
    A = a**5
    B = b**5
    if A-B==x:
      resA = a
      resB = b
      break
    else:
      pass
  if A-B==x:
    break
print(resA,resB)

Submission status: Wrong Answer

Solution code:
x = int(input())
a = 0
b = 0
resA = 0
resB = 0
for a in range(101):
  for b in range(-100,101):
    A = a**5
    B = b**5
    if A-B==x:
      break
    else:
      pass
  if A-B==x:
    resA = a
    resB = b
    break
print(resA,resB)

Submission status: Wrong Answer

Solution code:
x = int(input())
a = 0
b = 0
resA = 0
resB = 0
for a in range(101):
  for b in range(-101,101):
    A = a**5
    B = b**5
    if A-B==x:
      resA = a
      resB = b
      break
    else:
      pass
  
print(resA,resB)

Submission status: Wrong Answer

Solution code:
X = int(input())
for A in range(-120, 120):
    for B in range(-120, 120):
        if A**5 - B**5 == X:
            print(A, B)
            break

Submission status: Wrong Answer

Solution code:
from itertools import product
x = int(input())
A = [a ** 5 for a in range(-1000, 1001)]
for a, b in product(A, repeat = 2):
    if a - b == x:
        print('{} {}'.format(a, b))
        exit()

Submission status: Wrong Answer

Solution code:
import sys
from io import StringIO
import unittest


def resolve():

    # 問題の前提：1 <= X <= 10億。
    x = int(input())

    # 最下部で行った検証を基に処理を書く。
    # Aが取りうる範囲は・・0~119
    for a in range(120):
        # Bが取りうる範囲は・・0~118
        for b in range(a - 1):
            if pow(a, 5) - pow(b, 5) == x:
                print('{} {}'.format(a, b))
                return


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """33"""
        output = """2 -1"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """1"""
        output = """0 -1"""
        self.assertIO(input, output)

if __name__ == "__main__":

    # unittest.main()
    resolve()

    # (調査)
    # A+Bがいくら以上になる場合、10億を超えるか。(結果が10億を超えるパターンは検証不要)
    # が、例を見てわかるように、「A(40) + B(-39)」の様に、Bは負数にできる。
    # = Xは1以上なので-Aを超えることは無い。
    # なので、必要な情報は、「数値xの5乗 - 数値-(x-1)の5乗 >= 1億」を満たすタイミング。
    #  =>119。これが、ありえる最大パターン。(Aが119でBが-118というパターン)
    # Aが取りうる範囲は・・0~119  Bが取りうる範囲は・・-118~119
    #  =>このパターン数なら、全網羅できる。

    # for i in range(99999999):
    #     if pow(i, 5) + pow(-(i - 1), 5) >= 1000000000:
    #         print(i)
    #         pow(i, 5)
    #         break

Submission status: Wrong Answer

Solution code:
import sys
from io import StringIO
import unittest


def resolve():

    # 問題の前提：1 <= X <= 10億。
    x = int(input())

    # 最下部で行った検証を基に処理を書く。
    # Aが取りうる範囲は・・0~119
    for a in range(120):
        # Bが取りうる範囲は・・0~118
        for b in range(119):
            if pow(a, 5) - pow(b, 5) == x:
                print('{} {}'.format(a, b))
                return


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """33"""
        output = """2 -1"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """1"""
        output = """0 -1"""
        self.assertIO(input, output)

if __name__ == "__main__":

    # unittest.main()
    resolve()

    # (調査)
    # A+Bがいくら以上になる場合、10億を超えるか。(結果が10億を超えるパターンは検証不要)
    # が、例を見てわかるように、「A(40) + B(-39)」の様に、Bは負数にできる。
    # = Xは1以上なので-Aを超えることは無い。
    # なので、必要な情報は、「数値xの5乗 - 数値-(x-1)の5乗 >= 1億」を満たすタイミング。
    #  =>119。これが、ありえる最大パターン。(Aが119でBが-118というパターン)
    # Aが取りうる範囲は・・0~119  Bが取りうる範囲は・・-118~119
    #  =>このパターン数なら、全網羅できる。

    # for i in range(99999999):
    #     if pow(i, 5) + pow(-(i - 1), 5) >= 1000000000:
    #         print(i)
    #         pow(i, 5)
    #         break

Submission status: Wrong Answer

Solution code:
import sys
from io import StringIO
import unittest


def resolve():

    # 問題の前提：1 <= X <= 10億。
    x = int(input())

    # 最下部で行った検証を基に処理を書く。
    # Aが取りうる範囲は・・0~119
    for a in range(120):
        # Bが取りうる範囲は・・-118~119
        for b in range(-118, 120, 1):
            if pow(a, 5) + pow(b, 5) is x:
                print('{} {}'.format(a, b))
                return


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """33"""
        output = """2 -1"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """1"""
        output = """0 -1"""
        self.assertIO(input, output)

if __name__ == "__main__":

    # unittest.main()
    resolve()

    # (調査)
    # A+Bがいくら以上になる場合、10億を超えるか。(結果が10億を超えるパターンは検証不要)
    # が、例を見てわかるように、「A(40) + B(-39)」の様に、Bは負数にできる。
    # = Xは1以上なので-Aを超えることは無い。
    # なので、必要な情報は、「数値xの5乗 - 数値-(x-1)の5乗 >= 1億」を満たすタイミング。
    #  =>119。これが、ありえる最大パターン。(Aが119でBが-118というパターン)
    # Aが取りうる範囲は・・0~119  Bが取りうる範囲は・・-118~119
    #  =>このパターン数なら、全網羅できる。

    # for i in range(99999999):
    #     if pow(i, 5) + pow(-(i - 1), 5) >= 1000000000:
    #         print(i)
    #         pow(i, 5)
    #         break

Submission status: Wrong Answer

Solution code:
import sys
from io import StringIO
import unittest


def resolve():

    # 問題の前提：1 <= X <= 10億。
    x = int(input())

    # 最下部で行った検証を基に処理を書く。
    # Aが取りうる範囲は・・0~119
    for a in range(120):
        # Bが取りうる範囲は・・-118~119
        for b in range(-118,120,1):
            if pow(a, 5) + pow(b, 5) is x:
                print('{} {}'.format(a, b))
                return


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """33"""
        output = """2 -1"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """1"""
        output = """0 -1"""
        self.assertIO(input, output)

if __name__ == "__main__":

    # unittest.main()
    resolve()

    # (調査)
    # A+Bがいくら以上になる場合、10億を超えるか。(結果が10億を超えるパターンは検証不要)
    # が、例を見てわかるように、「A(40) + B(-39)」の様に、Bは負数にできる。
    # = Xは1以上なので-Aを超えることは無い。
    # なので、必要な情報は、「数値xの5乗 - 数値-(x-1)の5乗 >= 1億」を満たすタイミング。
    #  =>119。これが、ありえる最大パターン。(Aが119でBが-118というパターン)
    # Aが取りうる範囲は・・0~119  Bが取りうる範囲は・・-118~119
    #  =>このパターン数なら、全網羅できる。

    # for i in range(99999999):
    #     if pow(i, 5) + pow(-(i - 1), 5) >= 1000000000:
    #         print(i)
    #         pow(i, 5)
    #         break

Submission status: Wrong Answer

Solution code:
import sys
from io import StringIO
import unittest


def resolve():

    # 問題の前提：1 <= X <= 10億。
    x = int(input())

    # 最下部で行った検証を基に処理を書く。
    # Aが取りうる範囲は・・0~119
    for a in range(120):
        # Bが取りうる範囲は・・-118~119
        for b in range(-118,120,1):
            if pow(a,5) + pow(b,5) is x:
                print('{} {}'.format(a, b))



class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """33"""
        output = """2 -1"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """1"""
        output = """0 -1"""
        self.assertIO(input, output)

if __name__ == "__main__":

    # unittest.main()
    resolve()

    # (調査)
    # A+Bがいくら以上になる場合、10億を超えるか。(結果が10億を超えるパターンは検証不要)
    # が、例を見てわかるように、「A(40) + B(-39)」の様に、Bは負数にできる。
    # = Xは1以上なので-Aを超えることは無い。
    # なので、必要な情報は、「数値xの5乗 - 数値-(x-1)の5乗 >= 1億」を満たすタイミング。
    #  =>119。これが、ありえる最大パターン。(Aが119でBが-118というパターン)
    # Aが取りうる範囲は・・0~119  Bが取りうる範囲は・・-118~119
    #  =>このパターン数なら、全網羅できる。

    # for i in range(99999999):
    #     if pow(i, 5) + pow(-(i - 1), 5) >= 1000000000:
    #         print(i)
    #         pow(i, 5)
    #         break

Submission status: Wrong Answer

Solution code:
x=int(input())
for i in range(-70,71):
  for j in range(-70,71):
    if(pow(i,5)-pow(j,5)==x):
      print(i,j)
      exit()

Submission status: Wrong Answer

Solution code:
X = int(input())

for i in range(-200,200,1):
    for j in range(-200,200,1):
        if (i**5 - j**5) == X:
            print(str(i) + ' ' + str(j))
            break

Submission status: Wrong Answer

Solution code:
for i in range(120):
  print(i**5)

Submission status: Wrong Answer

Solution code:
X = input().split()
X = int(X[0])
ans = [0]*2

for i in range(-200,200):
    A5 = X+i**5

    if A5 < 0:
        ans[0] = -pow(-A5,0.2)
    else:
        ans[0] = pow(A5,0.2)

    if ans[0].is_integer():
        ans[0] = int(ans[0])
        ans[1] = i
        break

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

Submission status: Wrong Answer

Solution code:
X = input().split()
X = int(X[0])
ans = [0]*2

for i in range(200):
    A5 = X+i**5
    ans[0] = pow(A5,0.2)

    if ans[0].is_integer():
        ans[0] = int(ans[0])
        ans[1] = i
        break
    A5 = X-i**5
    if A5 < 0:
        ans[0] = -pow(-A5,0.2)
    else:
        ans[0] = pow(A5,0.2)

    if ans[0].is_integer():
        ans[0] = int(ans[0])
        ans[1] = -i
        break

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

Submission status: Wrong Answer

Solution code:
X = input().split()
X = int(X[0])
ans = [0]*2

for i in range(200):
    A5 = X+i**5
    ans[0] = pow(A5,0.2)

    if ans[0].is_integer():
        ans[0] = int(ans[0])
        ans[1] = int(i)
        break
    A5 = X-i**5
    if A5 < 0:
        ans[0] = -pow(-A5,0.2)
    else:
        ans[0] = pow(A5,0.2)

    if ans[0].is_integer():
        ans[0] = int(ans[0])
        ans[1] = -int(i)
        break

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

Submission status: Wrong Answer

Solution code:
X = int(input())

def solve():
    for A in range(-100, 101):
        for B in range(-100, 101):
            if (A**5)-(B**5)==X:
                print(A, B)
                return

solve()

Submission status: Wrong Answer

Solution code:
x = int(input())
i = -1
while (i + 1) ** 5 - i ** 5 < x:
    i += 1
    j = i
    while i ** 5 - j ** 5 < x:
        j -= 1
        #print(i, j)
        if i ** 5 - j ** 5 == 0:
            break
    else:
        continue
    break
if x == 1:
    print(1, 0)
else:
    print(i, j)

Submission status: Wrong Answer

Solution code:
X = int(input())

for A in range(-118, 120):
    for B in range(-119, 119):
        A5 = pow(A,5)
        B5 = pow(B,5)
        if( (A5-B5) == X):
            ans = (A,B)
            break

print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())

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

Submission status: Wrong Answer

Solution code:
n = int(input())
for a in range(-500,500):
    for b in range(-500, 500):
        if a**5 - b**5 == n:
            print(a, b)
            break;

Submission status: Wrong Answer

Solution code:
n = int(input())
for a in range(n):
    breaked = True
    for b in range(-500, 500):
        if a**5 - b**5 == n:
            print(a, b)
            break;

Submission status: Wrong Answer

Solution code:
x = int(input())


for i in range(120):
    if x>i**5:
        for j in range(-100,0):
            ans = i**5-j**5
            if ans == x:
                print("{} {}".format(i,j))
                exit()
    else:
        for j in range(i,120):
            ans = i**5-j**5
            if ans == x:
                print("{} {}".format(i,j))
                exit()

Submission status: Wrong Answer

Solution code:
x = int(input())
for a in range(-120,121):
  b5 = a**5-x
  b = abs(b5)**0.2*(b5//abs(b5))
  if b.is_integer():
    print(a,int(b))
    exit()

Submission status: Wrong Answer

Solution code:
import sys

readline = sys.stdin.readline
readlines = sys.stdin.readlines
ns = lambda: readline().rstrip() # input string
ni = lambda: int(readline().rstrip()) # input int
nm = lambda: map(int, readline().split()) # input multiple int 
nl = lambda: list(map(int, readline().split())) # input multiple int to list

x = ni()
tmp = 0
while True:
    add = (x + tmp ** 5) ** (1/5)
    sub = (x - tmp ** 5) ** (1/5)
    if add- round(add) < 10e-10:
        print(round(add), tmp)
        break
    if sub- round(sub) < 10e-10:
        print(round(sub), -tmp)
        break
    tmp += 1

Submission status: Wrong Answer

Solution code:
import sys

readline = sys.stdin.readline
readlines = sys.stdin.readlines
ns = lambda: readline().rstrip() # input string
ni = lambda: int(readline().rstrip()) # input int
nm = lambda: map(int, readline().split()) # input multiple int 
nl = lambda: list(map(int, readline().split())) # input multiple int to list

x = ni()
tmp = 0
while True:
    add = (x + tmp ** 5) ** (1/5)
    sub = (x - tmp ** 5) ** (1/5)
    if add- round(add) < 10e-6:
        print(round(add), tmp)
        break
    if sub- round(sub) < 10e-6:
        print(round(sub), -tmp)
        break
    tmp += 1

Submission status: Wrong Answer

Solution code:
x=int(input())

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

Submission status: Wrong Answer

Solution code:
X=int(input())
a=True
for A in range(118+119):
    if(a):
        for B in range(118+119):
            if((A-118)**5-(B-118)**5==X):
                print(A-118,B-118)
                a=False
                break