Problem I. Problem I. Count

时间限制 2000 ms   内存限制 512 MB

Multiple query, for each n, you need to get
n i-1
∑ ∑ [gcd(i + j, i - j) = 1]
i=1 j=1
 

输入数据

On the first line, there is a positive integer T, which describe the number of queries. Next there are T lines, each line give a positive integer n, as mentioned above.
T<=1e5, n<=2e7
 

输出数据

Your output should include T lines, for each line, output the answer for the corre- sponding n.
 

样例输入

复制
4
978
438
233
666

样例输出

复制
194041
38951
11065
89963

提交

请先 登录

© 2025 FAQs Contact About