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