#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  long long sm, n;
  for (int i = 0; i < t; i++) {
    cin >> n;
    sm = 0;
    for (int j = 0; j < n - 1; j += 2) {
      sm = sm + (n - j - 1) * (n - j + n - j - 2);
    }
    cout << sm << endl;
  }
}
