大概题意就是求\(1 \le i,j \le n\)的\(gcd(i,j) = 1\)的个数+2(对于0的特判)
正解应该是欧拉函数或者高逼格的莫比乌斯反演 但数据实在太水直接打表算了/*H E A D*/bool GCD[1002][1002];inline int gcd(int a,int b){return b?gcd(b,a%b):a;}int main(){ rep(i,1,1000) rep(j,1,1000) GCD[i][j]=bool(gcd(i,j)==1); int T=read(),kase=0; while(T--){ int n=read(); if(n==1){ printf("%d %d 3\n",++kase,n); continue; } int ans=0; rep(i,1,n) rep(j,1,n) ans+=GCD[i][j]; ans+=2; printf("%d %d %d\n",++kase,n,ans); } return 0;}