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