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:
from __future__ import division, print_function
import sys
if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

import os, sys, bisect, copy
from collections import defaultdict, Counter, deque
#from functools import lru_cache   #use @lru_cache(None)
if os.path.exists('in.txt'): sys.stdin=open('in.txt','r')
if os.path.exists('out.txt'): sys.stdout=open('out.txt', 'w')
#
def input(): return sys.stdin.readline()
def mapi(arg=0): return map(int if arg==0 else str,input().split())
#------------------------------------------------------------------
x = int(input())
def power(x,y):
    res = 1
    #print(x,y)
    while y>0:
        if y%2:
            res*=x
        x*=x
        y//=2
        #print(x,y)
    return res
def bs(n):
    l = -250
    r = n+1
    while r-l>1:
        mid = (l+r)>>1
        tmp = power(mid,5)
        if tmp==n:
            return True, mid
        elif tmp<n:
            #print(mid,tmp,n)
            l = mid
        else:
            r = mid
    if power(l,5)==n:
        return True,l
    elif power(r,5)==n:
        return True,r
    return False,0
for i in range(-250,250):
    key = power(i,5)-x
    f,b = bs(key)
    if f:
        print(i,b)
        break

Submission status: Wrong Answer

Solution code:
from __future__ import division, print_function
import sys
if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

import os, sys, bisect, copy
from collections import defaultdict, Counter, deque
#from functools import lru_cache   #use @lru_cache(None)
if os.path.exists('in.txt'): sys.stdin=open('in.txt','r')
if os.path.exists('out.txt'): sys.stdout=open('out.txt', 'w')
#
def input(): return sys.stdin.readline()
def mapi(arg=0): return map(int if arg==0 else str,input().split())
#------------------------------------------------------------------
x = int(input())
def power(x,y):
    res = 1
    #print(x,y)
    while y>0:
        if y%2:
            res*=x
        x*=x
        y//=2
        #print(x,y)
    return res
def bs(n):
    l = -1000
    r = n+1
    while r-l>0:
        mid = (l+r)>>1
        tmp = power(mid,5)
        if tmp==n:
            return True, mid
        elif tmp<n:
            #print(mid,tmp,n)
            l = mid+1
        else:
            r = mid
    if power(l,5)==n:
        return True,l
    elif power(r,5)==n:
        return True,r
    return False,0
for i in range(-1000,1000):
    key = power(i,5)-x
    f,b = bs(key)
    if f:
        print(i,b)
        break

Submission status: Wrong Answer

Solution code:
from __future__ import division, print_function
import sys
if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

import os, sys, bisect, copy
from collections import defaultdict, Counter, deque
#from functools import lru_cache   #use @lru_cache(None)
if os.path.exists('in.txt'): sys.stdin=open('in.txt','r')
if os.path.exists('out.txt'): sys.stdout=open('out.txt', 'w')
#
def input(): return sys.stdin.readline()
def mapi(arg=0): return map(int if arg==0 else str,input().split())
#------------------------------------------------------------------

x = int(input())
def power(x,y):
    res = 1
    #print(x,y)
    while y>0:
        if y%2:
            res*=x
        x*=x
        y//=2
        #print(x,y)
    return res
def bs(n):
    l = -1000
    r = n
    while r-l>=0:
        mid = (l+r)>>1
        tmp = power(mid,5)
        if tmp==n:
            return True, mid
        elif tmp<n:
            #print(mid,tmp,n)
            l = mid+1
        else:
            r = mid-1
    if power(l,5)==n:
        return True,l
    elif power(r,5)==n:
        return True,r
    return False,0
for i in range(-1000,1000):
    key = power(i,5)-x
    f,b = bs(key)
    if f:
        print(i,b)
        break

Submission status: Wrong Answer

Solution code:
from __future__ import division, print_function
import sys
if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

import os, sys, bisect, copy
from collections import defaultdict, Counter, deque
#from functools import lru_cache   #use @lru_cache(None)
if os.path.exists('in.txt'): sys.stdin=open('in.txt','r')
if os.path.exists('out.txt'): sys.stdout=open('out.txt', 'w')
#
def input(): return sys.stdin.readline()
def mapi(arg=0): return map(int if arg==0 else str,input().split())
#------------------------------------------------------------------

x = int(input())
def power(x,y):
    res = 1
    #print(x,y)
    while y>0:
        if y%2:
            res*=x
        x*=x
        y//=2
        #print(x,y)
    return res
