#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  for (int t = 0; t < T; t++) {
    long long n;
    cin >> n;
    long long k = (n - 1) / 2;
    cout << 8 * k * (k + 1) * (2 * k + 1) / 6 << endl;
  }
  return 0;
}
