#include <bits/stdc++.h>
int main() {
  long long int t, n, m;
  scanf("%lld", &t);
  while (t--) {
    scanf("%lld", &n), n--, m = 0;
    while (n > 0) m = m + ((n * 4) * (n / 2)), n = n - 2;
    printf("%lld\n", m);
  }
}
