Type: FileIO (power) 1000ms 256MiB

四方定理

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

四方定理是众所周知的:任意一个正整数nn,可以分解为不超过四个整数的平方和。例如:25=12+22+22+4225=1^{2}+2^{2}+2^{2}+4^{2},当然还有其他的分解方案,25=42+3225=4^{2}+3^{2}25=5225=5^{2}。给定的正整数nn,编程统计它能分解的方案总数。注意:25=42+3225=4^{2}+3^{2}25=32+4225=3^{2}+4^{2}视为一种方案。

输入格式

第一行为正整数tt(t100t\le 100),接下来tt行,每行一个正整数nn(n32768n\le 32768)。

输出格式

对于每个正整数nn,输出方案总数。

样例 #1

样例输入 #1

1
2003

样例输出 #1

48

B班第八天测试

Not Attended
Status
Done
Rule
Ledo
Problem
11
Start at
2025-7-28 19:00
End at
2025-7-28 21:00
Duration
2 hour(s)
Host
Partic.
8