#include <bits/stdc++.h>
using namespace std;
const unsigned int mod = 1000000007;
const int INF = 1000000001;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long an = 0;
    for (int i = 1; i < 1 + (n / 2); i++) {
      an += ((long long)8 * i * i);
    }
    cout << an << endl;
  }
}
