#include using namespace std; typedef long long int LL; const int MAXN = 1000*1000; LL dp[MAXN + 3], pref[MAXN + 3]; void Preprocessing(){ for(int i=1; i<=1000; i++){ for(int j=i; j<=1000; j++){ for(int k=j; (LL)i*j*k <= MAXN; k++){ dp[i*j*k]++; } } } /*for(int i=1; i<=10; i++) printf("%d ", dp[i]); puts("");*/ pref[1] = dp[1]; for(int i=2; i<=MAXN; i++) pref[i] = pref[i-1] + dp[i]; } int main(){ Preprocessing(); int t; scanf("%d", &t); while(t--){ int n; scanf("%d", &n); LL ans = 0; for(int i=1; i*i <= n; i++){ int m = n/(i*i); ans += m; } printf("%lld\n", pref[n] - ans); //printf("%lld %lld\n", pref[n], ans); } } /* * 1 1 1 2 1 2 1 3 2 2 5 5 -5 1 6 ^C */