AtCoder Beginner Contest 097
B
Exponential
AtCoder
⌀ 207
原题
← AC →
翻译中…

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$.

翻译中…

样例

Input #1
10
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$.
Input #2
1
Output #2
1
Input #3
999
Output #3
961
题目信息
题号
abc097_b
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。