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