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