#include <bits/stdc++.h>
using namespace std;
using lli = long long;
using ld = long double;
using ii = pair<int, int>;
using vi = vector<int>;
using vii = vector<ii>;
const int N = 1e6 + 5;
int n;
lli dp[N];
void testCase() {
  cin >> n;
  cout << dp[n] << '\n';
}
int main() {
  cin.tie(0)->sync_with_stdio(0), cout.tie(0);
  dp[0] = 0;
  for (lli i = 3; i < N; i += 2) dp[i] = dp[i - 2] + (i / 2) * (4 * i - 4);
  int tc;
  cin >> tc;
  while (tc--) testCase();
  return 0;
}
