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