#include <bits/stdc++.h>
const int N = 500001;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int a[N];
  a[1] = 0;
  for (int i = 3; i < N; i += 2) {
    a[i] = a[i - 2] + 4ll * (i - 1) * (i / 2);
  }
  int t;
  cin >> t;
  while (t--) {
    int i;
    cin >> i;
    cout << a[i] << '\n';
  }
}