def bs(n):
    l = -1000
    r = n
    while r-l>=0:
        mid = (l+r)>>1
        tmp = power(mid,5)
        if tmp==n:
            return True, mid
        elif tmp<n:
            #print(mid,tmp,n)
            l = mid+1
        else:
            r = mid-1
    if power(l,5)==n:
        return True,l
    return False,0
for i in range(-1000,1000):
    key = power(i,5)-x
    f,b = bs(key)
    if f:
        print(i,b)
        break

Submission status: Wrong Answer

Solution code:
from __future__ import division, print_function
import sys
if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

import os, sys, bisect, copy
from collections import defaultdict, Counter, deque
#from functools import lru_cache   #use @lru_cache(None)
if os.path.exists('in.txt'): sys.stdin=open('in.txt','r')
if os.path.exists('out.txt'): sys.stdout=open('out.txt', 'w')
#
def input(): return sys.stdin.readline()
def mapi(arg=0): return map(int if arg==0 else str,input().split())
#------------------------------------------------------------------

x = int(input())
def power(x,y):
    res = 1
    #print(x,y)
    while y>0:
        if y%2:
            res*=x
        x*=x
        y//=2
        #print(x,y)
    return res
def bs(n):
    l = -1000
    r = n
    while r-l>0:
        mid = (l+r)>>1
        tmp = power(mid,5)
        if tmp==n:
            return True, mid
        elif tmp<n:
            #print(mid,tmp,n)
            l = mid+1
        else:
            r = mid-1
    if power(l,5)==n:
        return True,l
    return False,0
for i in range(-1000,1000):
    key = power(i,5)-x
    f,b = bs(key)
    if f:
        print(i,b)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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

x=int(input())
LISt=(make_divisors(x))
maX=max(LISt)
n=len(LISt)
import sys

for i in range(1000):
  for j in range(n):
    b=-LISt[j]+i
    if i**5-b**5==x:
      print(i,b)
      break
    break 
  break

Submission status: Wrong Answer

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

l = [i for i in range(-100, 100)]
c = itertools.permutations(l, 2)
for a, b in c:
    if a**5 - b**5 == X:
        print(a, b)
        break

Submission status: Wrong Answer

Solution code:
X = int(input())
A = 0
for a in range(10000):
    if a ** 5 <= X < (a+1) ** 5:
        A = a
        break
for b in range(-10000, 10000):
    if A ** 5 - b ** 5 == X:
        print(A, b)
        break

Submission status: Wrong Answer

Solution code:
X = int(input())
A = 0
for a in range(100):
    if a ** 5 <= X < (a+1) ** 5:
        A = a
        break
for b in range(-100, 100):
    if A ** 5 - b ** 5 == X:
        print(A, b)
        break

Submission status: Wrong Answer

Solution code:
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
import math
x=int(input())
LISt=(make_divisors(x))
n=len(LISt)
kiri=math.floor(x**(1/5))
for i in range(kiri):
  for j in range(n):
    b=-LISt[j]+i
    if i**5-b**5==x:
      print(i,b)
      break

Submission status: Wrong Answer

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

def main():
    x = int(input())
    for i in range(-100, 100):
        for j in range(-200, 200):
            if x == i**5 - j**5:
                print(i, j)
                break
        else:
            continue
        break

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

def main():
    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
        else:
            continue
        break

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
x = int(input())
k = 1
while True:
    if k ** 5 - (k-1) ** 5 > x:
        break
    k += 1
print(k)
for a in range(k):
    amari = x - a ** 5
    for b in range(a+1):
        if amari == b ** 5:
            print(a, -b)
            break
        if amari == (-b) ** 5:
            print(a, b)
            break

Submission status: Wrong Answer

Solution code:
N = input()
a = [i**5 for i in range(120)]
for i in range(120):
  for j in range(i + 1, 120):
    if a[j] - a[i] == N:
      print(j, i)
      break
    if a[j] + a[i] == N:
      print(j, -i)
      break
    else:
      continue
    break

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

from typing import Iterable


def calc(a: int, b: int) -> int:
    return a ** 5 - b ** 5


def fifthroot(i: int) -> int:
    return int(pow(i, 1 / 5))


def search_b(x, a) -> (bool, int):
    b = int(pow(abs(a ** 5 - x), 1 / 5))
    if x == a ** 5 - b ** 5:
        return True, b
    elif x == a ** 5 + b ** 5:
        return True, -b
    else:
        return False, 0


