ll d[1d7+1]{}; rep(i,2,1d7+1){ d[i]=i; } rep(i,2,1d7+1){ if(d[i]==i){ rep(j,i,1d7+1,i){ d[j]-=d[j]/i; } } d[i]=d[i-1]-d[i]+i*2-2; } ll@t; rep(t){ ll@n; wt(d[n]); }