#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long n, t, k, i, x, edge, sum;
  cin >> t;
  while (t--) {
    sum = 0;
    cin >> n;
    if (n == 1)
      cout << "0" << endl;
    else {
      k = 1;
      x = 1;
      edge = 8;
      n = floor((n / 2.00));
      for (int i = 0; i < n; i++) {
        sum += (edge * k) * x;
        k++;
        x++;
      }
      cout << sum << endl;
    }
  }
  return 0;
}
