Pagini recente » Cod sursa (job #2034995) | Istoria paginii runda/ioi2023_ez/clasament | Istoria paginii runda/dddddcffdfhcstydtcufts/clasament | Monitorul de evaluare | Cod sursa (job #2012111)
#include <bits/stdc++.h>
#define ll long long
#define mp make_pair
#define pb push_back
#define x first
#define y second
#define oo 1000000000
#define PII pair <int, int>
using namespace std;
int n, tab[200100];
int main(){
ios_base::sync_with_stdio(0);cin.tie(0);
ifstream cin("sum.in");
ofstream cout("sum.out");
cin >> n;
for (int i = 1; i <= 100000; i++) tab[i] = i - 1;
for (int i = 2; i <= 100000; i++)
for (int j = i + i; j <= 100000; j += i)
tab[j] -= tab[i];
while (n--){
ll x;
cin >> x;
cout << 2 * x * tab[x] << "\n";
}
}