#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  if (n == 1) {
    cout << 0 << endl;
    return;
  }
  long long sum = 0, count = 8;
  for (int i = 1; i <= n / 2; i++) {
    sum += count * i;
    count += 8;
  }
  cout << sum << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
