#P2019. 四平方和定理
四平方和定理
Description
For a positive integer , find the number of ordered quadruples of integers such that . The answer is taken modulo .
Input Format
This problem has multiple test cases.
The first line contains an integer , the number of test cases.
For each test case, one line contains a positive integer, representing the value of .
Output Format
Output a total of lines.
On the -th line, output a non-negative integer, which is the answer for the -th test case modulo .
10
4
1000
200000
802241960520
999999999937
49770428644836900
250000006000000027
729021870143100133
900000000000000017
907000000000033559
24
3744
93744
59948653
999943511
821944886
26
729842040
600000501
152276389
Hint
| Test point ID | Limit |
|---|---|
| None |
For all testdata, .
For the first test case of Sample 1, the following are all valid (not all feasible quadruples are listed here).
$$(1,1,1,1),(1,1,1,-1),(-1,-1,-1,-1),(2,0,0,0),(0,-2,0,0)$$Translated by ChatGPT 5
京公网安备 11011102002149号