def main() -> None:
    X = ri()
    predict = fifthroot(X)
    for a in range(predict - 100, predict + 100):
        success, b = search_b(X, a)
        if success:
            break
    w((a, b))


def r() -> str:
    return input().strip()


def ri() -> int:
    return int(r())


def rmi(delim: str = ' ') -> int:
    return tuple(map(int, input().split(delim)))


def w(data) -> None:
    print(data)


def wm(data: Iterable) -> None:
    print(' '.join(data))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
x = int(input())
import sys
for a in range(5000):
  for b in range(5000):
    if (a ** 5 - b ** 5) == x:
      print(str(a)+" "+str(b))
      sys.exit()
    elif(a ** 5 - (-b) ** 5) == x:
      print(str(a)+" "+str(-b))
      sys.exit()
    elif((-a) ** 5 - b ** 5) == x:
      print(str(a)+" "+str(-b))
      sys.exit()
    elif((-a) ** 5 - (-b) ** 5) == x:
      print(str(a)+" "+str(-b))
      sys.exit()

Submission status: Wrong Answer

Solution code:
x = int(input())
import sys
for a in range(1000):
  for b in range(1000):
    if (a ** 5 - b ** 5) == x:
      print(str(a)+" "+str(b))
      sys.exit()
    elif(a ** 5 - (-b) ** 5) == x:
      print(str(a)+" "+str(-b))
      sys.exit()
    elif((-a) ** 5 - b ** 5) == x:
      print(str(a)+" "+str(-b))
      sys.exit()
    elif((-a) ** 5 - (-b) ** 5) == x:
      print(str(a)+" "+str(-b))
      sys.exit()

Submission status: Wrong Answer

Solution code:
x = int(input())
import sys
for a in range(10000):
  for b in range(10000):
    if (a ** 5 - b ** 5) == x:
      print(str(a)+" "+str(b))
      sys.exit()
    elif(a ** 5 - (-b) ** 5) == x:
      print(str(a)+" "+str(-b))
      sys.exit()
    elif((-a) ** 5 - b ** 5) == x:
      print(str(a)+" "+str(-b))
      sys.exit()
    elif((-a) ** 5 - (-b) ** 5) == x:
      print(str(a)+" "+str(-b))
      sys.exit()

Submission status: Wrong Answer

Solution code:
def main():
    l_a=[]
    for i in range(-64,65):
        l_a.append(i**5)
    l_b = l_a
    ans = int(input())
    #print(l_a)
    A=0
    B=0
    for num_a, i in enumerate(l_a):
        for num_b, j in enumerate(l_b):
            if i - j == ans:
                A = num_a - 64
                B = num_b - 64
    print(A,B)
main()

Submission status: Wrong Answer

Solution code:
x = int(input())

for i in range(0, 120):
  for j in range(-119, 120):
    if (i**5 + j**5) == x:
      print(i,j, sep = " ")
      exit()

Submission status: Wrong Answer

Solution code:
x = int(input())

for i in range(0, 120):
  for j in range(-119, 120):
    if (i**5 + j**5) == x:
      print(i,j)
      exit()

Submission status: Wrong Answer

Solution code:
try:
    X = int(input())
    A = 0
    B = 0
    while B > -10**9:
        A = X + B**5
        if pow(A,0.2) - int(pow(A,0.2)) == 0:
            print(int(pow(A,0.2)), B)
            break
        B -= 1
    if pow(A,0.2) - int(pow(A,0.2)) != 0:
        B = 0
        while B < 10**9:
            A = X + B**5
            if pow(A,0.2) - int(pow(A,0.2)) == 0:
                print(int(pow(A,0.2)), B)
                break
            B += 1
except:
    pass

Submission status: Wrong Answer

Solution code:
X = int(input())
 
N = int(X**0.2)
A,B=0,0
for n1 in range(-N,N):
  for n2 in range(-N,N):
    S = n1**5 - n2**5
    if S == X:
      A=n1
      B=n2
      
print(A,B)

Submission status: Wrong Answer

Solution code:
x = int(input())

a = 0
b = -1

while True:
    a5 = pow(a, 5)
    b5 = pow(b, 5)
    print("{} {}".format(a, b))
    if(a5-b5 == x):
        print("{} {}".format(a, b))
        break
    if(a5+b5 == x):
        print("{} {}".format(a, -b))
        break
    if(-a5-b5 == x):
        print("{} {}".format(-a, b))
        break
    if(-a5+b5 == x):
        print("{} {}".format(-a, -b))
        break

    b += 1
    if(a==b-1):
        a +=1
        b =0

