#include <bits/stdc++.h>
using namespace std;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= 1000000007;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % 1000000007;
    a = a * a % 1000000007;
  }
  return res;
}
void stringsplitter(string s, string delim, string arr[]) {
  char *ptr = strtok((char *)s.c_str(), (char *)delim.c_str());
  long long i = 0;
  while (ptr != NULL) {
    arr[i] = ((string)ptr);
    ptr = strtok(NULL, (char *)delim.c_str());
    i++;
  }
}
long long string_to_int(string s) {
  long long ans = 0;
  long long p = 1;
  for (long long i = s.size() - 1; i >= 0; i--) {
    ans += (s[i] - '0') * p;
    p *= 10;
  }
  return ans;
}
void t_c_c() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long tc;
  cin >> tc;
  while (tc--) {
    long long n;
    cin >> n;
    long long ans = 0;
    for (long long i = 1; i <= n / 2; ++i) {
      ans += i * i;
    }
    cout << ans * 8 << "\n";
  }
}
int32_t main() {
  t_c_c();
  return 0;
}
