#include <bits/stdc++.h>
using namespace std;
int t,n,k,l;
signed main(){
ios::sync_with_stdio(0);
cin.tie(0);
cin >> t;
while(t --){
cin >> n; k = n, l = 1;
float xh = 0.5f * n, tmp = n;
double xxh = 0.5 * n, ttmp;
int i = *(int*)&tmp;
i = 0x1fbd1df5 + (i >> 1);
ttmp = *(float*)&i;
ttmp = ttmp / 2 + xxh / ttmp;
ttmp = ttmp / 2 + xxh / ttmp;
n = ttmp / 2 + xxh / ttmp;
long long res = 0;
while(l <= n){
int r = k / (k / l);
res += 1ll * (r - l + 1) * (k / l);
l = r + 1;
}
printf("%lld\n", 2*res - 1ll*n*n);
}
return 0;
}