#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long t;
  cin >> t;
  while (t--) {
    unsigned long long n, k;
    cin >> n;
    n /= 2;
    unsigned long long ans = n * (n + 1) * (2 * n + 1);
    ans /= 6;
    ans *= 8;
    cout << ans << endl;
  }
}
