#P1630. 求和
求和
Description
Find the remainder when the sum is divided by .
Input Format
This problem contains multiple test cases.
The first line contains an integer , indicating that there are test cases.
For each test case, one line contains two integers .
Output Format
For each test case, output one integer per line, the answer.
1
2 3
9
Hint
For 30% of the testdata, , .
For 100% of the testdata, , .
Translated by ChatGPT 5
京公网安备 11011102002149号