luogu#P5176. 公约数
公约数
Background
In the last five minutes before collecting the papers, pg found that there was still a major problem on the back side of the paper.
Problem Description
Compute
Since the answer may be too large, output the value of the answer modulo .
Input Format
The first line contains a positive integer , the number of test cases.
The next lines each contain integers: .
Output Format
Output lines. Each line contains one integer, the answer.
2
10 12 11
30 20 25
25302
573830
Hint
For the first of the testdata, , and .
For another of the testdata, , and .
For another of the testdata, , and .
For the remaining of the testdata, , and .
Translated by ChatGPT 5
