#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  long long int n;
  while (t--) {
    cin >> n;
    long long int k = n / 2;
    long double s = 4.0 * (k) * (k + 1);
    long double y = 0.0;
    for (long long int i = 2; i <= k; i++) y = y + i * (i - 1);
    y = y * 8;
    string p = to_string(s + y);
    for (int i = 0; i < p.length(); i++) {
      if (p[i] == '.')
        break;
      else
        cout << p[i];
    }
    cout << endl;
  }
}
