#include <bits/stdc++.h>
using namespace std;
long long n, m, v, c, x, z, a[1000001], s, d, f, g, h, j, k, b[100001], i, p, y,
    p1, q;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    cin >> n;
    s = 0;
    k = 8;
    for (long long i = 1; i <= n / 2; i++) {
      s += k * i * i;
    }
    cout << s << endl;
  }
}
