#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int e = n / 2;
    long long int sum = 0;
    for (; e > 0; e--) {
      sum += (4 * n - 4) * e;
      n -= 2;
    }
    cout << sum << endl;
  }
}
