#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  long long int arr[500010] = {0};
  long long int k = 8;
  long long int x = 1;
  for (long long int i = 3; i <= 500000; i += 2) {
    arr[i] = arr[i - 2] + k * x;
    x++;
    k = 8 * x;
  }
  while (t--) {
    long long int n;
    cin >> n;
    cout << arr[n] << "\n";
  }
  return 0;
}
