#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  unsigned long long s = 0;
  if (n > 1) {
    n = n / 2;
    s = n;
    s = s * (n + 1);
    s = s * (2 * n + 1);
    s = s / 6;
    s = s * 8;
  }
  cout << s << endl;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
