#include <bits/stdc++.h>
using namespace std;
long long M = 1e9 + 7;
long long mm(long long x, long long y) {
  x %= M, y %= M;
  return (x * y) % M;
}
long long po(long long x, long long y) {
  if (!y) return 1;
  long long a = po(x, y / 2) % M;
  if (y % 2) return mm(a, mm(a, x));
  return mm(a, a);
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m, c = 0, t = 1, i, j, k, sum = 0, f = 0, x, y;
  cin >> t;
  while (t--) {
    cin >> n;
    n = n / 2 + 1;
    cout << (((n - 1) * n * (2 * n - 1)) / 3) * 4 << endl;
  }
  return 0;
}
