#include <bits/stdc++.h>
using namespace std;
int SS() {
  long long int n, rslt = 0;
  cin >> n;
  for (int i = 1; i <= n / 2; ++i) rslt += pow(i, 2);
  cout << 8 * rslt << "\n";
  return 0;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int tt;
  cin >> tt;
  while (tt--) SS();
  return 0;
}
