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