输入数据组数 ttt。
接下来 ttt 行每行给定一个数字 nnn,输出:
∑a=1n∑b=1n[gcd(a,b)=(axorb)]\sum\limits_{a=1}^n\sum\limits_{b=1}^n[\gcd(a,b)=(a\operatorname{xor} b)]a=1∑nb=1∑n[gcd(a,b)=(axorb)]
其中 xor\operatorname{xor}xor 表示按位异或。
输出格式见样例。
translated by @AdzearDisjudge