#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7, A = 2e5 + 2;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int tc, n;
  cin >> tc;
  while (tc--) {
    cin >> n;
    long long ans = 0;
    bool even = n % 2 == 0;
    if (n % 2 == 0) n++;
    for (int i = 0; i < n / 2; i++) {
      long long cels = ((n - i * 2) + (n - i * 2 - 2)) * 2;
      long long dist = (n / 2 - i);
      ans += cels * dist;
    }
    if (even) {
      long long cels = n + (n - 1);
      long long dist = n / 2;
      ans -= cels * dist;
    }
    cout << ans << '\n';
  }
  return 0;
}