Submission status: Wrong Answer

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

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 q4():
    X = int(input())
    for i in range(-65, 65):
        for j in range(-65, 65):
            if i**5 - j**5 == X:
                print(i, j)
                return


if __name__ == '__main__':
    q4()

Submission status: Wrong Answer

Solution code:
def q4():
    X = int(input())
    for i in range(65):
        for j in range(-65, 65):
            if i**5 - j**5 == X:
                print(i, j)
                return

              
if __name__ == '__main__':
    q4()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import re
import math
import collections
import decimal
import bisect

# import copy
# import heapq
# from collections import deque
# import decimal

# sys.setrecursionlimit(100001)
INF = sys.maxsize
# MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===


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




if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
import re
import math
import collections
import decimal
import bisect

# import copy
# import heapq
# from collections import deque
# import decimal

# sys.setrecursionlimit(100001)
INF = sys.maxsize
# MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===


def main():
    x = ni()
    pent = [0]

    cnt = 1
    while True:
        pent.append(cnt**5)
        pent.append((-cnt)**5)
        cnt+=1
        if cnt > 200:
            break

    for i in range(len(pent)):
        for j in range(len(pent)):
            if pent[i] - pent[j] == x:
                ans_i = ((i+1)//2)*((-1)**((i+1) % 2))
                ans_j = ((j+1)//2)*((-1)**((j+1) % 2))
                print(ans_i,ans_j)




if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
import re
import math
import collections
import decimal
import bisect

# import copy
# import heapq
# from collections import deque
# import decimal

# sys.setrecursionlimit(100001)
INF = sys.maxsize
# MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===


def main():
    x = ni()
    pent = [0]

    cnt = 1
    while True:
        pent.append(cnt**5)
        pent.append((-cnt)**5)
        cnt+=1
        if pent[-2] + pent[-3] > 10**9:
            break

    for i in range(len(pent)):
        for j in range(len(pent)):
            if pent[i] - pent[j] == x:
                ans_i = ((i+1)//2)*((-1)**((i+1) % 2))
                ans_j = ((j+1)//2)*((-1)**((j+1) % 2))
                print(ans_i,ans_j)




if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def do():
    x=int(input())
    # x1=math.sqrt(x)
    # print(math.sqrt(x1))
    for i in range(int(x+1)):
        for j in range(int(x+1)):
            if (i**5)-(j**5)==x:
                return i,j
            elif (i**5)+(j**5)==x:
                return i,-j
            elif -(i**5)+(j**5)==x:
                return -i,-j
            elif -(i**5)-(j**5)==x:
                return -i,j
            # print((i ** 5) - (j ** 5))



print(do())

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    X = int(input())
    for a in range(-500, 501):
        for b in range(-500, 501):
            if a**2 - b**2 == X:
                print(a, b)
                return


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
X = int(input())
cc = []

loopf =0
for i in range(-100,100):
    for j in range(-100,100):
        if i**5 - j**5 == X:
            cc.append(str(i))
            cc.append(str(j))
            loopf +=1
        if loopf == 1:
            break
print(" ".join(cc))

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect

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


def I(): return int(sys.stdin.readline())


def LS(): return [list(x) for x in sys.stdin.readline().split()]


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]


def LIR(n):
    return [LI() for i in range(n)]


def SR(n):
    return [S() for i in range(n)]


def LSR(n):
    return [LS() for i in range(n)]


sys.setrecursionlimit(1000000)
mod = 1000000007


def solve():
    x = I()
    li = [i ** 5 for i in range(120)]
    m = bisect.bisect(li, x)
    if x == 1:
        a = '0'
        b = '-1'
    elif li[m] - x > x - li[m-1]:
        a = m - 1
        b = int((x - li[a]) ** (1/5)) * -1
    else:
        a = m
        b = int((li[a] - x) ** (1/5))
    print(a,b)
    return


if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect

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


def I(): return int(sys.stdin.readline())


def LS(): return [list(x) for x in sys.stdin.readline().split()]


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]


def LIR(n):
    return [LI() for i in range(n)]


def SR(n):
    return [S() for i in range(n)]


def LSR(n):
    return [LS() for i in range(n)]


sys.setrecursionlimit(1000000)
mod = 1000000007


def solve():
    x = I()
    li = [i ** 5 for i in range(64)]
    m = bisect.bisect(li, x)
    if x == 1:
        a = '0'
        b = '-1'
    elif li[m] - x > x - li[m-1]:
        a = m - 1
        b = int((x - li[a]) ** (1/5)) * -1
    else:
        a = m
        b = int((li[a] - x) ** (1/5))
    print(a,b)
    return


if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect

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


def I(): return int(sys.stdin.readline())


def LS(): return [list(x) for x in sys.stdin.readline().split()]


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]


def LIR(n):
    return [LI() for i in range(n)]


def SR(n):
    return [S() for i in range(n)]


def LSR(n):
    return [LS() for i in range(n)]


sys.setrecursionlimit(1000000)
mod = 1000000007


def solve():
    x = I()
    li = [i ** 5 for i in range(64)]
    m = bisect.bisect(li, x)
    print(li[m])
    if x == 1:
        a = '0'
        b = '-1'
    elif li[m] - x > x - li[m-1]:
        print('a5 - -b5')
        a = m - 1
        b = int((x - li[a]) ** (1/5)) * -1
    else:
        print('a5 - b5')
        a = m
        b = int((li[a] - x) ** (1/5))
    print(a,b)
    return


if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect

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


def I(): return int(sys.stdin.readline())


def LS(): return [list(x) for x in sys.stdin.readline().split()]


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]


