#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    long long move = 0;
    for (int i = 1; i <= n / 2; ++i) {
      move += i * 1ll * i;
    }
    cout << move * 8 << endl;
  }
  return 0;
}
