#include <bits/stdc++.h>
using namespace std;
int main() {
  int test;
  scanf("%d", &(test));
  for (int t = 1; t <= test; t++) {
    int n;
    scanf("%d", &(n));
    unsigned long long int sum = 0;
    for (unsigned long long int i = 1; i <= n / 2; i++) {
      sum = sum + (long long int)(8 * (i * i));
    }
    cout << sum << endl;
  }
  return 0;
}
