#include <bits/stdc++.h>
using namespace std;
int main(void) {
  ios_base::sync_with_stdio(0);
  long long int t, n, m, val, ans = 0, dp[500005];
  dp[1] = 0;
  dp[3] = 8;
  for (long long int i = 5; i <= 500005; i += 2) {
    dp[i] = dp[i - 2] + (i * 4 - 4) * (i / 2);
  }
  cin >> t;
  while (t--) {
    cin >> n;
    cout << dp[n] << endl;
  }
  return 0;
}