def LIR(n):
    return [LI() for i in range(n)]


def SR(n):
    return [S() for i in range(n)]


def LSR(n):
    return [LS() for i in range(n)]


sys.setrecursionlimit(1000000)
mod = 1000000007


def solve():
    x = I()
    li = [i ** 5 for i in range(64)]
    a = bisect.bisect_left(li, x) - 1
    b = int((x - a**5) ** (1/5)) * -1
    print(a,b)
    return


if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect

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


def I(): return int(sys.stdin.readline())


def LS(): return [list(x) for x in sys.stdin.readline().split()]


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]


def LIR(n):
    return [LI() for i in range(n)]


def SR(n):
    return [S() for i in range(n)]


def LSR(n):
    return [LS() for i in range(n)]


sys.setrecursionlimit(1000000)
mod = 1000000007


def solve():
    x = I()
    if x == 1:
        print('0', '-1')
    else:
        a = x**(1/5)
        print(int(a), '-1')
    return


if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

Solution code:
import math
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
divisors_list = make_divisors(x)
T = 0
for i in range(len(divisors_list)):
    for j in range(5000):
        temp = abs((divisors_list[i]+j-2500)**5-(j-2500)**5)
        if temp==x:
            T = 1
            ansl = [(divisors_list[i]+j-2500),(-j+2500)]
            break
    if T == 1:
        break
if ansl[0]**5-ansl[1]**5==x:
    print(ansl[0],ansl[1])
else:
    print(ansl[1],ansl[0])

Submission status: Wrong Answer

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

b=0
while(True):
    bi=b**5
    ai=x+bi
