#include <bits/stdc++.h>
using namespace std;
int t;
long long n, k, j;
int main() {
  cin >> t;
  while (t--) {
    cin >> n;
    long long ans = 0;
    k = n / 2;
    j = n / 2;
    for (int i = 1; i <= k; i++) {
      ans += (4 * n - 4) * j;
      j--;
      n -= 2;
    }
    cout << ans << endl;
  }
  return 0;
}
