#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t = 1, i, j, k;
  cin >> t;
  vector<long long int> ans;
  ans.push_back(0);
  for (i = 3; i < 500005; i += 2) {
    j = i / 2;
    j--;
    k = ans[j];
    k += (i / 2) * (2 * (i) + (2 * (i - 2)));
    ans.push_back(k);
  }
  while (t--) {
    long long int n, j;
    cin >> n;
    cout << ans[n / 2];
    cout << endl;
  }
  return 0;
}
