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