#include #include #include #include #include #define maxn 500000 using namespace std; long long sum[maxn]; long long sum2[maxn]; void init(){ sum[1] = sum2[1] = 1; for(long long i = 2; i <= 200000LL; i++){ sum[i] = sum[i-1] + i; sum2[i] = sum2[i-1] + i*i; } } long long calc(long long N){ long long ans = 0; if(N <= 3)return 0; for(int i = 1; 2*i+3<=N; i++){ ans += (2*(long long)i * (sum[N-i-2] - sum[i])); } ans += sum2[(N-2)/2]; return ans; } int main(){ init(); int T; long long x; cin >> T; while(T--){ cin >> x; cout << calc(x)+x << endl; } return 0; }