#yuki1824 t=int(input()) for i in range(t): n=int(input()) res=0 res=2*(n-2)*(n-1)*n//3 print(res)