#include <bits/stdc++.h>
using namespace std;
const int nax = 200000 + 10;
long long int n, a[nax], b[nax];
int main() {
  int t;
  cin >> t;
  while (t--) {
    cin >> n;
    n /= 2;
    n = (n + 1) * (n) * (2 * n + 1);
    n /= 6LL;
    n *= 8LL;
    cout << n << endl;
  }
  return 0;
}
