#include #include using namespace std; using LL = long long; LL t[1000008]; int main() { for (int i = 0; i < 1000002; i++){ t[i] = -1; } int tests; scanf("%d", &tests); for (int testc = 0; testc < tests; testc++) { int n; LL ans = 0LL; scanf("%d", &n); if (t[n] != -1) { printf("%lld\n", t[n]); continue; } for (int i = 1; i*i*i < n; i++){ for (int j=i+1; i*j*(j+1)<=n; j++) { //printf("%d %d\n", i, j); ans += n / i / j - j; } } t[n] = ans; printf("%lld\n", ans); } return 0; }