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: Accepted

Solution code:
import sys,bisect,string,math,time,functools,random
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
from itertools import permutations,combinations,groupby
def Golf():*a,=map(int,open(0))
def I():return int(input())
def S_():return input()
def IS():return input().split()
def LS():return [i for i in input().split()]
def LI():return [int(i) for i in input().split()]
def LI_():return [int(i)-1 for i in input().split()]
def NI(n):return [int(input()) for i in range(n)]
def NI_(n):return [int(input())-1 for i in range(n)]
def StoLI():return [ord(i)-97 for i in input()]
def ItoS(n):return chr(n+97)
def LtoS(ls):return ''.join([chr(i+97) for i in ls])
def GI(V,E,ls=None,Directed=False,index=1):
    org_inp=[];g=[[] for i in range(V)]
    FromStdin=True if ls==None else False
    for i in range(E):
        if FromStdin:
            inp=LI()
            a,b,c=(inp+[1])[:3]
            org_inp.append(inp)
        else:
            index=0
            a,b,c=(ls[i]+[1])[:3]
        if index==1:a-=1;b-=1
        aa=(a,c);bb=(b,c);g[a].append(bb)
        if not Directed:g[b].append(aa)
    return g,org_inp
def GGI(h,w,search=None,replacement_of_found='.',mp_def={'#':1,'.':0},boundary=1):
#h,w,g,sg=GGI(h,w,search=['S','G'],replacement_of_found='.',mp_def={'#':1,'.':0}) # sample usage
    mp=[boundary]*(w+2);found={}
    for i in range(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[boundary]+[mp_def[j] for j in s]+[boundary]
    mp+=[boundary]*(w+2)
    return h+2,w+2,mp,found
def TI(n):return GI(n,n-1)
def bit_combination(k,n=2):
    rt=[]
    for tb in range(n**k):
        s=[tb//(n**bt)%n for bt in range(k)];rt+=[s]
    return rt
def show(*inp,end='\n'):
    if show_flg:print(*inp,end=end)

YN=['YES','NO'];Yn=['Yes','No']
mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase
#sys.setrecursionlimit(10**7)
input=lambda: sys.stdin.readline().rstrip()

class Comb:
    def __init__(self,n,mo=10**9+7):
        self.fac=[0]*(n+1)
        self.inv=[1]*(n+1)
        self.fac[0]=1
        self.fact(n)
        for i in range(1,n+1):
            self.fac[i]=i*self.fac[i-1]%mo
            self.inv[n]*=i
            self.inv[n]%=mo
        self.inv[n]=pow(self.inv[n],mo-2,mo)
        for i in range(1,n):
            self.inv[n-i]=self.inv[n-i+1]*(n-i+1)%mo
        return
    
    def fact(self,n):
        return self.fac[n]
        
    def invf(self,n):
        return self.inv[n]

    def comb(self,x,y):
        if y<0 or y>x:
            return 0
        return self.fac[x]*self.inv[x-y]*self.inv[y]%mo

class Tree:
    def __init__(self,inp_size=None,init=True):
        if init:
            self.stdin(inp_size)
        return

    def stdin(self,inp_size=None):
        if inp_size==None:
            self.size=int(input())
        else:
            self.size=inp_size
        self.edges,_=GI(self.size,self.size-1)
        return
    
    def listin(self,ls):
        self.size=len(ls)+1
        self.edges,_=GI(self.size,self.size-1,ls)
        return

    def __str__(self):
        return  str(self.edges)

    def dfs(self,x,func=lambda prv,nx,dist:prv+dist,root_v=0):
        q=deque()
        q.append(x)
        v=[-1]*self.size
        v[x]=root_v
        while q:
            c=q.pop()
            for nb,d in self.edges[c]:
                if v[nb]==-1:
                    q.append(nb)
                    v[nb]=func(v[c],nb,d)
        return v

    def EulerTour(self,x,func=lambda prv,nx,dist:prv+dist,root_v=0):
        q=deque()
        q.append((-1,x))
        v=[None]*self.size
        v[x]=root_v
        et=[]
        while q:
            cb,ce=q.pop()
            et.append(ce)
            for nb,d in self.edges[ce]:
                if v[nb]==None:
                    q.append((nb,ce))
                    q.append((ce,nb))
                    v[nb]=func(v[ce],nb,d)
        vid=[[-1,-1]for i in range(self.size)]
        for i,j in enumerate(et):
            if vid[j][0]==-1:
                vid[j][0]=i
            else:
                vid[j][1]=i
        return v,et,vid
    
    def LCA_init(self,depth,et):
        self.st=SegTree(self.size*2-1,func=min,ide=inf)
        for i,j in enumerate(et):
            self.st.update(i,j)
        self.LCA_init_stat==True
        return
    
    def LCA(self,root,x,y):
        if self.LCA_init_stat==False:
            depth,et,vid=self.EulerTour(root)
            self.LCA_init(depth,et)
        return self.st.query(x,y+1)

## return prime factors of N as dictionary {prime p:power of p}
## within 2 sec for N = 2*10**20+7
def primeFactor(N):
    i,n=2,N
    ret={}
    d,sq=2,99
    while i<=sq:
        k=0
        while n%i==0:
            n,k,ret[i]=n//i,k+1,k+1
        if k>0 or i==97:
            sq=int(n**(1/2)+0.5)
        if i<4:
            i=i*2-1
        else:
            i,d=i+d,d^6
    if n>1:
        ret[n]=1
    return ret


## return the list of prime numbers in [2,N], using eratosthenes sieve
## within 2sec for N = 1.2*10**7
def PrimeNumSet(N):
    Max = int(N**0.5)
    seachList = [i for i in range(2,N+1)]
    primeNum = []
    while seachList:
        if seachList[0] <= Max:
            break
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    return primeNum

## retrun LCM of numbers in list b
## within 2sec for no of B = 10*5  and  Bi < 10**6
def LCM(b,mo=10**9+7):
    prs=PrimeNumSet(max(b))
    M=dict(zip(prs,[0]*len(prs)))
    for i in b:
        dc=primeFactor(i)
        for j,k in dc.items():
            M[j]=max(M[j],k)
    
    r=1
    for j,k in M.items():
        if k!=0:
            r*=pow(j,k,mo)
            r%=mo
    return r

show_flg=False
show_flg=True

x=I()

z=[(i,i**5) for i in range(-500,500)]

for i,j in z:
    for u,v in z:
        if j-v==x:
            print(i,u)
            exit()

Submission status: Accepted

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: Accepted

Solution code:
X=int(input())

for A in range(-10**3, 10**3):
  for B in range(-10**3, 10**3):
    if A**5-B**5==X:
      print(A, B)
      exit()

Submission status: Accepted

Solution code:
D = 120

X = int(input())

for a in range(-D, D):
    for b in range(-D-1, D-1):
        if a**5 - b**5 == X:
            break
    else:
        continue
    break

print(a, b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect
import math

D = 120

X = int(input())

for a in range(-D, D):
    for b in range(-D-1, D-1):
        if a**5 - b**5 == X:
            break
    else:
        continue
    break

print(a, b)

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

X = int(input())


ans = {}

for a in range(-200, 201):
    for b in range(-200, 201):
        Y = a**5 - b**5
        ans[Y] = [a, b]

print(str(ans[X][0]) + ' ' + str(ans[X][1]))

Submission status: Accepted

Solution code:
X = int(input())
for i in range(-200, 200):
    for j in range(-200, 200):
        if i**5 - j**5 == X:
            print(str(i)+' '+str(j))
            break
    else:
        continue
    break

Submission status: Accepted

Solution code:
x = int(input())
for i in range(-118, 120):
    for j in range(-119, 119):
        if i**5 - j**5 == x:
            print('{} {}'.format(i,j))
            break
    else:
        continue
    break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
r = range(-500, 501)

flag = False

for i in r:
    for j in r:
        if i**5 - j**5 == x:
            print(i, j)
            flag = True
            break
    if flag:
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

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

for i in range(-1000,1000,1):
  for j in range(-1000,1000,1):
    if i**5-j**5 == X:
      print(i,j)
      sys.exit()

Submission status: Accepted

Solution code:
import math, sys
X = int(input())
for a in range(-200,200):
  a5 = a**5
  for b in range(-200,200):
    if a5-b**5==X:
      print(str(a)+" "+str(b))
      sys.exit()

Submission status: Accepted

Solution code:
x = int(input())
ans = []
for i in range(-120, 120):
  for j in range(-120, 120):
    if pow(i, 5) - pow(j, 5) == x:
      ans += [[i, j]]
ans = list(map(str, ans[0]))
print(" ".join(ans))

Submission status: Accepted

Solution code:
x = int(input())
n = 10**5

def blp(dp,num):
    l = 0
    r = len(dp)-1
    while l <= r:
        mid = (l+r)//2
        if num == dp[mid]:return mid
        elif num >= dp[mid]:l = mid+1
        else:r = mid-1
    return 0

def bln(dp,num):
    l = 0
    r = len(dp)-1
    while l>=r:
        mid = (l+r)//2
        if num == dp[mid]:return mid
        elif num >= dp[mid]:r = mid+1
        else:l = mid-1
    return 0
            
ap = [i**5 for i in range(n)]
an = [-(i**5) for i in range(n)]

for b in range(-n,n):
    num = x + b**5
    a = max(blp(ap,num),bln(an,num))
    if a:print(a,b) ; break

Submission status: Accepted

Solution code:
X = int(input())
for A in range(-118, 120):
    for B in range(-119, 119):
        if 1 <= pow(A, 5) - pow(B, 5) and A - B >= 1:
            if pow(A, 5) - pow(B, 5) == X:
                print(A, B)
                exit()

Submission status: Accepted

Solution code:
X = int(input())
 
ans = None
 
for i in range(120):
  for j in range(120):
    if i ** 5 - j ** 5 == X:
      ans = (i, j)
    elif (i*-1) ** 5 - j ** 5 == X:
      ans = (-i, j)
    elif i ** 5 - (j*-1) ** 5 == X:
      ans = (i, -j)
print(ans[0],ans[1])

Submission status: Accepted

Solution code:
import sys

def debug(*args):
    print(*args, file=sys.stderr)


x_diff_of_5th_factor = int(input())


for a in range(-118, 119):
    for b in range(-119, 118):
        if a ** 5 - b ** 5 == x_diff_of_5th_factor:
            print('{} {}'.format(a, b))
            sys.exit(0)

sys.exit(1)

Submission status: Accepted

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



def solve(X: int):
    for i in range(-120, 120):
        for j in range(-120, 120):
            if i ** 5 - j ** 5 == X:
                print(i, j)
                return
    


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  # type: int
    solve(X)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
X = int(input())
L = [i ** 5 for i in range(-118, 120)]
for A in range(-118, 120):
    for B in range(-119, 119):
        if L[A + 118] - L[B + 118] == X:
            print(A, B)
            sys.exit()

Submission status: Accepted

Solution code:
MOD = 10 ** 9 + 7
INF = 10 ** 11
import sys
sys.setrecursionlimit(100000000)
from bisect import bisect_right,bisect_left

def main():
    X = int(input())
    for i in range(1000):
        for j in range(1000):
            p = pow(i,5)
            q = pow(j,5)
            if p + q == X:
                print(i,-j)
                return
            elif p - q == X:
                print(i,j)
                return
            elif q - p == X:
                print(j,i)
                return
                
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import numpy as np
import math
x = int(input())
ys = []
i = 1
while i**2 < x:
    if x%i == 0:
        ys.append(i)
        ys.append(x//i)
    i += 1
if i**2 == x:
    ys.append(i)

f = False

for j in ys:
    for i in range(10**3):
        if i**5-(i-j)**5 == x:
            print(i,i-j)
            break
        elif i**5-(i-j)**5 > x and i-j > 0:
            break
    if f:
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())
for a in range(-200,200):
    for b in range(-200,200):
        if a**5 - b**5 == X:
            print(a,b)
            exit()

Submission status: Accepted

Solution code:
X=int(input())
for i in range(-150,150):
  for j in range(-150,150):
    if i**5-j**5==X:
      A=i
      B=j
print(*[A,B])

Submission status: Accepted

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

for A in range(-500,500):
    for B in range(-500,500):
        if(A**5-B**5==X):
            print(A,B)
            break
    else:
        continue
    break

Submission status: Accepted

Solution code:
X = int(input())

for A in range(-10**3-3, 10**3+3, 1):
    for B in range(-10**3-3, 10**3+3, 1):
        if A**5 - B**5 == X:
            print(A,B)
            exit()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
x = int(input())

for a in range(-118, 120):
    for b in range(-119, 119):
        diff = a**5 - b**5
        # print(diff)
        if diff == x:
            print (str(a) + " " + str(b))
            break
    else:
        continue
    break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

limit = 1000
flag = False

for i in range(-limit, limit):
    if (flag is True):
        break

    for j in range(-limit, limit):
        val = i ** 5 - j ** 5

        if (val == x):
            print(i, j)
            flag = True
            break

Submission status: Accepted

Solution code:
x = int(input())
a = 0
while True:
    n = (a**5)-x
    s2 = -1 if n < 0 else 1
    if s2 == -1:
        n = n * -1
    b = n**0.2
    if a**5-(int(b)*s2)**5==x:
        end = 1
        print(a, int(b) * s2)
        break
    a = a+1

Submission status: Accepted

Solution code:
# abc166 D
x = int(input())

for a in range(-118, 120):
    ans = False
    for b in range(-119, 119):
        if a ** 5 - b** 5 == x:
            print("{} {}".format(a, b))
            ans = True
            break
    if ans:
        break

Submission status: Accepted

Solution code:
import sys

X = int(input())

for A in range(-200, 200, 1):
  for B in range(-200, 200, 1):
    if A**5 - B**5 == X:
      print("{0} {1}".format(A, B))
      sys.exit(0)

Submission status: Accepted

Solution code:
X=int(input())

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

Submission status: Accepted

Solution code:
X = int(input())
flag = True
a = 0
b = 0
for i in range(-500, 500):
    if flag == False:
        break
    for j in range(-500, 500):
        if i**5 - j**5 == X:
            a = i
            b = j
            flag = False
            break


print(str(a), str(b))

Submission status: Accepted

Solution code:
import math

x = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7 # 998244353
input=lambda:sys.stdin.readline().rstrip()
def resolve():
    x = int(input())
    for a in range(-1000, 1001):
        for b in range(-1000, 1001):
            if a ** 5 - b ** 5 == x:
                print(a, b)
                return
resolve()

Submission status: Accepted

Solution code:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
x = int(input())
flag = 0
for a in range(-200, 201):
    if flag == 1:
        break
    for b in range(-200, 201):
        if a**5 - b**5 == x:
            print(a, b)
            flag = 1
            break

Submission status: Accepted

Solution code:
X = int(input())
flag = 0

for i in range(-200,200):
    for j in range(-200,200):

        if i**5 - j**5 == X:

            print(i,j)
            flag = 1
            break

    if flag==1:
        break

Submission status: Accepted

Solution code:
N=input()
for a in range(-200,200):
    for b in range(-200,200):
        if a**5-b**5==N:
            print a,b
            quit()

Submission status: Accepted

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

for a in range(-1000, 1000):
    for b in range(-1000, 1000):
        if math.pow(a, 5) == x + math.pow(b, 5):
            print(a, b)
            exit()

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline


X = int(input())
for i in range(-200, 200):
    for j in range(-200, 200):
        if i ** 5 - j ** 5 == X:
            print(i, j)
            exit()

Submission status: Accepted

Solution code:
X = int(input())

flg = 0
for i in range(-200,200):
  if flg == 1:
    break

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

Submission status: Accepted

Solution code:
X = int(input())
for a in range(-200,200):
    for b in range(-200,200):
        if a**5-b**5 == X:
            print(a,b)
            exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

AA = 0
BB = 0

for A in range(-121,121):
    for B in range(-121,121):
        if X == (A ** 5) - (B ** 5):
            AA = A
            BB = B

print(AA,BB)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
#N, K = map(int, input().split())
# 文字列の入力
x = int(input())
#開業されたN個要素を受け付ける
#list = [input() for i in range(N)]

a=150
while a > -150:
    b=a-1
    while b > -150:
        if pow(a, 5) - pow(b, 5)==x:
            print(a, b)
            exit()
        b=b-1
    a=a-1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    X = int(input())
    for A in range(-119, 119):
        flag = False
        for B in range(-119, 119):
            if A**5 - B**5 == X:
                print(A, B)
                flag = True
                break
        if flag:
            break
if __name__ == '__main__':
    main()

Submission status: Accepted

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

print(*ans)

Submission status: Accepted

Solution code:
X = int(input())
flag = 0
for A in range(-300,301):
    for B in range(-300,301):
        if A**5 - B**5 == X:
            print(A,B)
            flag = 1
        if flag==1:
            break
    if flag==1:
        break

Submission status: Accepted

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

Submission status: Accepted

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)
            exit()

Submission status: Accepted

Solution code:
import os

def main():
	x = int(input())
	a,b = 0,0
	for i in range(119, -118, -1):
		for j in range(118, -119, -1):
			if i**5 - j**5 == x:
				a = i
				b = j
				break
	print(a,b)				


if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
def main():
  sFlag=False
  X= int(input())
  for i in range(-1000,1000):
    for j in range(-1000,1000):
      X_n=i**5-j**5
      if(X_n==X):
        print(i,j)
        sFlag=True
        break
    if(sFlag==True):
      break
 
if __name__=='__main__':
  main()

Submission status: Accepted

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

"""
def calc(b, b5):
    a = (x+b5)**0.2

    if a.real.is_integer():
        print(int(a), b)
        exit()

while True:
    b5 = b ** 5
    calc(b, b5)
    if x-b5 >= 0:
        calc(-b, -b5)
    b += 1
    """

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

Submission status: Accepted

Solution code:
from sys import stdin
from sys import setrecursionlimit
from collections import Counter, deque, defaultdict
from math import floor, ceil
from bisect import bisect_left
setrecursionlimit(100000)

INF = int(1e10)
MOD = int(1e9 + 7)

def main():
    from builtins import int, map
    X = int(input())
    for A in range(-200, 200):
        for B in range(-200, 200):
            if A ** 5 - B ** 5 == X:
                print(A, B)
                exit()

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
X = int(input())

AA = 0
BB = 0

for A in range(-121,121):
    for B in range(-121,121):
        if X == (A ** 5) - (B ** 5):
            AA = A
            BB = B

print(AA,BB)

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    X = int(input())
    for i in range(-119, 120):
        for j in range(-118, 119):
            if i ** 5 - j ** 5 == X:
                print(i, j)
                exit()

Submission status: Accepted

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

x = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X=int(input())
for B in range(-10**3,10**3):
    if type((X+B**5)**0.2)!=complex:
        if int((X+B**5)**0.2)-0.0001<=(X+B**5)**0.2<=int((X+B**5)**0.2)+0.0001:
            print(int((X+B**5)**0.2), B)
            break

Submission status: Accepted

Solution code:
from math import ceil #切り上げ
import numpy as np
import sys
 
def inp(): return int(input()) #一個だけ読み取り
def inpm(): return map(int,input().split()) #mapオブジェクトで呼び出し
def inpl(): return list(map(int, input().split())) #数字リストをintで
def inpls(): return list(input().split()) #リストをstrで
 
def check(a,b,X):
  if a**5-b**5 == X:
    return 1
  else:
    return 0
  
X = inp()
for A in range(-118,120):
  for B in range(-119,119):
    if check(A,B,X):
      print(str(A) + " " + str(B))
      sys.exit()

Submission status: Accepted

Solution code:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections


x = int(input())
for i in range(-1000,1001):
    for j in range(-1000,1001):
        if i**5 - j**5 == x:
            print(i,j)
            sys.exit()

Submission status: Accepted

Solution code:
import itertools
x = int(input())
num = [i**5 for i in range(3000)]
ans= list(itertools.combinations_with_replacement(num, 2))
for i in ans:
    if abs(i[0]-i[1]) == x:
        if i[0] < i[1]:
            print(int(i[1]**0.2),int(i[0]**0.2))
        else:
            print(int(i[0]**0.2),int(i[1]**0.2))
        break
    elif i[0]+i[1] == x:
        print(int(i[0]**0.2),int(i[1]**0.2)*-1)
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    x = int(input())
    is_answered = False
    for a in range(-200, 201):
        if is_answered:
            break
        for b in range(-200, 201):
            if pow(a, 5) - pow(b, 5) == x:
                print(a, b)
                is_answered = True
                break


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from itertools import combinations
x = int(input())
li = [i**5 for i in range(-200, 200)]
dic = {}
for i in range(-200, 200):
    dic[i**5] = i
for a, b in combinations(li, 2):
    if a - b == x:
        print(dic[a], dic[b])
        break
    elif b - a == x:
        print(dic[b], dic[a])
        break

Submission status: Accepted

Solution code:
X=int(input())

def ans():
  for x in range(-118,119):
    for y in range(-119,118):
      if X==(x**5-y**5):
         print('{} {}'.format(x,y))
         return x,y      
ans()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import numpy as np

sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
#read = sys.stdin.buffer.read

def main():
    X = int(readline())
    A = range(1, 201)
    B = range(-201, 201)
    for a in A:
        for b in B:
            tmp = pow(a, 5) - pow(b, 5)
            if X == tmp:
                print(a, b)
                return


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X=int(input())
for i in range(0,1000):
    for j in range(-1000,1000):
        if i**5-j**5 == X:
            A=i
            B=j
        else:
            pass

print(A,B)

Submission status: Accepted

Solution code:
x = int(input())
ans = []
for i in range(-120, 120):
  for j in range(-120, 120):
    if pow(i, 5) - pow(j, 5) == x:
      ans += [[i, j]]
ans = list(map(str, ans[0]))
print(" ".join(ans))

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

Solution code:
x = int(input())
ans_i = 0
ans_j = 0
for i in range(-120, 120):
    j = -120
    while x > j ** 5:
        if i ** 5 - j ** 5 == x:
            ans_i = i
            ans_j = j
            j = x + 1
            break
        else:
            j += 1
print(ans_i, ans_j)

Submission status: Accepted

Solution code:
x = int(input())
a = 0
b = 0

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

Submission status: Accepted

Solution code:
X = int(input())
flag = False
for i in range(-120,120):
    for j in range(-120,120):
        if i**5 - j**5 == X:
            print(str(i) + ' ' + str(j))
            flag = True
            break
    if flag:
        break

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

x = int(readline())
for i in range(-118, 119):
    for j in range(-119, 118):
        a = i ** 5 - j ** 5
        b = j ** 5 - i ** 5
        if x == a:
            print(i, j)
            exit()
        if x == b:
            print(j, i)
            exit()

Submission status: Accepted

Solution code:
import math
X=int(input())
for a in range(-118,120):
  for b in range(-119,119):
    if a**5-b**5==X:
      print(a,b);exit()

Submission status: Accepted

Solution code:
X = int(input())

"""
    - A > B
    -
"""

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input());
n1 = 0;
n2 = 0;
if(x == 1):
    n1 = 0;
    n2 = -1;
    print(n1, n2);
flag = False;

if(x != 1):
    for i in range(1000):
        for j in range(1000):
            if((i * i * i * i * i) - (-(j * j * j * j * j)) == x ):
                print(i, -j);
                flag = True;
                break;
            if ((i * i * i * i * i) - ((j * j * j * j * j)) == x):
                print(i, j);
                flag = True;
                break;
        if(flag):
            break;

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())
#print(X)
n = X
div = []
for i in range(1, int(n**0.5)+1):
  if n % i == 0:
    div.append(i)
    if i != n // i:
      div.append(n//i)
#print(div)

for i in div:
  for a in range(0, 1001): 
    b = a - i
    #print(a, b)
    if a**5 - b**5 == X:
      print(a, b)
      break
  else:
    continue
  break

Submission status: Accepted

Solution code:
X = int(input())

for A in range(-200,200):
  for B in range(-200,200):
    if A**5-B**5 == X:
      print(A,B)
      exit()

Submission status: Accepted

Solution code:
X = int(input())
A = [i for i in range(-200,200)]
B = [i for i in range(-200,200)]
for a in A:
    for b in B:
        if (a ** 5) - (b ** 5) == X:
            print(a,b)
            exit()