#P5655. 基础数论函数练习题
基础数论函数练习题
Description
Given an array of length , answer queries of $\operatorname{lcm}(a_l, a_{l + 1}, \ldots , a_{r - 1}, a_r)$.
Since the output can be large, you only need to output the answer modulo .
Input Format
This problem contains multiple test cases.
The first line contains a positive integer , indicating the number of test cases.
For each test case, the first line contains two positive integers .
In the next lines, the -th line contains a positive integer .
In the next lines, each line contains two positive integers (), representing one query.
Output Format
For each query, output one integer per line, representing the answer.
1
3 3
63
70
112
1 2
1 3
2 3
630
5040
560
Hint
| Test Point ID | ||
|---|---|---|
For of the testdata, , .
Translated by ChatGPT 5
京公网安备 11011102002149号