#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    long long n;
    cin >> n;
    n = (n - 1) / 2;
    if (n == 0) {
      cout << 0 << endl;
    } else {
      long long x = 4 * ((n * (n + 1) * (2 * n + 1)) / 3);
      cout << x << endl;
    }
  }
  return 0;
}
