Learning materials: https://blog.csdn.net/sentimental_dog/article/details/52002608
Note that the last line requires res/a*(a-1)
Because a itself can be modulo a, but i*i<=a, so there is no enumeration to a itself
#include <bits/stdc++.h> using namespace std; const int maxn=200000+10; #define LL long long intmain () { int n; LL m; ios::sync_with_stdio(0); cin>>n; for(int i=1;i<=n;i++) { cin>>m; cout<<(m-1)*euler(m)<<endl; } return 0; }