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