#include <bits/stdc++.h>
using namespace std;
void INP();
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  if (0) return;
  cout << name << " : " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  if (0) return;
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
void alpha() {
  long long int n;
  cin >> n;
  if (n == 1) {
    cout << 0 << '\n';
    return;
  }
  if (n == 3) {
    cout << 8 << '\n';
    return;
  }
  long long int ans = 8;
  long long int steps = 2;
  for (long long int i = 5; i <= n; i += 2) {
    long long int cell_num = 2 * i + 2 * (i - 2);
    ans += cell_num * steps;
    steps++;
  }
  cout << ans << '\n';
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  INP();
  long long int t = 1;
  cin >> t;
  while (t--) alpha();
  return 0;
}
inline void INP() {}
