#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    if (n == 1)
      cout << 0 << "\n";
    else {
      double number = n / 2;
      double diagonal = 4 * number / 2 * (1 + number);
      double sides = 0;
      for (long long i = 1, z = 1; i <= n / 2; i++, z += 2) {
        sides += i * (z);
      }
      cout << setprecision(17) << diagonal + sides * 4 << "\n";
    }
  }
}
