#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t != 0) {
    int n;
    cin >> n;
    long long m = (n - 1) / 2;
    long long sum = m * (m + 1) * (2 * m + 1) / 6;
    long long raspuns = 8 * sum;
    cout << raspuns << '\n';
    t--;
  }
}
