#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
long long t, n, p[1000005];
int main() {
  cin >> t;
  for (int i = 1; i < 500000 / 2; i++) p[i] = p[i - 1] + 8;
  while (t--) {
    cin >> n;
    long long sum = 0;
    for (int i = 1; i <= n / 2; i++) sum += p[i] * i;
    cout << sum << endl;
  }
  return 0;
}
