#P2350. [HAOI2012] 外星人
[HAOI2012] 外星人
Description
Elio found a number on her quilt. She wants to find the smallest such that . Based on this , she can find clues about the aliens who once abducted her. Of course, she will not do the computation herself; please help her compute the minimal .
denotes iterating times, not an exponent.
Input Format
The first line contains a positive integer . Then for each of the test cases, the first line contains a positive integer , followed by lines, each containing two positive integers .
Here is the standard factorization form of , and denotes a product.
Output Format
Output lines, each containing one integer, the answer.
1
2
2 2
3 1
3
Hint
is Euler's totient function. is the number of integers not exceeding that are coprime to . Hint: $\varphi(\prod_{i=1}^mp_i^{q_i})=\prod_{i=1}^m(p_i-1)\times p_i^{q_i-1}$.
Constraints
- For 30% of the testdata, .
- For 60% of the testdata, .
- For 100% of the testdata, , , , .
Translated by ChatGPT 5
京公网安备 11011102002149号