#P7486. 「Stoi2031」彩虹
「Stoi2031」彩虹
Description
Hong is a girl who likes to daydream. She thinks the dependence value of two positive integers is . She defines the product of the dependence values of all satisfying as the obstacle value of two positive integers . Now she gives you a positive integer , and asks you queries. In each query, you are given two positive integers satisfying . You need to output the obstacle value .
Input Format
The first line contains two positive integers .
The next lines each contain two positive integers , representing one query.
Output Format
For each query, output one integer representing the answer.
3 7
1 3
2 3
7 7
21072733
12145631
823543
Hint
Brief statement:
Given , compute $\prod\limits_{i=l}^{r}\prod\limits_{j=l}^{r}\operatorname{lcm}(i,j)^{\operatorname{lcm}(i,j)} \bmod{32465177}$. There are multiple queries.
Sample explanation:
For the 1st query, $ans = 1^1 \times (2^2)^3 \times (3^3)^3 \times (6^6)^2$, and .
For the 2nd query, , and .
For the 3rd query, .
Constraints:
For of the testdata, .
For of the testdata, .
For of the testdata, $1 \le n \le 10^6, 1 \le t \le 10, 1 \le l_i \le r_i \le n$.
Translated by ChatGPT 5
京公网安备 11011102002149号