#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, n, m, t, k;
  cin >> t;
  while (t--) {
    cin >> n;
    if (n == 1) {
      cout << "0"
           << "\n";
    } else {
      long long u = 1, result = 0;
      for (i = 3; i <= n; i += 2) {
        result += (8 * u * u);
        u++;
      }
      cout << result << "\n";
    }
  }
  return 0;
}
