luogu#P4780. Phi 的反函数

Phi 的反函数

Problem Description

Find the smallest positive integer xx such that φ(x)=n\varphi(x)=n.

Input Format

Input a positive integer nn (n<231n<2^{31}).

Output Format

Output xx. If x>231x>2^{31} or it does not exist, output 1-1.

4
5

Hint

Translated by ChatGPT 5