#include"stdio.h" int main() { int n; scanf("%d",&n); int i = 0; while(n--) { int num; scanf("%d",&num); i++; int w = 0; int k; for(k = 1; k <= num; k++) { w += (k*(k+1)*(k+2)/2); } printf("%d %d %d\n",i,num,w); } return 0; }