#include <bits/stdc++.h>
using namespace std;
int main() {
  long long unsigned t, n, m, i, j, ans = 0;
  cin >> t;
  while (t--) {
    ans = 0;
    cin >> n;
    for (i = 1; i <= n / 2; i++) {
      ans += i * (i * 8);
    }
    cout << ans << endl;
  }
  return 0;
}
