#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    if (n < 3) {
      cout << "0" << endl;
      continue;
    }
    long long a1 = 2, d = 1;
    long long ans = 0;
    for (int i = 0; i < (n / 2); i++) {
      ans += ((a1 * 4) * d);
      a1 += 2;
      d++;
    }
    cout << ans << endl;
  }
  return 0;
}
