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