#    print(ai,bi,(ai**(1/5))%1.0)
    #X-B^5 は整数を５乗した数か判定
    if(int((ai**(1/5))%1.0) == 0):

        aj=int((ai**(1/5))//1)
#        print(ai,aj,bi,b)
        if((aj**5)==ai):
            print(aj,b)
            break
        b*=-1

        bi=b**5
        ai=abs(x+bi)

        if(int((ai**(1/5))%1.0) == 0):
            aj=int((ai**(1/5))//1)
#            print(ai,aj,bi,b)
            if((aj**5)==ai):
                print(-1*aj,b)
                break
        b*=-1

    b+=1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
flg = False
for i in range(1, int(x**0.5)+1):
  if flg:
    break
  if x % i == 0:
    a = 0
    b = a - i
    before_cnt = 10**20
    while True:
      cnt = a**5 - b**5
      if cnt == x:
        flg = True
        print(a, b)
        break
      else:
        if before_cnt < cnt:
          break
        else:
          a += 1
          b += 1
          before_cnt = cnt

Submission status: Wrong Answer

Solution code:
x = int(input())
flg = False
for i in range(1, int(x**0.5)+1):
  if flg:
    break
  if x % i == 0:
    a = 0
    b = a - i
    while True:
      cnt = a**5 - b**5
      if cnt == x:
        flg = True
        print(a, b)
        break
      elif cnt < x:
        a += 1
        b = a - i
      elif cnt > x:
        break

Submission status: Wrong Answer

Solution code:
x=int(input())

L=[0]*101
for i in range(1,101):
    ii=i**2
    iii=ii**2
    L[i]=i*iii

ans="ERROR"

for j in range(101):
    a=L[j]
    if x-a in L:
        ans=[int(a**0.2),int(-((x-a)**0.2))]
    elif a-x in L:
        ans=[int(a**0.2),int((a-x)**0.2)]
    else:
        pass

print(*ans)

Submission status: Wrong Answer

Solution code:
import math
import sys

# print(math.pow(10**9,1/5))

x = int(input())

maxn = 70
for a in range(maxn):
    for b in range(a+1,maxn):
        if b**5 - a**5 == x:
            print(b,a)
            sys.exit()
        elif a**5 + b**5 == x:
            print(a,-1*b)
            sys.exit()

Submission status: Wrong Answer

Solution code:
import math
import sys

x = int(input())

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

Submission status: Wrong Answer

Solution code:
import math
import sys

# print(math.pow(10**9,1/5))

x = int(input())

for a in range(64):
    for b in range(64):
        if a**5 - b**5 == x:
            print(a,b)
            sys.exit()
        elif a**5 + b**5 == x:
            print(a,-1*b)
            sys.exit()

Submission status: Wrong Answer

Solution code:
def primes(N):
    p = [False, False] + [True] * (N - 1)
    for i in range(2, int(N ** 0.5) + 1):
        if p[i]:
            for j in range(i * 2, N + 1, i):
                p[j] = False
    return [i for i in range(N + 1) if p[i]]


def prime_factors(N):
    ret = []
    for p in primes(int(N ** 0.5) + 1):
        while N % p == 0:
            ret.append(p)
            N //= p
    if N > 1:
        ret.append(N)
    return ret


X = int(input())
Xp = prime_factors(X) + [1]
for xp in Xp:
    for i in range(-100000, 100000):
        A, B = i + xp, i
        if A ** 5 - B ** 5 == X:
            print(A, B)
            exit()
        elif B ** 5 - A ** 5 == X:
            print(B, A)
            exit()

Submission status: Wrong Answer

Solution code:
x = int(input())
f = [i**5 for i in range(64)]

for i in range(64):
    for j in range(64):
        if f[i] - f[j] == x:
            print(i,end=' ')
            print(j)
            exit()
        if f[i] + f[j] == x:
            print(i,end=' ')
            print(-j)
            exit()

Submission status: Wrong Answer

Solution code:
x=int(input())
def f(a,p):
    return 5*a**4+10*(a**3)*p+10*(a**2)*(p**2)+5*a*(p**3)+p**4
for i in range(1,x+1):
    if i*i>x:
        break
    if x%i==0:
        p=i;q=x//i
        for b in range(-100,100):
            if f(b,p)==q:
                print(b+p,b)
                exit(0)
        p=-1*i;q=(-1)*(x//i)
        for b in range(-100,100):
            if f(b,p)==q:
                print(b,b+p)
                exit(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x=int(input())
def f(a,p):
    return 5*a**4+10*(a**3)*p+10*(a**2)*(p**2)+5*a*(p**3)+p**4
for i in range(1,x+1):
    if i*i>x:
        break
    if x%i==0:
        p=i;q=x//i
        for b in range(-100,100):
            if f(b,p)==q:
                print(b,b+p)
                exit(0)
        p=-1*i;q=(-1)*(x//i)
        for b in range(-100,100):
            if f(b,p)==q:
                print(b,b+p)
                exit(0)

Submission status: Wrong Answer

Solution code:
x =int(input())
a =[i**5 for i in range(120)]
for i in range(120):
    for j in range(120):
        if a[i] -a[j] ==x:
            print(j,i)
            break
        elif a[j] -a[i] ==x:
            print(i,j)
            break
    else:
        continue
    break

Submission status: Wrong Answer

Solution code:
x = int(input())
a = x - 1
for i in range(0, a + 1):
    if pow(i, 5) == a:
        print(str(i) + " " + "-1")

Submission status: Wrong Answer

Solution code:
n = int(input())
 
a = [i**5 for i in range(120)]
for i in range(119):
    for j in range(i+1,119):
        if a[j]-a[i] == n:
            print(j,i)
            break
        if a[j]+a[i] == n:
            print(j,-i)
            break
    else: continue
    break