#pragma GCC optimize("Ofast,no-stack-protector") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include #define ff(i, a, b) for(int i=(a); (i <= (b)); ++i) #define FF(i, a, b) for(int i=(a); (i >= (b)); --i) #define fin( v , a ) for(auto v : a ) #define ll long long #define random(a, b) (rand() % (b - a + 1) + a) #define pi 3.141592653589793238462643383279502884 #define INRA(a,u,v) {cout << "_\n"; ff(i,u,v) cout << a[i].x << " " << a[i].y << endl; cout << "|\n";} #define pb push_back #define mp make_pair #define y1 ahsclskajlasjdkl #define x1 akjadhaskdals using namespace std; // Fast IO ******************************************************************************************************** const int __BS = 4096; static char __bur[__BS + 16], *__er = __bur + __BS, *__ir = __er; template T readInt() { auto c = [&]() { if (__ir == __er) std::fill(__bur, __bur + __BS, 0), cin.read(__bur, __BS), __ir = __bur; }; c(); while (*__ir && (*__ir < '0' || *__ir > '9') && *__ir != '-') ++__ir; c(); bool m = false; if (*__ir == '-') ++__ir, c(), m = true; T r = 0; while (*__ir >= '0' && *__ir <= '9') r = r * 10 + *__ir - '0', ++__ir, c(); ++__ir; return m ? -r : r; } static char __buw[__BS + 20], *__iw = __buw, *__ew = __buw + __BS; template void writeInt(T x, char endc = '\n') { if (x < 0) *__iw++ = '-', x = -x; if (x == 0) *__iw++ = '0'; char* s = __iw; while (x) { T t = x / 10; char c = x - 10 * t + '0'; *__iw++ = c; x = t; } char* f = __iw - 1; while (s < f) swap(*s, *f), ++s, --f; if (__iw > __ew) cout.write(__buw, __iw - __buw), __iw = __buw; *__iw++ = endc; } template void writeStr(const T& str) { int i = 0; while (str[i]) { *__iw++ = str[i++]; if (__iw > __ew) cout.write(__buw, __iw - __buw), __iw = __buw; } } struct __FL__ { ~__FL__() { if (__iw != __buw) cout.write(__buw, __iw - __buw); } }; static __FL__ __flushVar__; //******************************************************************************************************************* template void minimize(X &a, const Y &b) { a = (b void maximize(X &a, const Y &b) { a = (b>a) ? b : a; } const int M = 1000000000+7; const int MN = 1000000+10; struct re { int x, y; re () {}; re (int X, int Y) {x = X; y = Y;}; /*const bool operator < (const re &a) const{ if (x!=a.x) return x a; int main() { ios_base::sync_with_stdio(false); cin.tie(0); //freopen("checking.inp", "r" , stdin); //freopen("checking.out", "w", stdout); ff(i,2,1000000) if (!kt[i]) { nt[++cnt] = i; ff(j,i,1000000/i) kt[i*j] = 1; } cin >> t; while (t--) { cin >> n; if (n == 1) { res += 1; continue; } a.clear(); ff(i,1,cnt) { while (n % nt[i] == 0) a.push_back(nt[i]), n /= nt[i]; } if (n > 1) a.push_back(n); res += 1; ll tmp = 1; FF(i, a.size()-1, 0) { tmp *= a[i]; res += tmp; } } cout << res; } //This code belongs to S34vv1nd :3