#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7, INF = 0x3f3f3f3f;
const long long LNF = 0x3f3f3f3f3f3f3f3f;
int main() {
  int T, n;
  cin >> T;
  while (T--) {
    cin >> n;
    long long x = (n - 1) / 2;
    cout << (x + 1) * (2 * x + 1) * x / 6 * 8 << endl;
  }
}
