#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long sum = 0;
    long long ac = 1;
    long long kc = 1;
    for (long long i = 3; i <= n; i += 2) {
      sum += (kc++) * ((i * i) - ac);
      ac = i * i;
    }
    cout << sum << "\n";
  }
  return 0;
}
