#include <bits/stdc++.h>
using namespace std;
const double PI = 3.1415926535897932384626433832795;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    if (n == 1) {
      cout << 0 << endl;
      continue;
    }
    unsigned long long jv = 8;
    unsigned long long s = 2;
    for (int i = 5; i <= n; i += 2) {
      jv += 4 * (i - 1) * s;
      s++;
    }
    cout << jv << endl;
  }
  return 0;
}
