Problem:
 Score : 200 points    Problem Statement You are given a positive integer X .
Find the largest perfect power that is at most X .
Here, a perfect power is an integer that can be represented as b^p , where b is an integer not less than 1 and p is an integer not less than 2 .      Constraints  1  ≤  X  ≤  1000  X is an integer.         Input Input is given from Standard Input in the following format:  X       Output Print the largest perfect power that is at most X .        Sample Input 1 10      Sample Output 1 9  There are four perfect powers that are at most 10 : 1 , 4 , 8 and 9 .
We should print the largest among them, 9 .       Sample Input 2 1      Sample Output 2 1       Sample Input 3 999      Sample Output 3 961

Solution (Python):
import sys
import math
from fractions import gcd





def lcm(a, b):
    return a * b // gcd(a, b)

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

big_prime = 1000000007

"""


 =  sys.stdin.readline().rstrip()
 =  list(sys.stdin.readline().rstrip())


 =  int(sys.stdin.readline())
 =  map(int, sys.stdin.readline().split())
 =  list(map(int, sys.stdin.readline().split()))
 =  [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""

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

ans = 0
for i in range(1, 40):
    for j in range(2, 10):
        tmp = i ** j
        if tmp <= N:
            ans = max(tmp, ans)
print(ans)

Solution (Python):
s = set()
s |= { i*i for i in range(1, 33) }
s |= { i*i*i for i in range(1, 11) }
s |= { i*i*i*i*i for i in range(1, 5) }
s |= { i*i*i*i*i*i*i for i in range(1, 5) }

X = int(input())
r = max(filter(lambda i: i <= X, s))
print(r)

Solution (Python):
x = int(input())

ans = 1
for b in range(2, 32):
    for p in range(2, 11):
        if b ** p <= x:
            ans = max(ans, b ** p)

print(ans)

Solution (Python):
x = int(input())
l = [1]

for i in range(2,32):
  for j in range(2,10):
    if i**j <= 1000:
      l.append(i**j)
      
l = sorted(l,reverse = True)

for k in sorted(list(range(1,x+1)),reverse = True):
  if k in l:
    print(k)
    exit()

Solution (Python):
import sys
from collections import deque
from collections import  Counter
import statistics
import math

stdin = sys.stdin

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

x = ni()
li = []
for b in range(1, 34):
    for p in range(2, 34):
        num = b ** p
        if num <= 1000:
            li.append(num)
list.sort(li, reverse=True)
for i in range(len(li)):
    if x >= li[i]:
        print(li[i])
        break

Solution (Python):
x = int(input())

ret = 1
for i in range(2, 32):
    for j in range(2, 11):
        tmp = i ** j
        if tmp <= x:
            ret = max(ret, tmp)
        else:
            break
print(ret)

Solution (Python):
import itertools
x = int(input())
score = 0

for b,p in itertools.product(range(1,33),range(2,10)):
    if b**p<=x: score = max(score, b**p)

print(score)

Solution (Python):
X = int(input())
m = 1
for i in range(1, 33):
    for j in range(2, 11):
        if i**j <= X and i**j > m:
            m = i**j
print(m)

Solution (Python):
X = int(input())
ans = 0
for i in range(1,100):
    for j in range(2,100):
        if i**j <= X:
            ans = max(i**j,ans)
print(ans)

Solution (Python):
n=int(input());print(max(i**j for i in range(32)for j in range(2,10)if i**j<=n))

Solution (Python):
x=int(input())

import math



res=[1]

for i in range(2,33):
	for j in range(2,10):
		y=i**j
		if y<=x:
			res.append(y)

print(max(res))

Solution (Python):
X = int(input())

ans = 1
for b in range(1, X+1):
    for p in range(2, 10): 
        if b**p <= X and b**p > ans:
            ans = b**p

print(ans)

Solution (Python):
X = int(input())
c = 1
for b in range(1,X):
    for p in range(2,X):
        if b**p <= X:
            c = max(c, b**p)
        else:
            break
print(c)

Solution (Python):
from math import sqrt
x=int(input())
c=1
for b in range(1,int(sqrt(x))+1):
  for p in range(2,10):
    if b**p<=x:
      c=max(b**p,c)
    else:
      break
print(c)

Solution (Python):
from math import sqrt
x=int(input())
c=1
for b in range(1,int(sqrt(x))+1):
  for p in range(2,x):
    if b**p<=x:
      c=max(b**p,c)
    else:
      break
print(c)

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    x = int(input().rstrip('\n'))
    mp = 0
    for i in range(int(x ** 0.5) + 1):
        for j in range(int(x ** 0.5) + 1):
            p = pow(i, j)
            if p <= x:
                mp = max(p, mp)
    print(mp)


if __name__ == '__main__':
    main()

Solution (Python):
X = int(input())
c = 1
for b in range(1,X):
    for p in range(2,X):
        if b**p <= X:
            c = max(c, b**p)
        else:
            break
print(c)

Solution (Python):
X = int(input())
c=1
for b in range(1,X):
    for p in range(2,X):
        if b**p<=X:c=max(c,b**p)
        else:break
print(c)

Solution (Python):
x=int(input())
import math
p=math.ceil(x**0.5)
ans=[1]
for i in range(2,p+1):
  j=2
  while True:
    if i**j<=x:
      ans.append(i**j)
    else:
      break
    j+=1
print(max(ans))

Solution (Python):
X = int(input())
ans = 1
for b in range(2, 40):
  for p in range(2, 11):
    if pow(b, p) <= X: ans = max(ans, pow(b, p))
print(ans)

Solution (Python):
x = int(input())
ans = 1
power = 1
for b in range(2,x+1):
    p = 2
    if x == 1:
        break
    while True:
        power = b ** p
        if x < power:
            break
        else:
            ans = max(ans,power)
            p += 1
print(ans)

Solution (Python):
x = int(input())
ans = 0
for i in range(33):
    for j in range(2,10):
        po = i ** j
        if po <= x:
            ans = max(ans,po)
print(ans)

Solution (Python):
n=int(input())

ans=1
for i in range(1,32):
  for j in range(2,10):
    if n>=i**j:
      ans=max(ans,i**j)
print(ans)

Solution (Python):
x = int(input())
bp = 0
for i in range(x):
    for j in range(9):
        if((i+1)**(j+2)<=x):
            bp = max(bp,(i+1)**(j+2))
print(bp)

Solution (Python):
x = int(input())
ans = 1
for i in range(2, int(x ** 0.5) + 1):
    for j in range(2, 11):
        if x < i ** j:
            break
        ans = max(ans, i ** j)
print(ans)

Solution (Python):
x=int(input())
ans=1
for b in range(1,x):
  for p in range(2,x):
    if x-b**p>=0:
      ans=max(ans,b**p)
    else:
      break
print(ans)

Solution (Python):
def resolve():
    x = int(input())
    ans = [1]
    for b in range(2, x + 1):
        p = 2
        while b ** p <= x:
            bp = b ** p
            ans.append(bp)
            p += 1
    print(max(ans))


if __name__ == "__main__":
    resolve()

Solution (Python):
import math
def main():
    X = int(input())
    max_p = 1
    if X < 4: return max_p

    for p in range(2, int(math.sqrt(X))+1):
        q = p * p
        while q <= X:
            max_p = max(max_p, q)
            q *= p
    return max_p


if __name__ == '__main__':
    print(main())

Solution (Python):
x=int(input())
a=0
b=0
c=1
for i in range(100):
    for j in range(2,100):
        if i**j<=x:
            a=i**j
        else:
            b=a
            break
    if b>=c:
        c=b
print(c)

Solution (Python):
box=[0]*1001
for i in range(2,int(1000**0.5)+1):
    count=i
    point=2
    while 1000>count:
        try:
            count=i
            count=count**point
            box[count]=1
            point +=1
        except:break
box[1]=1
target=[]
for i in range(len(box)):
    if box[i]==1:target.append(i)

x=int(input())
if x==1000:print(x);exit()
ans=0
for i in target:
    if x>=i:ans=i
    else:print(ans);break

Solution (Python):
x=int(input())
c=1
for b in range(1,x):
    for p in range(2,x):
        if b**p<=x:c=max(c,b**p)
        else:break
print(c)

Solution (Python):
X = int(input())
arr = []

for i in range(1, X+2):
    for j in range(2, X+2):
        exp = i ** j
        if exp > X:
            break
        arr.append(exp)
        
arr.sort()
arr.reverse()
print(arr[0])

Solution (Python):
X = int(input())
a = 1
for i in range(1,X):
    for j in range(2,X):
        if i**j <= X:
            a = max(a,i**j)
        else:
            break

print(a)

Solution (Python):
x = int(input())
ans = 1
import math
for i in range(2,math.floor(math.sqrt(x))+1):
    b = i ** 2
    while b <= x:
        ans = max(b,ans)
        b *= i
print(ans)

Solution (Python):
x = int(input())
ans = 1
for b in range(1, x):
    for p in range(2, x):
        if b**p <= x:
            ans = max(ans, b**p)
        else:
            break
print(ans)

Solution (Python):


X = int(input())

ans = 0
for b in range(1, 41):
    for p in range(2, 11):
        if b ** p <= X:
            ans = max(ans, b ** p)

print(ans)

Solution (Python):
x=int(input())
li=[]
for i in range(1,1000):
    for j in range(2,11):
        if i**j<=x:
            li.append(i**j)
li=set(li)
li=sorted(list(li))

print(max(li))

Solution (Python):
N = int(input())
ans=1
for i in range(1,32):
    for j in range(2,10):
        if i**j <= N:
            ans = max(ans,i**j)
        else:
            break
print(ans)

Solution (Python):
x = int(input())
c = 1
for b in range(1, x):
    for p in range(2, x):
        if b ** p <= x: c = max(c, b ** p)
        else: break
print(c)

Solution (Python):
X = int(input())

max_beki = 1

for i in range(2,36):
    p = 2
    while True:
        if i ** p <= X:
            max_beki = max(max_beki, i ** p)
            p += 1
        else:
            break
print(max_beki)

Solution (Python):
X = int(input())
cans = [b**p for b in range(1,32) for p in range(2,10) if b**p <= X]
print(max(cans))

Solution (Python):
x=int(input())
a=1
for b in range(2,x):
    for p in range(2,x):
        t=b**p
        if t<=a:
            continue
        if x<t:
            break
        a=t
print(a)

Solution (Python):
x=int(input())
ans=1
for i in range(2,int(x**0.5)+1):
    j=i
    while j*i<=x:
        j*=i
    ans=max(ans,j)
print(ans)

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

for i in range(x+1)[::-1]:
    for j in range(int(math.sqrt(1000))+1)[::-1]:
        for k in range(2,10):
            if i == j**k:
                print(i)
                exit()

Solution (Python):
x = int(input())
ans = 1
for i in range(2, 32) :
    for j in range(2, 10) :
        if i**j <= x :
            ans = max(ans, i**j)

print(ans)

Solution (Python):
c = 1
a = int(input())
for i in range(1, int(a ** 0.5) + 1):
  for j in range(2, int(a/ 2)):
    if i ** j <= a:
      c = max(c, i**j)
print(c)

Solution (Python):
X=int(input())

list=[]
if X==1:
    list.append(1)
for i in range(1,X):
    for j in range(2,X):
        if i**j <= X:
                list.append(i**j)
        else:
            break
print(max(list))

Solution (Python):
X = int(input())
ans = 1
for i in range(2, 32):
    p = 2
    while i ** p <= X:
        ans = max(ans, i ** p)
        p += 1
print(ans)

Solution (Python):
import math
n=int(input())
ans=1
for i in range(2,int(math.sqrt(n))+1):
  x=1
  while(x<n+1):
    x=i*x
  ans=max(ans,x//i)
print(ans)

Solution (Python):
x=int(input())
max_val=1
for b in range(1,x):
  for p in range(2,x):
    if b**p <= x:
      max_val=max(b**p,max_val)
    else:
      break
    
print(max_val)

Solution (Python):
import math

x = int(input())

prime_list = []
if x!=1:
    for i in range(2,int(math.sqrt(x))+1):
        j = 2
        while i**j<=x:
            prime_list.append(i**j)
            j+=1

    print(max(prime_list))
else:
    print(1)

Solution (Python):
x = int(input())
ans = 1
for i in range(1,36):
    for j in range(2,1001):
        if i**j<=x: ans = max(ans,i**j)
print(ans)

Solution (Python):
X = int(input())
a = 2
res = 1
while True:
  b = 2
  if a > 33:
    break
  while True:
    t = a ** b
    if t <= X:
      res = max(res, t)
      b += 1
    else:
      break
  a += 1

print(res)

Solution (Python):
x = int(input())
max_num = 0

for i in range(33):
    for j in range(2, 11):
        if i**j > x:
            break
        elif i**j >= max_num:
            max_num = i**j

print(max_num)

Solution (Python):
x=int(input())
n=set([1])
for i in range(2, int(x**0.5)+1):
  y=i**2
  while y<=x:
    n.add(y)
    y*=i
print(max(n))

Solution (Python):
import numpy as np

X = int(input())

def beki(num):
  for j in range(1, num+1):
    for k in range(2, 10):
      if j ** k == num:
        return True
  return False


for i in range(X, 0, -1):
  if beki(i):
    print(i)
    break

Solution (Python):
x = int(input())
ans = 1
for i in range(1,x):
  for j in range(2,x):
    if i**j<=x:ans=max(ans,i**j)
    else:break
print(ans)

Solution (Python):
x=int(input())
ans=0
a=0
for i in range(1,32):
  for j in range(2,11):
    if i**j<=x:
      a=i**j
    else:
      break
  ans=max(ans,a)
print(ans)

Solution (Python):
from math import sqrt
n = int(input())
m = int(sqrt(n))
li = list(range(m + 1))

for i in range(2, m + 1):
    while li[i] <= n:
        li[i] *= i
    li[i] = int(li[i] / i)
print(max(li))

Solution (Python):
n = int(input())
ans = 1
for i in range(2, 10):
    j = 1
    while ((j + 1)**i <= n):
        j += 1
        ans = max(ans, j ** i)
print(ans)

Solution (Python):
x = int(input())
ans = 1
for i in range(1, 32):
    for j in range(2, 12):
        num = i**j
        if num <= x:
            ans = max(num, ans)
print(ans)

Solution (Python):
import math
x=int(input())
if x<4:
    print(1)
else:
    k=0
    for i in range(int(math.sqrt(x))-1):
        l=0
        for j in range(x):
            if (i+2)**j>x:
                break
            else:
                l=(i+2)**j
        if l>k:
            k=l
    print(k)

Solution (Python):
X = int(input())

ans = []
for i in range(1,X+1):
  for j in range(2,11):
    n = i ** j
    if (n <= X):
      ans.append(n)
print(max(ans))

Solution (Python):
x = int(input())

print(max([n**e for n in range(1,32) for e in range(2,11) if n**e <= x]))

Solution (Python):
X = int(input())

maxX = 0
for i in range(1, 33):
    for j in range(2, 33):
        ij = i**j
        if ij > X:
            break
        maxX = max(maxX, ij)

print(maxX)

Solution (Python):
x = int(input())
ans = []
for b in range(1, 1000):
    for p in range(2, 10):
        tmp = b**p
        if tmp <= x:
            ans.append(tmp)
        else:
            break
print(max(*ans))

Solution (Python):
x = int(input())
ans = []
for b in range(1, 1000):
    for p in range(2, 1000):
        tmp = b**p
        if tmp <= x:
            ans.append(tmp)
        else:
            break
print(max(*ans))

Solution (Python):
import sys
input=sys.stdin.readline

x = int(input())

ans = 1
for b in range(1,x+1):
    for p in range(2,11):
        m = b**p
        if m <= x:
            ans = max(ans, m)
print(ans)

Solution (Python):
x = int(input())
ans = 1
for i in range(1, 32):
    for j in range(2, 10):
        p = pow(i, j)
        if p > x:
            break
        if p > ans:
            ans = p
print(ans)

Solution (Python):
import math

X=int(input())
max_num=math.ceil(math.sqrt(X))
if max_num**2>X:
    max_num-=1

num=max_num**2

for i in range(2,num):
    for j in range(3,X):
        p=i**j
        if p<=X and p>num:
            num=p
        elif p>X:
            break
        elif p==X:
            print(X)
            exit()

print(num)

Solution (Python):
import math

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

    ans = 1
    for i in range(1,X):
        for j in range(2,X):
            if i ** j <= X:
                ans = max(ans, i ** j)
            else:
                break

    print(ans)

main()

Solution (Python):
X = int(input())

max_ = 1

for i in range(2,X):
  power=1
  while i**(power+1)<=X:
    power+=1
    
  if power==1:
    break
    
  if i**power>max_:
    
    
    max_=i**power
    
print(max_)

Solution (Python):
X=int(input())
List=[1]
for i in range(2,32):
  j=2
  while True:
    if i**j<=1000:
      List.append(i**j)
      j+=1
    else:
      break
x=1
for i in range(len(List)):
  if List[i]<=X:
    x=max(x,List[i])
print(x)

Solution (Python):
n = int(input())
r = 1
for i in range(2, 11):
    if r < int(n ** (1 / i)) ** i:
        r = int(n ** (1 / i)) ** i
    elif n == 1000:
        r = n
print(r)

Solution (Python):
X = int(input())
ans = 0
for b in range(1,32):
    for p in range(2,9):
        if b**p <= X and ans<=b**p:
            ans = b**p
print(ans)

Solution (Python):
x=int(input())
ans=1
for i in range(1,x):
    for j in range(2,x):
        if i**j<=x:
            ans=max(ans,i**j)
        else:break
print(ans)

Solution (Python):

x = int(input())
ans = 1
for i in range(x):
    for j in range(2, x):
        if i ** j > x:
            break
        ans = max(ans, i**j)

print(ans)

Solution (Python):
N = int(input())
ans = 0
for j in range(1,N):
    for k in range(2,100):
        if N >= j ** k:
            if ans < j ** k:
                ans = j ** k
 
if N == 1:
    print(1)
else:
    print(ans)

Solution (Python):
X = int(input())
l = list()
S = set()
for a in range(32):
    l.append(a)
    for b in range(2, 11):
        if l[a]**b<=X:
            S.add(l[a]**b)
print(max(S))

Solution (Python):
import math
x=int(input())
num=math.floor(x/2)
flag=0
max=1
for i in range(num):
    flag=0
    for j in range(num):
        if i==1:
            break
        if i**j<=x:
            if i**j>=max:
                max=i**j
        else:
            flag=1
            break
print(max)

Solution (Python):
x=int(input())
c=1
for b in range(1,x):
    for p in range(2,x):
        if b**p<=x:
          c=max(c,b**p)
        else:break
print(c)

Solution (Python):
x = int(input())
ans = 1
for b in range(1, x):
    for p in range(2, x):
        if b**p <= x:
            ans = max(ans, b**p)
        else:
            break
print(ans)

Solution (Python):
x=int(input())
c=1
for b in range(1,x):
    for p in range(2,x):
        if b**p<=x:c=max(c,b**p)
        else:break
print(c)

Solution (Python):
x = int(input())
set_x = set(n**e for n in range(32) for e in range(2, 11) if n**e <= x)
ans = max(set_x)
print(ans)

Solution (Python):
x=int(input())
c=1
for i in range(1,x):
  for j in range(2,x):
    if i**j<=x:
      c=max(c,i**j)
    else:
      break
print(c)

Solution (Python):
x = int(input())
c = 1
for b in range(1, x):
    for p in range(2, x):
        if b**p <= x:
            c = max(c, b**p)
        else:
            break
print(c)

Solution (Python):
import math
x = int(input())
ans = []
for i in range(2,11):
  ans.append(int(math.pow(x,(1/i)))**i)
if x == 1000:
  print(1000)
else:
  print(max(ans))

Solution (Python):
x = int(input())
ans = 0
for i in range(int(x ** 0.5) + 1):
    for j in range(int(x ** 0.5) + 1):
        if i ** j <= x:
            ans = max(ans, i ** j)
        else:
            break
print(ans)

Solution (Python):
x = int(input())

ans = 1
for b in range(2, x+1):
    if b ** 2 > x:
        continue

    p = 2
    while b ** (p+1) <= x:
        p += 1
    ans = max(ans, b ** p)

print(ans)

Solution (Python):
x = int(input())
ans = 1
for b in range(x):
    for p in range(2, x):
        if b**p <= x:
            ans = max(ans, b**p)
        else:
            break
print(ans)

Solution (Python):
x = int(input())
c = [1]
for i in range(2,32):
    num = 2
    while i**num <= x:
        c.append(i**num)
        num+=1
print(max(c))

Solution (Python):
import math

x=int(input())
ans=1
sa=x-ans
if sa>=3:
    a=math.floor(math.sqrt(x))
    for i in range(2,a+1):
        p=2
        while i**p<=x:
            if x-(i**p)<sa:
                sa=x-(i**p)
                ans=i**p
            p+=1
print(ans)

Solution (Python):
x = int(input())
m = 0
for i in range(1,1000):
    for j in range(2,11):
        if x >= i**j:
            m = max(m, i**j)
print(m)

Solution (Python):
x = int(input())
maxi = 0
for i in range(2,x+1):
  p = 2
  while True:
    if i ** p <= x:
      if maxi < i ** p:
        maxi = i ** p
      p += 1
    else:
      break
if x <= 3:
  print(1)
else:
  print(maxi)

Solution (Python):
X = int(input())

ans = 1
for b in range(2, X+1):
    a = X
    c = 0
    while a >= b:
        c += 1
        a = a // b
    if c >= 2:
        ans = max(ans, b**c)
print(ans)

Solution (Python):
x = int(input())
result = 1
for b in range(1, x):
    for p in range(2, x):
        if b**p <= x:
            result = max(result, b**p)
        else:
            break
print(result)

Solution (Python):
x = int(input())
ans = 0
for b in range(1,32):
  for p in range(2,10):
    if b**p >x:
      break
    elif b**p > ans:
      ans = b**p
print(ans)

Solution (Python):
X = int(input())
S = set(n**e for n in range(32) for e in range(2,11) if n**e<=X)
print(max(S))

Solution (Python):
X = int(input())

ans = 0
for i in range(1001):
    for e in range(2, 10):
        if i ** e > X:
            continue
        ans = max(ans, i ** e)
print(ans)

Solution (Python):
x=int(input());l=[]
for i in range(1,32):
  for j in range(2,10):
    if i**j<=x:l.append(i**j)
print(max(l))

Solution (Python):
x = int(input())

beki_list = []
for i in range(1, 32): 
    for j in range(2, 10): 
        beki = i**j
        if beki <= 1000:
            beki_list.append(beki)



beki_list.sort(reverse=True)

for beki in beki_list:
    if beki <= x:
        print(beki)
        exit()

Solution (Python):
x = int(input())



beki_list = []
for i in range(1, 101): 
    for j in range(2, 10): 
        beki = i**j
        if beki <= 1000:
            beki_list.append(beki)


beki_list.sort(reverse=True)

for beki in beki_list:
    if beki <= x:
        print(beki)
        exit()

Solution (Python):
X = int(input())

res = 0
if X <= 3:
    res = 1
else:
    for i in range(2,X):
        c = 2
        while 1:
            a = i**c
            if a <= X:
                if res < a:
                    res = a
                c += 1
            else:
                break
print(res)

Solution (Python):
X = int(input())

max_num = 1
for b in range(2, 32):
    num = b
    for p in range(2, 11):
        num *= b
        if num <= X and num >= max_num:
            max_num = num

print(max_num)

Solution (Python):
x = int(input())
max_num = 0
for b in range(1, 33):
    for p in range(2, 33):
        if b**p > x:
            continue
        max_num = max(max_num, b**p)
print(max_num)

Solution (Python):
x = int(input())
if x == 1:
    print(1)
    exit()
li = list(range(2,x+1))
ans = [1]
n = 2
while li[0]**n < x:
    for i in range(x-1):
        if li[i]**n > x:
            ans.append(li[i-1]**n)
            break
    n += 1
print(max(ans))

Solution (Python):
x = int(input())
def createC(x, z):
  tmp = []
  for y in range(x):
    p = pow(y+1, z)
    if p <= x:
      tmp.append(p)
    else:
      return tmp

z = 2
max_c = 1
while True:
  if x == 1:
    break
  c_tmp = createC(x, z)
  if len(c_tmp) != 1:
    s = sorted(c_tmp)
    if max_c < s[-1]:
      max_c = s[-1]
    z += 1
  else:
    break
print(max_c)

Solution (Python):
x = int(input())
def createC(x, z):
  tmp = []
  for y in range(x):
    p = pow(y+1, z)
    if p <= x:
      tmp.append(p)
    else:
      return tmp

c = []
z = 2
max_c = 1
while True:
  if x == 1:
    break
  c_tmp = createC(x, z)
  if len(c_tmp) != 1:
    s = sorted(c_tmp)
    if max_c < s[-1]:
      max_c = s[-1]
    z += 1
  else:
    break
print(max_c)

Solution (Python):
x=int(input())
a=[]
for i in range(1,1000):
	for j in range(2,10):
		a.append(i**j)
a.sort()
import bisect
k=bisect.bisect_right(a,x)
print(a[k-1])

Solution (Python):

ans_list = [1]
for i in range(2, 10):
    ans_list.append(2 ** i)
for i in range(2, 7):
    ans_list.append(3 ** i)
for i in range(2, 5):
    ans_list.append(5 ** i)    
for i in range(2, 4):
    ans_list.append(6 ** i)
    ans_list.append(7 ** i)
    ans_list.append(10 ** i)
num = [11,12, 13, 14, 15, 17, 18, 19, 20, 21, 22,  23,24, 25, 26, 27, 28,  29, 30,  31]
for i in num:
    ans_list.append(i ** 2)
X = int(input())
for i in range(X, 0, -1):
    if i in ans_list:
        ans = i
        break
print(ans)

Solution (Python):
x = int(input())

max_powered = 1

for num in range(2, x):
    cand = num * num
    
    while cand <= x:
        if max_powered < cand:
            max_powered = cand
        cand *= num

print(max_powered)

Solution (Python):
import bisect

N = int(input())

lst = [1]
for i in range(2, 31+1):
  var = i ** 2
  while True:
    if var <= 1000:
      lst.append(var)
      var *= i
    else:
      break

lst = list(set(lst)) 
lst.sort()

idx = bisect.bisect_right(lst, N)

print(lst[idx-1])

Solution (Python):
n = int(input())
c = []
for i in range(1000):
  for j in range(2,10):
    if i**j <= n:
      c.append(i**j)
print(max(c))

Solution (Python):
n = int(input())

ans = []
for j in range(2,11):
    l = [i**j for i in range(1,32) if i**j <= n]
    ans = ans + l
print(max(ans))

Solution (Python):
import math
N = int(input())

s = set([1])
for b in range(2, int(math.sqrt(N))+1):
    p = 2
    while b**p <= N:
        s.add(b**p)
        p += 1

ans = max(s)
print(ans)

Solution (Python):
l=sorted([i**j for i in range(1,33)for j in range(2,10)])
n=int(input())
for i,m in enumerate(l):
	if m>n:
		print(l[i-1])
		exit()

Solution (Python):
x=int(input())

ans=1

for i in range(1,x):
    for j in range(2,x):
        if i**j<=x:ans=max(ans,i**j)
        else: break

print(ans)

Solution (Python):
n = int(input())
c = []
for i in range(n+1):
  for j in range(2,10):
    if i**j <= n:
      c.append(i**j)
print(max(c))

Solution (Python):
x = int(input())
exp = set()
for i in range(8):
    num = 1
    while True:
        temp = num ** (i + 2)
        if temp <= x:
            exp |= {temp,}
            num += 1
        else:
            break
print(max(exp))

Solution (Python):

X = int(input())
l = []

a = round(1000*0.5)

for i in range(2,a):
    j = 2
    b = 0
    while b <= 1000:
        b = i ** j
        if b <= 1000:
            l.append(b)
        j += 1

l.append(1)
l.sort()

ans_list =[]
for i in range(len(l)):
    if l[i] <= X:
        ans_list.append(l[i])
print(max(ans_list))

Solution (Python):
from math import ceil,sqrt

X = int(input())

ans = 0
p = ceil(sqrt(X))+1
for i in range(p):
    for j in range(p):
        if i**j <= X:
            ans = max(ans,i**j)

print(ans)

Solution (Python):

x = int(input())

res = 0
for b in range(1, x + 1):
    for p in range(2,100):
        y = pow(b, p)
        if y > x:
            break
        res = max(y, res)
        if res == x:
            break

print(res)

Solution (Python):
import math

x = int(input())






ans = 0
for i in range(2,x+1):
  tmp = 0
  j = 2
  tmp = i ** j
  while(tmp <= x):
    if ans <= i ** j:
      ans = i ** j
    j += 1
    tmp = i ** j
if ans == 0:
  print("1")
  quit()
print(ans)

Solution (Python):


def compute():
    x = int(input())
    if x == 1:
        print(1)
    else:
        beki = []
        for b in range(31, 1, -1):
            for p in range(9, 1, -1):
                beki.append(b**p)
        for y in sorted(beki)[::-1]:
            if y <= x:
                print(y)
                return
compute()

Solution (Python):
n = int(input())

ans = 0
  
i = 1
while i * i <= n:
  i += 1
  j = 1
  while j * i <= n:
    j *= i
  
  ans = max(ans, j)
  
print(ans)

Solution (Python):
from bisect import bisect_left

cand = [1]
for b in range(2, 32):
    for p in range(2, 10):
        cand.append(b ** p)
cand.sort()

X = int(input())
i = bisect_left(cand, X + 1)
print(cand[i-1])

Solution (Python):
X = int(input())
ans = 1
for b in range(2, 32):
    for p in range(1, 10):
        if b ** (p + 1) > X:
            break
    if p == 1:
        continue
    ans = max(ans, b ** p)
print(ans)

Solution (Python):
x=int(input())
ans=[]
c=0
for i in range(1,x+2):
    for j in range(2,x+3):
        c=i**j
        if c>x:
            break
        elif ans.count(c)==0:
            ans.append(c)
print(max(ans))

Solution (Python):
x = int(input())

ans = 1
for i in range(1, x):
    for j in range(2, x):
        if (i ** j) <= x:
            ans = max(ans, i ** j)
        else:
            break

print(ans)

Solution (Python):
x = int(input())
ans = []
for b in range(2,40):
    for p in range(2, 11):
        v = pow(b, p)
        if v <= x:
            ans.append(v)
        else:
            break
if len(ans) > 0:
    print(max(ans))
else:
    print(1)

Solution (Python):
X = int(input())
ansMax = 0
for i in range(1, X + 1):
    for j in range(2, X + 2):
        tmp = i ** j
        if X >= tmp:
            ansMax = max(ansMax, tmp)
        else:
            break

print(ansMax)

Solution (Python):
X=int(input())
ans=1
for b in range(1,32):
  for p in range(2,10):
      a=b**p
      if a>X:
        break
      if a>ans:
        ans=a
print(ans)

Solution (Python):
X = int(input())
ans = 1

for i in range(2,X+1):
    p = 2
    while (X >= i ** p):
        ans = max(ans, i ** p)
        p += 1
        
        
        

print(ans)

Solution (Python):
N = int(input())
num = 2
idx = 1
nums = [1]
while True:
  if num**idx > N:
    if idx == 2 or N in range(1, 5):
      break
    else:
      num += 1
      idx = 0
      continue
  else:
    nums.append(num**idx)
    idx += 1
nums.sort(key=lambda x:-x)
print(nums[0])

Solution (Python):
a = int(input())
b = int(a ** 0.5)
c = 0
d = 1
for i in range(2, b + 1):
    c = i
    while True:
        if c <= a:
            c = c * i
        else:
            c = c // i
            d = max(d, c)
            break
print(d)

Solution (Python):
X = int(input())

nums = []
for p in range(2, 10):
    for b in range(1, 33):
        if b ** p > X:
            break
        if b ** p <= X:
            nums.append(b ** p)

print(max(nums))

Solution (Python):
x=int(input())
lst=[]
for b in range(1,32):
    for q in range(2,11):
        if b**q <=x:
            lst.append(b**q)
        elif b**q>x:
            break
print(max(lst))