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