eolymp
bolt
Try our new interface for solving problems
Problems

The inverse problem

The inverse problem

The young mathematician, Vasya continued his research in number theory. At this time he studied the concept of greatest common divisor of two integers (\textbf{GCD}). Recall that the \textbf{gcd} of two integers \textbf{a} and \textbf{b} is the largest integer for which \textbf{a} and \textbf{b} are divided without a remainder. Vasya calls the integer \textbf{x} with respect to the \textit{good} natural number \textbf{n}, if \textbf{gcd (x, n) = x}. For example, in relation to the number \textbf{4} would be good numbers \textbf{1}, \textbf{2} and \textbf{4}. Vasya was engaged in that calculated by the number \textbf{n}, the number of good towards him the numbers and eventually received a number \textbf{m}. But bad luck, he was so confused in his calculations, he could not remember the number for which he spent computing. Help him to look into this and find the smallest number for which he could get such a response. It is known that the number for which Vasya carried out the calculations does not exceed \textbf{10^18}. \InputFile The input file contains a unique number \textbf{m} (\textbf{1} ≤ \textbf{m} ≤ \textbf{1000}). \OutputFile In a single line output the smallest positive integer not exceeding \textbf{10^18} and has exactly \textbf{m} \textit{good} numbers, or \textbf{-1} if Vasya made ​​a mistake, and no such numbers.
Time limit 0.5 seconds
Memory limit 64 MiB
Input example #1
2
Output example #1
2
Author Evgeniy Sluzhaev