#include <bits/stdc++.h>
using namespace std;
void solution() {
  int T;
  cin >> T;
  while (T--) {
    long long n;
    cin >> n;
    if (n == 1) {
      cout << 0 << '\n';
      continue;
    } else {
      long long k = 3;
      long long ans = 0;
      long long count = 1;
      while (k <= n) {
        long long d = (k * k) - (k - 2) * (k - 2);
        ans += d * count;
        count++;
        k = k + 2;
      }
      cout << ans << '\n';
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  solution();
  return 0;
}
