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