#include using namespace std; #define ll long long #define ull unsigned long long ll counts[1000001]; ll pcounts[1000001]; int main() { ios::sync_with_stdio(false); for(int x = 1; x*(x+1)*(x+2) <= 1000000; x++) { for(int y = x+1; x*y*(y+1) <= 1000000; y++) { for(int z = y+1; x*y*z <= 1000000; z++) { counts[x*y*z]++; } } } pcounts[0] = counts[0]; for(int i = 1; i <= 1000000; i++) { pcounts[i] += counts[i] + pcounts[i-1]; } ll T; cin >> T; for(int i = 0; i < T; i++) { ll N; cin >> N; cout << pcounts[N] << endl; } return 0; }