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