Find the smallest positive integer xxx such that φ(x)=n\varphi(x)=nφ(x)=n.
Input a positive integer nnn (n<231n<2^{31}n<231).
Output xxx. If x>231x>2^{31}x>231 or it does not exist, output −1-1−1.
4
5
Translated by ChatGPT 5
注册一个 33OJ 通用账户,您就可以在我们提供的所有在线评测服务上提交代码、参与讨论。
使用您的 33OJ 通用账户