#P5535. 【XR-3】小道消息
【XR-3】小道消息
Description
Xiao X wants to study how fast a rumor spreads, so he did a social experiment.
There are people. The number on person 's clothes is . Xiao X found a rule: if a person whose clothing number is learns a piece of information on some day, then on the next day he will tell this information to every person whose clothing number is such that (that is, the greatest common divisor of and is ). On day , Xiao X tells a rumor to the -th person. Xiao X wants to know on which day everyone will know this rumor.
It can be proven that such a day when everyone knows the rumor must exist.
Hint: You may need the following theorem — Bertrand–Chebyshev theorem.
Input Format
One line with positive integers .
Constraints:
- .
- .
Output Format
One line with one positive integer, the answer.
3 1
2
6 4
1
Hint
Explanation for Sample
The clothing numbers of the people are 2 3 4.
On day , Xiao X tells a rumor to person , whose clothing number is .
On day , person will tell person because , but he will not tell person because .
On day , person will tell person because . Now everyone knows the rumor, so the answer is .
Translated by ChatGPT 5
京公网安备 11011102002149号