#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const long long INF = 1e18;
const char nl = '\n';
const int N = 300001;
void solve() {
  int n;
  cin >> n;
  long long ans = 0;
  for (long long i = 1; i <= n / 2; ++i) {
    ans += i * i;
  }
  cout << ans * 8 << nl;
}
int main() {
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
