#P4780. Phi 的反函数

    ID: 5537 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 显示难度提高 上传者: 标签>搜索枚举素数判断,质数,筛法

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