#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
const int MAX = 1000001; // We'll compute divisor counts up to 1e6+1.
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
// Precompute number of divisors for every number from 1 to MAX.
vector<int> divCount(MAX+1, 0);
for (int i = 1; i <= MAX; i++){
for (int j = i; j <= MAX; j += i){
divCount[j]++;
}
}
// Precompute maximum divisors of S(L) for L from 1 to maxN.
// Given constraints, maximum N can be up to 1e6.
const int maxN = 1000000;
vector<int> best(maxN+1, 0);
// For L=0 (not used) but for L>=1:
int currMax = 0;
for (int L = 1; L <= maxN; L++){
int dS;
if(L % 2 == 0){
// S(L) = (L/2) * (L+1)
dS = divCount[L/2] * divCount[L+1];
} else {
// S(L) = L * ((L+1)/2)
dS = divCount[L] * divCount[(L+1)/2];
}
currMax = max(currMax, dS);
best[L] = currMax;
}
// Process test cases.
int t;
cin >> t;
while(t--){
int N;
cin >> N;
cout << best[N] << "\n";
}
return 0;
}