#include <bits/stdc++.h>
using namespace std;
bool cmp(const pair<long long, long long> &a,
         const pair<long long, long long> &b) {
  return (a.second < b.second);
}
long long power(long long x, long long y) {
  long long res = 1;
  x = x;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = (res * x);
    y = y >> 1;
    x = (x * x);
  }
  return res;
}
int main() {
  long long t = 1, i, j, k, x, y, z, n, m;
  cin >> t;
  while (t--) {
    cin >> n;
    if (n == 1) {
      cout << "0\n";
      continue;
    }
    long long p = 8;
    long long sum = 0;
    for (i = 1; i <= (n / 2); i++) {
      p = 8 * i;
      sum = sum + (p * i);
    }
    cout << sum << endl;
  }
  return 0;
}
