Cod sursa(job #2796211)
Utilizator | Data | 7 noiembrie 2021 18:47:08 | |
---|---|---|---|
Problema | Sum | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.35 kb |
#include<fstream>
using namespace std;
ifstream F("sum.in");
ofstream G("sum.out");
#define N 100001
int i,j,e[N];
int main()
{
for(i=2;i<N;++i)
e[i]=i;
for(i=2;i<N;++i)
if(e[i]==i)
for(j=i;j<N;j+=i)
e[j]/=i*(i-1);
for(F>>i;i;--i)
F>>j,G<<1LL*e[j]*2*j<<'\n';
return 0;
}