#include <bits/stdc++.h>
using namespace std;
long long F(long long a) {}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long sum = 0;
    if (n == 1)
      sum = 0;
    else {
      for (long long i = 1; i <= n; i += 2) {
        long long p = i * 2 + 2 * (i - 2);
        sum += p * (i / 2);
      }
    }
    cout << sum << "\n";
  }
}
