#include <bits/stdc++.h>
using namespace std;
unsigned long long t, n;
unsigned long long sqr(unsigned long long a) { return a * a; }
int main() {
  cin >> t;
  while (t--) {
    cin >> n;
    unsigned long long k = n / 2;
    unsigned long long ans = 0;
    for (unsigned long long i = 1; i <= k; i++) {
      ans += i * (sqr(2 * i + 1) - sqr(2 * i - 1));
    }
    cout << ans << endl;
  }
}
