#include using namespace std; #define PII pair #define VI vector #define VPII vector #define LL long long #define f first #define s second #define MP make_pair #define PB push_back #define LD long double #define endl '\n' #define ALL(c) (c).begin(), (c).end() #define SIZ(c) (int)(c).size() #define REP(i, n) for (int i = 0; i < (int)(n); i++) #define FOR(i, b, e) for (int i = (b); i <= (int)(e); i++) #define FORD(i, b, e) for (int i = (b); i >= (int)(e); i--) #define ll LL #define mp MP #define pb PB #define st f #define nd s #define eb emplace_back const int inf = 1e9 + 7; const LL INF = 1e18L + 7; #define sim template ostream & operator << (ostream &p, pair x) {return p << "<" << x.f << ", " << x.s << ">";} sim> auto operator << (ostream &p, n y) -> typename enable_if::value, decltype(y.begin(), p)>::type {int o = 0; for (auto c : y) {if (o++) p << ", "; p << c;} return p << "}";} void dor() {cerr << endl;} sim, class...s> void dor(n p, s...y) {cerr << p << " "; dor(y...);} sim, class s> void mini(n &p, s y) {if (p > y) p = y;} sim, class s> void maxi(n &p, s y) {if (p < y) p = y;} #ifdef DEB #define debug(...) dor(__FUNCTION__, ":", __LINE__, ": ", __VA_ARGS__) #else #define debug(...) #endif #define I(x) #x " =", (x), " " #define A(a, i) #a "[" #i " =", i, "] =", a[i], " " const int N = 1e6+7; ll ans[N]; int divs[N]; int main() { ios_base::sync_with_stdio(0); cin.tie(NULL); for(int i = 1; i < N; ++i) { for(int j = i; j < N; j += i) { ++divs[j]; } } for(int i = 1; i < N; ++i) { for(int j = i; j < N; j += i) { ans[j] += divs[j/i]; if((j/i)%i==0) ans[j] -= 3; if((ll)i*i*i==j) ans[j] += 2; } } for(int i = 1; i < N; ++i) { ans[i] += ans[i-1]; } int q; cin >> q; while(q--) { int v; cin >> v; cout << ans[v]/6 << endl; } }