#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t, n, r;
  cin >> t;
  while (t--) {
    cin >> n;
    n = (n - 1) / 2;
    r = (8 * n * (n + 1) * ((2 * n) + 1)) / 6;
    cout << r << "\n";
  }
  return 0;
}
