#include #include #include using namespace std; typedef long long llint; typedef pair pii; const int MAXC = 1 << 17; llint cnt[MAXC]; int main(void) { for (int i = 1; i <= 1000000; ++i) for (int j = i; j <= 1000000; ++j) { if ((llint)i*j >= MAXC) break; for (int k = j; k <= 1000000; ++k) { if ((llint)i*(llint)j*k >= MAXC) break; if (i == j) continue; if (i == k) continue; if (j == k) continue; cnt[i*j*k] += 1; } } for (int i = 1; i < MAXC; ++i) cnt[i] += cnt[i-1]; int t = 0; scanf("%d", &t); for (int i = 0; i < t; ++i) { int x; scanf("%d", &x); printf("%lld\n", cnt[x]); } return 0; }