rt.
#include <iostream>
#include <cmath>
#define int long long
using namespace std;
int pre[10005];
signed main() {
for (int i = 1; i <= 9999; i++) {
pre[i] = (int)pow(i + 1, 3) - (int)pow(i, 3);
}
pre[10000] = 1;
int t;
cin >> t;
while (t--) {
int x;
cin >> x;
int st = 1;
int res = 0;
while (pre[st] <= x && x) {
res = res + st * pre[st];
x -= pre[st];
++st;
}
cout << res + x * st << endl;
}
}