#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long i, j, k, n, t, x, l, r, m;
  cin >> t;
  while (t--) {
    cin >> n;
    k = n / 2;
    long long sum = 0, y, cnt = 1;
    x = 3;
    y = 1;
    while (k--) {
      sum += ((x * 2 * cnt) + (y * 2 * cnt));
      x += 2;
      y += 2;
      cnt++;
    }
    cout << sum << '\n';
  }
  return 0;
}
