#include <bits/stdc++.h>
int main(void) {
  int t;
  scanf("%d", &t);
  while (t--) {
    long long n, ans = 0;
    scanf("%lld", &n);
    long long temp = n;
    for (long long i = 0; i < n / 2; i++) {
      ans += 4 * (temp - 1) * (temp / 2);
      temp -= 2;
    }
    printf("%lld\n", ans);
  }
  return 0;
}
