#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long int n, k = 0;
    cin >> n;
    while (n >= 1) {
      k = k + (2 * (n - 1) * (n - 1));
      n = n - 2;
    }
    cout << k << "\n";
  }
}
