#P16077. [ICPC 2023 NAC] Power of Divisors

[ICPC 2023 NAC] Power of Divisors

题目描述

Consider a positive integer n n . Let f(n) f(n) be the number of positive integer divisors of n n . For example, if n=8 n = 8 then f(n)=4 f(n) = 4 , since the divisors of 8 8 are 1,2,4 1, 2, 4 and 8 8 .

Now, consider a positive integer x x . What is the smallest value of n n such that nf(n)=x n^{f(n)} = x ?

输入格式

The single line of input contains a single integer x x (1x1018 1 \le x \le 10^{18} ). This is the x x of the statement above.

输出格式

Output a single integer, which is the smallest value of n n such that nf(n)=x n^{f(n)} = x , or 1 -1 if no such value of n n exists.

15625
25
64000000
20
65536
-1