#include <bits/stdc++.h>
using namespace std;
long long be(long long a, long long b, long long mod) {
  if (b == 0) return 1;
  if (b % 2 == 1)
    return (a * be(a, b - 1, mod)) % mod;
  else
    return (be(a, b / 2, mod) * be(a, b / 2, mod)) % mod;
}
const long long mod = 1e9 + 7;
const long long siz = (1e5 + 10);
const long long logi = 21;
const double epsilon = 1e-6;
bool cmp(const long long &a, const long long &b) { return (abs(a - b) > 1); }
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t;
  t = 1;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long start = (n + 1) / 2;
    long long val = 0;
    long long sum = 0;
    for (long long i = start; i <= n; i++) {
      long long g = i - start;
      sum += g * val;
      val += 8;
    }
    cout << sum << "\n";
  }
}
