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