#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int temp = n / 2;
    long long int ans = temp * (temp + 1) * 2;
    long long int result = 0;
    if (n == 1)
      result = 0;
    else {
      long long int j = 2 * temp - 1;
      for (int i = temp; i > 0; i--) {
        result += j * i;
        j -= 2;
      }
      result = result * 4;
      result += ans;
    }
    ans = result;
    cout << ans << endl;
  }
}
