You are given a board of size $n \times n$, where $n$ is odd (not divisible by $2$). Initially, each cell of the board contains one figure.

In one move, you can select exactly one figure presented in some cell and move it to one of the cells sharing a side or a corner with the current cell, i.e. from the cell $(i, j)$ you can move the figure to cells:   $(i - 1, j - 1)$;  $(i - 1, j)$;  $(i - 1, j + 1)$;  $(i, j - 1)$;  $(i, j + 1)$;  $(i + 1, j - 1)$;  $(i + 1, j)$;  $(i + 1, j + 1)$; 

Of course, you can not move figures to cells out of the board. It is allowed that after a move there will be several figures in one cell.

Your task is to find the minimum number of moves needed to get all the figures into one cell (i.e. $n^2-1$ cells should contain $0$ figures and one cell should contain $n^2$ figures).

You have to answer $t$ independent test cases.


-----Input-----

The first line of the input contains one integer $t$ ($1 \le t \le 200$) — the number of test cases. Then $t$ test cases follow.

The only line of the test case contains one integer $n$ ($1 \le n < 5 \cdot 10^5$) — the size of the board. It is guaranteed that $n$ is odd (not divisible by $2$).

It is guaranteed that the sum of $n$ over all test cases does not exceed $5 \cdot 10^5$ ($\sum n \le 5 \cdot 10^5$).


-----Output-----

For each test case print the answer — the minimum number of moves needed to get all the figures into one cell.


-----Example-----
Input
3
1
5
499993

Output
0
40
41664916690999888

Difficulty: EASY

Solutions:
for i in range(int(input())):
	n = int(input())
	s = (n - 1) // 2
	ans = (s + 1) * (2 * s + 1)
	ans1 = s * ans
	ans2 = ans1 // 6
	print(ans2 * 8)


for _ in range(int(input())):
	n = int(input())
	x = 1
	ans = 0
	for i in range(3, n + 1, 2):
		k1 = i ** 2 - (i - 2) ** 2
		ans += k1 * x
		x += 1
	print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	ans = 0
	if n == 1:
		print(0)
	else:
		for j in range(1, n // 2 + 1):
			ans = ans + j * j
		ans *= 8
		print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	totSum = 0
	for num in range(n // 2, 0, -1):
		totSum = totSum + n * 2 * num + (n - 2) * 2 * num
		n = n - 2
	print(totSum)


t = int(input())
while t:
	n = int(input())
	m = n // 2
	summ = 4 * m * (m + 1) * (2 * m + 1) / 3
	print(int(summ))
	t = t - 1


tc = int(input())
for i in range(0, tc):
	sum = 0
	n = int(input())
	start = (n + 1) / 2 - 1
	temp = n - 1
	while start != 0:
		sum = sum + 4 * temp * start
		start = start - 1
		temp = temp - 2
	sum = int(sum)
	print(sum)


for _ in range(int(input())):
	n = int(input())
	p = n // 2
	print(4 * p * (p + 1) * (2 * p + 1) // 3)


for i in range(int(input())):
	n = int(input())
	ans = 0
	if n != 1:
		c = 1
		for i in range(2, n + 1):
			if i & 1:
				ans += (2 * i + 2 * (i - 2)) * c
				c += 1
		print(ans)
	else:
		print('0')


t = int(input())

def func1():
	n = float(input())
	su = 0
	for i in range(int((n + 1) / 2)):
		su += i ** 2
	su *= 8
	return su
for i in range(1, t + 1):
	print(func1())


test = int(input())
for i in range(0, test):
	i = int(input())
	sol = (i ** 3 - i) // 3
	print(sol)


for _ in range(int(input())):
	n = int(input())
	k = n // 2
	c = 0
	p = n * 4 - 4
	for x in range(1, k + 1):
		c += (p - 4) * x + 4 * x ** 2
		p -= 8
	print(c)


import math
t = int(input())
for _ in range(0, t):
	n = int(input())
	ans = 0
	for i in range(1, int((n + 1) / 2)):
		ans += 8 * i * i
	print(ans)


import math
t = int(input())
for _ in range(t):
	n = int(input())
	mid = int(math.ceil(n / 2)) - 1
	sum_of = 4 * (mid * (mid + 1) * (2 * mid + 1))
	sum_of = int(sum_of / 3)
	print(sum_of)


for _ in range(int(input())):
	n = int(input())
	n = n // 2
	ans = 0
	i = 1
	while n:
		ans += 8 * i * i
		i += 1
		n -= 1
	print(ans)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
		continue
	c = 1
	ans = 0
	for i in range(2, n, 2):
		ans += i * c
		c += 1
	print(ans * 4)


t = int(input())
while t > 0:
	n = int(input())
	k = n // 2
	a = 4 * (k + 1) * k * (2 * k + 1) // 3
	print(a)
	t -= 1


import sys
try:
	sys.stdin = open('Input.txt', 'r')
	sys.stdout = open('Output.txt', 'w')
except:
	pass
input = sys.stdin.readline
for testCases in range(int(input())):
	n = int(input())
	mul = 8
	ans = 0
	num = n // 2
	while num >= 1:
		ans += num * num * mul
		num -= 1
	print(ans)


for _ in range(int(input())):
	n = int(input())
	val = (n + 1) // 2
	fans = 0
	block = 8
	for i in range(1, val):
		fans += block * i
		block += 8
	print(fans)


from sys import stdin, stdout
import math

def main():
	t = int(stdin.readline())
	for _ in range(t):
		n = int(input())
		temp = n * 4 - 4
		res = 0
		for i in range(n // 2, -1, -1):
			res += temp * i
			temp -= 8
		print(res)
main()


from sys import stdin, stdout
from pprint import pprint

def sum_upto(x):
	return x * (x + 1) // 2
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	cost = 0
	for i in range(1, n // 2 + 1):
		cost += i ** 2 + 2 * sum_upto(i)
	stdout.write(str(4 * cost - 4 * sum_upto((n - 1) // 2)) + '\n')


t = int(input())
for t in range(0, t):
	n = int(input())
	x = 0
	for i in range(1, n):
		a = (n - i) * (2 * (n + 1 - i))
		x = x + a
	print(x // 2)


t = int(input())
for _ in range(t):
	n = int(input())
	z = int((n - 1) / 2)
	print(int(4 / 3 * (2 * pow(z, 3) + 3 * pow(z, 2) + z)))


for _ in range(int(input())):
	n = int(input())
	print((n ** 3 - n) // 3)


for j in range(int(input())):
	n = int(input())
	a = [0] * n
	for i in range(1, n):
		if i % 2 == 0:
			a[i] = a[i - 2] + i // 2 * ((i + 1) ** 2 - (i - 1) ** 2)
	print(a[-1])


from collections import defaultdict, deque
import heapq, bisect, math, itertools, string, queue, copy, time
import sys
input = sys.stdin.readline
INF = float('inf')
mod = 10 ** 9 + 7
eps = 10 ** (-7)

def inp():
	return int(input())

def inpl():
	return list(map(int, input().split()))

def inpl_str():
	return list(input().split())
ans = []
t = inp()
for i in range(t):
	n = inp()
	tmp = n * (n * n - 1) // 3
	ans.append(tmp)
for i in ans:
	print(i)


for _ in range(int(input())):
	n = int(input())
	k = n // 2
	s = 0
	for i in range(1, k + 1):
		le = 2 * i + 1
		br = le - 2
		if br < 0:
			br = 0
		tot = 2 * le + 2 * br
		s += tot * i
	print(s)


for _ in range(int(input())):
	n = int(input())
	suma = 0
	brzeg = 1
	for x in range(1, (n - 1) // 2 + 1):
		suma += (brzeg * 4 + 4) * x
		brzeg += 2
	print(suma)


for _ in range(int(input())):
	n = int(input())
	summ = 0
	k = n // 2
	for i in range(k, -1, -1):
		summ += i * (2 * i + 1) + i * (2 * i - 1)
	print(summ * 2)


dp = []
for i in range(5 * 10 ** 5):
	dp.append(0)
dp[1] = 0
dp[3] = 8
for i in range(5, 5 * 10 ** 5):
	a = 4 * i - 4
	dp[i] = dp[i - 2] + a * (i // 2)
t = int(int(input()))
for _ in range(t):
	print(dp[int(input())])


t = int(input())
for _ in range(t):
	n = int(input())
	p = n // 2
	ans = 0
	for i in range(p):
		ans += (i + 1) ** 2 * 8
	print(ans)


test_cases = int(input())
for _ in range(test_cases):
	n = int(input())
	moves = 0
	no_of_layers = (n - 1) // 2 + 1
	for layer in range(1, no_of_layers + 1):
		no_of_cells = (2 * layer - 3) * 4 + 4
		moves += (layer - 1) * no_of_cells
	print(moves)


t = int(input())
for i in range(t):
	n = int(input())
	ans = 0
	for i in range(1, (n - 1) // 2 + 1):
		ans += ((i * 2 + 1) ** 2 - (i * 2 - 1) ** 2) * i
	print(ans)


import sys
input = sys.stdin.buffer.readline
inin = lambda : int(input())
inar = lambda : list(map(int, input().split()))
inst = lambda : input().decode().rstrip('\n\r')
INF = float('inf')
_T_ = inin()
for _t_ in range(_T_):
	n = inin()
	hogaya = 0
	num = 1
	dist = 0
	su = 0
	for i in range((n + 1) // 2):
		su += (num ** 2 - hogaya) * dist
		dist += 1
		hogaya = num ** 2
		num += 2
	print(su)


for _ in range(int(input())):
	x = int(input())
	s = 0
	for i in range(x // 2, 0, -1):
		s += 8 * i * i
	print(s)


t = int(input())
for tt in range(t):
	n = int(input())
	I = round((n - 1) / 2)
	print(8 * round(I * (I + 1) * (2 * I + 1) / 6))


t = int(input())
for _ in range(t):
	n = int(input())
	last = (n - 1) / 2
	print(int(8 * last * (last + 1) * (2 * last + 1) // 6))


t = int(input())
for i1 in range(t):
	n = int(input())
	n = n // 2
	ans = 8 * n * (n + 1) * (2 * n + 1)
	ans = ans // 6
	print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	i = 8
	su = 0
	c = 1
	while c < n // 2 + 1:
		su += i * c
		i += 8
		c += 1
	print(su)


t = int(input())
for i in range(t):
	n = int(input())
	n = n // 2
	v = 8 * n * (n + 1) * (2 * n + 1)
	v /= 6
	print(int(v))


from sys import stdin, stdout
from collections import deque, defaultdict
import math as m
rl = lambda : stdin.readline()
rll = lambda : stdin.readline().split()
rli = lambda : map(int, stdin.readline().split())
(INF, NINF) = (float('inf'), float('-inf'))

def main():
	T = int(rl())
	for _ in range(T):
		n = int(rl())
		ans = 0
		m = n // 2 + 1
		cnt = lambda i: 4 * (n - 2 * (i - 1)) - 4
		for i in range(1, m):
			ans += cnt(i) * (m - i)
		print(ans)
	stdout.close()
main()


class Hello:

	def add(self, n):
		if n == 1:
			print(0)
		else:
			l = 0
			k = n // 2
			while n > 0 and k > 0:
				l += (n * 4 - 4) * k
				k -= 1
				n -= 2
			print(l)
t = int(input())
for _ in range(t):
	n = int(input())
	r = Hello()
	r.add(n)


t = int(input())
while t != 0:
	n = int(input())
	b = 0
	i = 3
	while i <= n:
		b = b + 4 * (i - 1) * (i // 2)
		i += 2
	print(b)
	t -= 1


import sys
input = sys.stdin.readline

def inpint():
	return int(input())

def main():
	t = inpint()
	for _ in range(t):
		n = inpint()
		m = (n - 1) // 2
		ans = 4 * m * (m + 1) * (2 * m + 1) // 3
		print(ans)
main()


t = int(input())
for _ in range(t):
	n = int(input())
	k = 8
	if n == 1:
		print(0)
	elif n == 3:
		print(k)
	else:
		i = 1
		t1 = 0
		while n > 1:
			n -= 2
			t1 += k * i
			k += 8
			i += 1
		print(t1)


for tc in range(int(input())):
	n = int(input())
	m = n // 2
	ans = 0
	for i in range(1, m + 1):
		ans = ans + 8 * i * i
	print(ans)


for _ in ' ' * int(input()):
	n = int(input())
	s = 0
	i = 0
	if n == 1:
		print(0)
	else:
		while (n - 3) // 2 != i:
			s += ((n - 3) // 2 - i) * (n // 2 - i)
			i += 1
		i = 0
		while n // 2 != i:
			s += n // 2 - i
			i += 1
		print(s * 8)


for i in range(int(input())):
	n = int(input())
	ans = 0
	for j in range(3, n + 1, 2):
		ans += (j * 2 + (j - 2) * 2) * (j // 2)
	print(ans)


def findS(s):
	_sum = 0
	n = 1
	while _sum < s:
		_sum += n
		n += 1
	n -= 1
	if _sum == s:
		return n
	return -1
for i in range(int(input())):
	n = int(input())
	c = n ** 2 - 1
	d = c // 8
	n1 = findS(d)
	ans = 8 * (n1 * (n1 + 1) * (2 * n1 + 1) // 6)
	print(ans)


t = int(input())
for ex in range(t):
	n = int(input()) // 2
	print(8 * (n + 1) * n * (2 * n + 1) // 6)


t = int(input())
for t1 in range(t):
	n = int(input())
	if n == 1:
		print(0)
		continue
	p = n // 2
	print(p * (p + 1) * (2 * p + 1) // 6 * 8)


i = int(input())
while i:
	q = 0
	k = int(input())
	n = k // 2
	q = n * (n + 1) * (2 * n + 1) // 6
	print(q * 8)
	i -= 1


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		s = n // 2
		ans = 8 * s * (s + 1) * (2 * s + 1) // 6
		print(ans)


import sys
input = sys.stdin.readline
T = int(input())
for _ in range(T):
	n = int(input())
	v = n // 2
	rq = 0
	for i in range(v):
		rq = rq + (2 * n + 2 * (n - 2)) * (v - i)
		n = n - 2
	print(rq)


for _ in range(int(input())):
	n = (int(input()) - 1) // 2
	a1 = n + 1
	a2 = 2 * n + 1
	print(8 * (n * a1 * a2 // 6))


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	k = (n - 1) / 2
	ans = 8 / 6 * (k * (k + 1) * (2 * k + 1))
	print(int(ans))


MOD = 10 ** 9 + 7
INT_MAX = 10 ** 18 + 7

def INPUT():
	return list((int(i) for i in input().split()))

def LIST_1D_ARRAY(n):
	return [0 for _ in range(n)]

def LIST_2D_ARRAY(m, n):
	return [[0 for _ in range(n)] for _ in range(m)]

def power(a, x):
	res = 1
	while x > 0:
		if x & 1:
			res = res * a % MOD
		a = a * a % MOD
		x //= 2
	return res % MOD

def NCR_MOD(n, r):
	num = 1
	for i in range(n, n - r, -1):
		num = num * i % MOD
	for j in range(1, r + 1):
		num = num * power(j, MOD - 2) % MOD
	return num
import math as M

def calc(n):
	moves = 0
	i = n // 2
	while n > 1:
		moves += (4 * n - 4) * i
		n -= 2
		i -= 1
	return moves
for _ in range(int(input())):
	n = int(input())
	print(calc(n))


import math
t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(0)
		continue
	if n == 3:
		print(8)
		continue
	ans = 0
	for j in range(3, n + 1, 2):
		cost = int(math.floor(j / 2))
		ans += 2 * j * cost
		ans += 2 * (j - 2) * cost
	print(ans)


try:
	t = int(input())
	for _ in range(t):
		n = int(input())
		if n == 1:
			print(0)
		else:
			start = 8
			if n == 3:
				print(start)
			else:
				i = 5
				mul = 2
				while i <= n:
					curr = 2 * i + 2 * (i - 2)
					start = start + curr * mul
					mul = mul + 1
					i = i + 2
				print(start)
except:
	pass


d = {1: 0}
(i, n) = (1, 3)
while i < 250000:
	d[n] = 8 * i * i + d[n - 2]
	n += 2
	i += 1
for i in range(int(input())):
	n = int(input())
	print(d[n])


t = int(input())
for i in range(t):
	n = int(input())
	print(8 * (sum((i for i in range(n // 2, 0, -1))) + sum((i * (i - 1) for i in range(2, n // 2 + 1)))))


import math
t = int(input())
for k in range(t):
	x = int(input())
	n = math.floor(x / 2)
	s = 0
	for i in range(1, n + 1):
		s += 8 * i * i
	print(s)


def main(n):
	j = 0
	count = 0
	for i in range(0, n, 2):
		s = 4 * i * j
		j += 1
		count += s
	return count
k = int(input())
for _ in range(k):
	n = int(input())
	print(main(n))


t = int(input())
z = t
ans = list()
sum1 = 0
while z > 0:
	n = int(input())
	if n == 1:
		ans.append(0)
	else:
		a = int(n / 2)
		b = 0
		while b <= a:
			sum1 = sum1 + 8 * b * b
			b = b + 1
		ans.append(sum1)
		sum1 = 0
	z = z - 1
for r in ans:
	print(r)


l = [0, 0, 0, 8, 0, 40, 0]
for i in range(7, 500005, 2):
	l.append(l[i - 2] + (2 * i + 2 * (i - 2)) * (i // 2))
	l.append(0)
for _ in range(int(input())):
	n = int(input())
	print(l[n])


t = int(input())
a = [0]
c = 1
for i in range(3, 5 * 10 ** 5, 2):
	a.append(a[-1] + (i * 2 + (i - 2) * 2) * c)
	c += 1
for _ in range(t):
	n = int(input())
	print(a[n // 2])


t = int(input())
for _ in range(t):
	n = int(input())
	res = 0
	n = n // 2
	for i in range(1, n + 1):
		res += i * 8 * i
	print(res)


t = int(input())
P = [0] * 250001
for i in range(1, len(P)):
	n = 2 * i + 1
	P[i] = P[i - 1] + 4 * (n - 1) * i
for _ in range(t):
	n = int(input())
	print(P[(n - 1) // 2])


t = int(input())
while t:
	t -= 1
	n = int(input())
	print((n * n * n - n) // 3)


t = int(input())
for w in range(t):
	n = int(input())
	if n == 1:
		print(0)
	else:
		m = 0
		for i in range(1, n // 2 + 1):
			m += i * (2 * (2 * i + 1) + 2 * (2 * i - 1))
		print(m)


t = int(input())
for x in range(t):
	n = int(input())
	ans = 0
	i = 1
	middle = int(n / 2) + 1
	while i <= int(n / 2):
		ans += i * int((2 * i + 1) * 4 - 4)
		i += 1
	print(ans)


import sys
input = sys.stdin.readline
rInt = lambda : int(input())
mInt = lambda : list(map(int, input().split()))
rLis = lambda : list(map(int, input().split()))
t = rInt()
for _ in range(t):
	n = rInt()
	center = n // 2
	out = 0
	for i in range(1, n // 2 + 1):
		out += i * i * 8
	print(out)


for t in range(int(input())):
	n = int(input())
	f = n // 2
	f = f * (f + 1)
	ans = f
	f = 1
	p = ans
	for i in range(n // 2):
		ans = ans + (p + f) * 2
		p = p + f
		f += 2
	print(ans)


from sys import stdin, stdout
test = int(stdin.readline())
for _ in range(test):
	n = int(stdin.readline())
	ans = 4 * (n // 2) * (n // 2 + 1)
	cnt = 2
	temp = 0
	for i in range(2, n // 2 + 1):
		temp += cnt * i
		cnt += 2
	ans += 4 * temp
	print(ans)


for _ in range(int(input())):
	n = int(input())
	n = (n - 1) // 2
	ans = (n + 1) * n * (2 * n + 1) // 6
	print(ans * 8)


t = int(input())
for testcase in range(t):
	n = int(input())
	k = n // 2
	total = k * (k + 1) * (2 * k + 1) * 8 // 6
	print(total)


t = int(input())
while t:
	n = int(input())
	c = 3
	sum = 0
	cnt = 1
	while c <= n:
		sum += (c * 2 + 2 * (c - 2)) * cnt
		c = c + 2
		cnt = cnt + 1
	if sum == 1:
		print(0)
	else:
		print(sum)
	t -= 1


t = int(input())
for _ in range(t):
	n = int(input())
	total = 0
	i = 0
	while n - 2 * i > 1:
		total += 2 * (2 * n - 4 * i - 2) * ((n - 2 * i) // 2)
		i += 1
	print(total)


def solution():
	n = int(input())
	if n == 1:
		print(0)
		return
	prev = 0
	cnt = 1
	line = 0
	for i in range(3, n + 1, 2):
		prev = prev + cnt * (i - 2)
		line += cnt
		cnt += 1
	print(prev * 4 + line * 4)
t = int(input())
for _ in range(t):
	solution()


def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		ans = 0
		for i in range(1, n + 1, 2):
			ans += (4 * i - 4) * (i // 2)
		print(ans)
	return
main()


def solution(n):
	answer = 0
	for i in range(n, 1, -2):
		answer = answer + 4 * (i - 1) * ((i + 1) // 2 - 1)
	print(answer)
for _ in range(int(input())):
	n = int(input())
	solution(n)


def solve(n):
	sol = 0
	c = n // 2
	for i in range(n):
		sol += (n - i - 1 - c) * 4 * (n - i - 1)
	return sol
t = int(input())
for _ in range(t):
	n = int(input())
	print(solve(n))


t = int(input())
ans = [0, 0, 0, 8, 0]
for i in range(5, 5 * 10 ** 5 + 1, 2):
	j = 2 * i + 2 * (i - 2)
	ans.append(ans[i - 2] + j * (i // 2))
	ans.append(0)
for _ in range(t):
	n = int(input())
	print(ans[n])


def solve(n):
	total_moves = 0
	cur_step = 0
	cur_size = 1
	prev_size = 0
	while cur_size <= n:
		cur_cells = cur_size ** 2 - prev_size ** 2
		total_moves += cur_cells * cur_step
		prev_size = cur_size
		cur_size += 2
		cur_step += 1
	return total_moves
for _ in range(int(input())):
	n = int(input())
	print(solve(n))


for _ in range(int(input())):
	n = int(input())
	s = 0
	while n != 1:
		s += n // 2 * (4 * (n - 1))
		n -= 2
	print(s)


t = int(input())
while t != 0:
	t = t - 1
	n = int(input())
	ans = 0
	xx = 8
	g = int((n + 1) / 2)
	for i in range(g - 1, 0, -1):
		v = abs(i - g) * xx
		xx += 8
		ans += v
	print(ans)


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__

def gift():
	for _ in range(t):
		n = int(input())
		ans = 0
		dis = (n + 1) // 2
		for i in range(1, dis):
			ans += i * 2 * 4 * i
		yield ans
t = int(input())
ans = gift()
print(*ans, sep='\n')


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print('0')
	else:
		no = n - (n // 2 + 1)
		ans = 8 * (no * (no + 1) * (2 * no + 1) // 6)
		print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	ans = 0
	c = 3
	prev = 1
	level = 1
	while c <= n:
		total = c * c
		need = total - prev
		prev = total
		c += 2
		ans += need * level
		level += 1
	print(ans)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		su = 0
		for i in range(1, n // 2 + 1):
			su += 8 * i * i
		print(su)


import sys
t = int(sys.stdin.readline())
while t:
	n = int(sys.stdin.readline())
	z = n // 2
	ans = 8 * (z * (z + 1) * (2 * z + 1)) // 6
	print(ans)
	t -= 1


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
		continue
	sumi = 0
	while n > 1:
		sumi += 4 * ((n - 1) * (n // 2))
		n -= 2
	print(sumi)


t = int(input())
for tc in range(t):
	n = int(input())
	print((n * n * n - n) // 3)


t = int(input())
for i in range(t):
	n = int(input())
	m = n // 2
	ans = int(m * (m + 1) * (2 * m + 1) / 6)
	print(ans * 8)


for i in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		m = (n - 1) // 2
		l = []
		for i in range(1, m + 1):
			l.append(i)
		l.reverse()
		nl = []
		while n != 1:
			nl.append(n * 4 - 4)
			n = n - 2
		for i in range(len(nl)):
			nl[i] = nl[i] * l[i]
		print(sum(nl))


import sys
input = sys.stdin.readline
for tt in range(int(input())):
	n = int(input())
	cnt = 1
	ans = 0
	for i in range(1, n - 1, 2):
		ans += (i * 4 + 4) * cnt
		cnt += 1
	print(ans)


from sys import stdin, stdout
import math, sys
from itertools import permutations, combinations
from collections import defaultdict, deque, OrderedDict
import bisect as bi
import heapq

def I():
	return int(input())

def In():
	return map(int, input().split())

def main():
	try:
		n = I()
		ans = 0
		for i in range(1, n // 2 + 1):
			x = 2 * i + 1
			sides = 2 * x + 2 * (x - 2)
			ans += sides * i
		print(ans)
	except:
		pass
M = 998244353
P = 1000000007
for _ in range(I()):
	main()


import sys
strInp = lambda : input().strip().split()
intInp = lambda : list(map(int, strInp()))
for t in range(int(input())):
	n = int(input())
	ans = 0
	for i in range(n, 1, -2):
		final = i // 2 + 1
		ans += (i * 2 + (i - 2) * 2) * (i - final)
	print(ans)


for _ in range(int(input())):
	n = int(input())
	res = n * (n + 1) * (2 * n + 1) // 6
	res = res - n * (n + 1) // 2
	print(res)


import sys
input = sys.stdin.readline

def main():
	t = int(input())
	for _ in range(t):
		N = int(input())

		def sum_up_to_n(n):
			return n * (n + 1) // 2
		ans = 0
		for (i, v) in enumerate(range(3, N + 1, 2)):
			ans += (v * v - (v - 2) * (v - 2)) * (i + 1)
		print(ans)
main()


t = int(input())
num_capa = {0: 1}
suma_capa = {0: 0}
for _ in range(t):
	n = int(input())
	suma = 0
	capa = 0
	nn = 1
	resto = [0]
	while nn + 2 <= n:
		capa += 1
		nn += 2
		if capa not in suma_capa:
			num_capa[capa] = nn ** 2
			numeros = num_capa[capa] - num_capa[capa - 1]
			suma += numeros * capa
			suma_capa[capa] = suma
		suma = suma_capa[capa]
	print(suma)


import sys
input = sys.stdin.readline

def solve(maks):
	ans = [0, 0]
	if maks == 1:
		return ans
	dist = 1
	for ii in range(3, maks + 1, 2):
		res = ans[ii - 2] + ((ii - 2) * 4 + 4) * dist
		ans.append(0)
		ans.append(res)
		dist += 1
	return ans
t = int(input())
maks = 0
queries = []
for _ in range(t):
	n = int(input())
	queries.append(n)
	maks = max(maks, n)
ans = solve(maks)
for n in queries:
	print(ans[n])


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(0)
	else:
		a = (n - 1) // 2
		b = a * (a + 1) * (2 * a + 1)
		print(8 * b // 6)


t = int(input())
for _ in range(t):
	n = int(input())
	print((n + 1) * (n - 1) * n // 3)


q = int(input())
for _ in range(q):
	n = int(input())
	k = n // 2
	su = k * (k + 1) // 2
	su += 2 * k * (k * (k + 1) // 2)
	su *= 4
	print(su * 2 // 3)


for i in range(int(input())):
	n = int(input())
	i = 1
	j = 1
	c = 0
	while i < n:
		c += i * j
		i += 2
		j += 1
	c *= 4
	i = 1
	d = 0
	while i <= n // 2:
		d += i
		i += 1
	d *= 4
	c += d
	print(c)


for _ in range(int(input())):
	n = int(input())
	(x, y) = (n // 2, n // 2)
	ans = 0
	for i in range(1, n // 2 + 1):
		ans += i * i
	print(8 * ans)


from math import ceil
a = [x for x in range(5 * 10 ** 5)]
distances = [i * 8 * x for (i, x) in enumerate(a)]
for _ in range(int(input())):
	n = int(input())
	print(sum(distances[:ceil(n / 2)]))


t = int(input())
for i in range(t):
	n = int(input())
	sum = 0
	i = 3
	while i <= n:
		sum += 2 * (2 * i - 2) * (i // 2)
		i += 2
	print(sum)


for _ in range(int(input())):
	a = int(int(input()) // 2)
	ans = int(4 * a * (a + 1) * (2 * a + 1) // 3)
	print(ans)


for _ in range(int(input())):
	n = int(input()) // 2
	print(int(4 / 3 * (2 * n ** 3 + 3 * n ** 2 + n)))


import math
for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		ans = 0
		c = 1
		for i in range(3, n + 1, 2):
			ans += (2 * i + 2 * (i - 2)) * c
			c += 1
		print(ans)


def sol():
	T = int(input())
	for _ in range(T):
		n = int(input())
		ans = 0
		for i in range(1, n // 2 + 1):
			ans += ((2 * i + 1) * 4 - 4) * i
		print(ans)
sol()


for i in range(int(input())):
	k = int(input()) // 2
	c = 0
	for n in range(1, k + 1):
		c += n * (n * 2)
	print(c * 4)


t = int(input())

def res(x1, x2):
	if x1 == 1:
		return 0
	else:
		for i in range(2, x1):
			x2 = x2 + i * (i + 1)
		return 8 * x2
r = 2
while t:
	a = int(input())
	if a == 1:
		print('0')
	else:
		print(res(a // 2, r) + 4 * (a // 2) * (a // 2 + 1))
	t = t - 1


for _ in range(int(input())):
	x = int(input())
	print((x ** 3 - x) // 3)


for _ in range(int(input())):
	n = int(input())
	res = 0
	for i in range(3, n + 1, 2):
		res += (i * 2 + (i - 2) * 2) * (i // 2)
	print(res)


for x in range(int(input())):
	n = int(input())
	k = 0
	for i in range(3, n + 1, 2):
		k += 2 * (2 * i - 2) * (i - 1) // 2
	print(k)


y = int(input())
for u in range(y):
	x = 0
	v = int(input().strip())
	for u in range(int(v / 2) + 1):
		x += 8 * u * u
	print(x)


for t in range(int(input())):
	n = int(input())
	if n & 1:
		(ans, pre) = (0, 1)
		for i in range(1, (n + 1) // 2):
			ans += ((2 * i + 1) ** 2 - pre) * i
			pre = (2 * i + 1) ** 2
		print(ans)
	else:
		n = n - 1
		(ans, pre) = (0, 1)
		for i in range(1, (n + 1) // 2):
			ans += ((2 * i + 1) ** 2 - pre) * i
			pre = (2 * i + 1) ** 2
		ans += 2 * n - 1
		print(ans)


T = int(input())
while T > 0:
	T -= 1
	n = int(input())
	sum = 0
	for k in range(1, (n - 1) // 2 + 1):
		sum += 8 * k * k
	print(sum)


from sys import stdin, stdout
import sys
from math import *
input = stdin.readline
for __ in range(int(input())):
	n = int(input())
	ans = 0
	m = n // 2
	ans = 2 * (m * (m + 1)) // 2
	temp = 0
	for i in range(1, m):
		temp += m * (m + 1) // 2 - i * (i + 1) // 2
	temp *= 2
	ans += temp
	print(ans * 4)


a = int(input())
for _ in range(a):
	x = int(input())
	(y, sum1) = (1, 0)
	for i in range(3, x + 1, 2):
		sum1 += y * (i ** 2 - (i - 2) ** 2)
		y += 1
	print(sum1)


import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
t = 1
t = int(input())
for _ in range(t):
	n = int(input())
	ans = 0
	for i in range(1, (n + 1) // 2):
		ans += i * 8 * i
	print(ans)


t = int(input())
while t > 0:
	n = int(input())
	s = 0
	k = 1
	for i in range(1, n, 2):
		s += 8 * k ** 2
		k += 1
	print(s)
	t -= 1


for _ in range(int(input())):
	n = int(input())
	ans = 0
	if n == 1:
		print(ans)
	else:
		for i in range(3, n + 1, 2):
			ans += 8 * (i // 2) ** 2
		print(ans)


t = int(input())
for _ in range(t):
	size = int(input())
	steps = size // 2
	counter = 0
	while steps:
		counter += 8 * steps * steps
		steps -= 1
	print(counter)


t = int(input())
for i in range(t):
	n = int(input())
	y = n
	sum1 = 0
	y = n // 2
	while y > 0:
		total = n * 4 - 4
		sum1 += total * y
		y -= 1
		n -= 2
	print(sum1)


import sys
lines = []
for Line in sys.stdin:
	lines.append(Line.rstrip('\n'))
q = int(lines[0])
del lines[0]
for i in range(q):
	n = int(lines[0])
	del lines[0]
	if n == 1:
		print('0')
	else:
		s = 0
		for k in range(1, n // 2 + 1):
			s += k * (k * 8)
		print(s)


for i in range(int(input())):
	n = int(input())
	a = 0
	for i in range(1, (n + 1) // 2):
		a += i ** 2
	print(a * 8)


t = int(input())
while t:
	n = int(input())
	ans = 0
	ck = n // 2 + 1
	for i in range(1, ck + 1):
		num = 4 * (n - 2 * (i - 1)) - 4
		num *= abs(i - n // 2 - 1) * 1
		ans += num
	print(ans)
	t -= 1


def result(n):
	if n == 1:
		return 0
	new_n = (n - 1) // 2
	ans = 8 * ((2 * new_n + 1) * new_n * (new_n + 1)) // 6
	return ans
t = int(input())
for _ in range(t):
	n = int(input())
	print(result(n))


for _ in range(int(input())):
	n = int(input())
	till = (n - 1) // 2
	res = 0
	val = 8
	res = till * (till + 1) * (2 * till + 1) // 6 * val
	print(res)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		c = n // 2
		ans = 0
		k = n
		for i in range(n // 2):
			ans += c * (4 * k - 4)
			c -= 1
			k -= 2
		print(ans)


from sys import stdin, stdout
Pi = lambda x: stdout.write(str(x) + '\n')
Ps = lambda x: stdout.write(str(x))
S = lambda x: x * (x + 1) // 2
I = lambda x: 1 + 2 * x
R = lambda : stdin.readline()
Ri = lambda x: map(int, x.split())
Rs = lambda x: map(str, x.split())
Rf = lambda x: map(float, x.split())
MaxN = int(100000.0) + 5

def main():
	dp = [0]
	ant = 1
	base = 3
	dist = 1
	while len(dp) < 5 * MaxN:
		dp.append((base * base - ant) * dist + dp[-1])
		ant = base * base
		base += 2
		dist += 1
	T = int(R())
	for casos in range(T):
		n = int(R())
		n //= 2
		Pi(dp[n])
main()


for ii in range(int(input())):
	n = int(input())
	x = n // 2
	print(x * n ** 2 - x * (2 * x - 1) * (2 * x + 1) // 3)


t = int(input())
while t:
	t -= 1
	n = int(input())
	n = int(n / 2)
	ans = 4 * (n * (n + 1) * (2 * n + 1)) / 3
	print(int(ans))


T = int(input())
for _ in range(0, T):
	n = int(input())
	ans = 0
	mul = 1
	for i in range(1, n - 1, 2):
		ans += (i * 4 + 4) * mul
		mul += 1
	print(ans)


t = int(input())
for i in range(t):
	p = 0
	n = int(input())
	n = (n - 1) // 2
	p = n * (n + 1) * (2 * n + 1) // 6
	print(p * 8)


def to_corner(n):
	n1n = (n - 1) * n
	return int((n1n >> 1) + n1n * (2 * n - 1) // 3)

def solve(n):
	n1n = n >> 1
	return (n1n * (n1n + 1) << 1) + (to_corner(n1n) << 2) + (n1n * n1n << 2)

def main():
	t = int(input())
	sols = []
	while t > 0:
		t -= 1
		test = int(input())
		sols.append(str(solve(test)))
	for sol in sols:
		print(sol)
	return
main()


n = int(input())
for i in range(n):
	t = int(input()) // 2
	print(t * (t + 1) * (2 * t + 1) // 3 * 4)


t = int(input())
while t > 0:
	n = int(input())
	if n == 0:
		print(0)
		t -= 1
		continue
	boxes = n
	moves = 0
	dist = int(n / 2)
	while dist >= 1:
		moves += dist * (4 * boxes - 4)
		boxes -= 2
		dist -= 1
	print(moves)
	t -= 1


def solve():
	n = int(input())
	l = n // 2
	s = 8
	result = 0
	for i in range(1, l + 1):
		result += s * i
		s += 8
	print(result)

def main():
	for _ in range(int(input())):
		solve()
main()


test = int(input())
while test != 0:
	n = int(input())
	x = (n - 1) / 2
	x = x * (2 * x + 1) * (x + 1) / 6
	print(int(x * 8))
	test -= 1


def main():
	dp = {}
	dp[1] = 0
	i = 3
	while i < 5 * 10 ** 5:
		dp[i] = dp[i - 2] + (i * 4 - 4) * (i // 2)
		i += 2
	t = int(input())
	while t:
		n = int(input())
		print(dp[n])
		t -= 1
main()


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(0)
	else:
		add = 0
		j = 3
		k = 1
		while j <= n:
			add += (j ** 2 - (j - 2) ** 2) * k
			k += 1
			j += 2
		print(add)


tc = int(input())
for _ in range(tc):
	ans = 0
	n = int(input())
	var = n // 2
	while var > 0:
		ans += var * (8 * var)
		var -= 1
	print(ans)


for i in range(int(input())):
	n = int(input())
	val = n // 2
	sum = 8 * (val * (val + 1) * (2 * val + 1) // 6)
	print(sum)


def correct(n):
	sum = 0
	for i in range(1, n + 2, 2):
		sum += 8 * (i // 2) ** 2
	print(sum)
t = int(input())
i = 0
while i < t:
	n = int(input())
	correct(n)
	i = i + 1


t = int(input())
for i in range(t):
	n = int(input())
	(s, p, q) = (0, 1, 1)
	x = (n - 1) // 2
	if x == 0:
		s = 0
	elif x == 1:
		s = 8
	else:
		for j in range(x):
			s = s + 8 * p * q
			(p, q) = (p + 1, q + 1)
	print(s)


for ad in range(int(input())):
	n = int(input())
	n //= 2
	c = 0
	for i in range(1, n + 1):
		c += i * (8 * i)
	print(c)


t = int(input())
while t:
	n = int(input())
	d = n // 2
	s = 0
	while n >= 2:
		s += (n - 1) * 4 * d
		n = n - 2
		d -= 1
	print(s)
	t -= 1


t = int(input())
for i in range(t):
	n = int(input())
	c = 0
	a = n // 2
	for j in range(1, a + 1):
		c += 8 * j * j
	print(c)


t = int(input())
for i in range(t):
	n = int(input())
	j = 0
	z = 0
	while j != n // 2:
		z += 8 * (j + 1) ** 2
		j += 1
	print(z)


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(0)
		continue
	else:
		counter = 1
		length = 3
		moves = 0
		while length <= n:
			amount = length * 2 + (length - 2) * 2
			moves += amount * counter
			length += 2
			counter += 1
		print(moves)
		continue


for case in range(int(input())):
	square_target = int(input())
	moves = 0
	current_square = 1
	while current_square != square_target:
		current_square += 2
		moves += (current_square - 1) / 2 * (current_square ** 2 - (current_square - 2) ** 2)
	print(int(moves))


t = int(input())
for i in range(t):
	n = int(input())
	N = n // 2
	count = 0
	for j in range(1, N + 1):
		count += 8 * j * j
	print(count)


for j in range(int(input())):
	n = int(input()) // 2
	res = round(n * (n + 1) * (2 * n + 1) * 8 / 6)
	print(res)


def main():
	t = int(input())
	for c in range(t):
		n = int(input())
		print(solve(n))

def solve(n):
	k = n // 2
	return 8 * k * (k + 1) * (2 * k + 1) // 6
main()


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(0)
		continue
	dif = 8
	cnt = 0
	for i in range(1, n // 2 + 1):
		cnt += dif * i
		dif += 8
	print(cnt)


t = int(input())
while t > 0:
	n = int(input())
	k = n
	res = 0
	x = n // 2
	for i in range(n // 2):
		var = k * 2 + (k - 2) * 2
		res += var * x
		k -= 2
		x -= 1
	print(res)
	t -= 1


t = int(input())
for _ in range(t):
	n = int(input())
	sum1 = 0
	for x in range(1, n // 2 + 1):
		sum1 = sum1 + pow(x, 2)
	print(sum1 * 8)


def recur_moves(n):
	if int(n) == 3:
		return 8
	else:
		return ((n - 1 - 2) / 2 + 1) * (2 * n) + ((n - 1 - 2) / 2 + 1) * (n - 2) * 2 + recur_moves(n - 2)
rounds = []
x = 0
ans = []
t = int(input())
for i in range(t):
	n = int(input())
	x = 0
	rounds.clear()
	if n == 3:
		ans.append(8)
	elif n == 1:
		ans.append(0)
	else:
		for i in range(n, 3, -2):
			rounds.append(((i - 1 - 2) / 2 + 1) * (2 * i) + ((i - 1 - 2) / 2 + 1) * (i - 2) * 2)
		for i in range(len(rounds)):
			x = x + int(rounds[i])
		ans.append(int(x) + 8)
for i in range(len(ans)):
	print(ans[i])


t = int(input())
while t > 0:
	n = int(input())
	ct = 0
	aa = 1
	for i in range(3, n + 1, 2):
		ct += (i * 2 + (i - 2) * 2) * aa
		aa += 1
	print(ct)
	t -= 1


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(0)
		continue
	s = 3
	sumi = 0
	k = 1
	for i in range(n // 2):
		a = k * (4 * s - 4)
		sumi = sumi + a
		s = s + 2
		k = k + 1
	print(sumi)


import math
t = int(input())
for i in range(t):
	n = int(input())
	ans = 0
	for j in range(1, math.floor(n / 2) + 1):
		ans += 8 * j * j
	print(ans)


for i in range(0, int(input())):
	n = int(input())
	nn = n
	n = n // 2
	s = n * (n + 1) // 2
	s = s * 8
	m = 1
	q = 2
	mm = 0
	while q <= nn // 2:
		mm = mm + q * m
		m = m + 1
		q = q + 1
	mm = mm * 8
	print(s + mm)


def minMoves(n):
	if n == 1:
		return 0
	else:
		sum = 0
		for i in range(1, n // 2 + 1):
			sum += 8 * i * i
		return sum
t = int(input())
for i in range(t):
	n = int(input())
	print(minMoves(n))


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print('0')
	else:
		j = 1
		sumi = 0
		for i in range(3, n + 1, 2):
			sumi += (i * 2 + (i - 2) * 2) * j
			j += 1
		print(sumi)


t = int(input())
import math
delay = []
for _ in range(t):
	n = int(input())
	if n == 1:
		print(0)
		continue
	total = 0
	cnt = 0
	while cnt < n // 2:
		total += 8 * (cnt + 1) ** 2
		cnt += 1
	print(total)


t = int(input())
for _ in range(t):
	sum = int(input())
	mx = 0
	if sum % 2 != 0:
		a = int((sum + 1) / 2)
		for t in range(0, a):
			mx += 8 * t * t
	else:
		a = int(sum / 2)
		for t in range(0, a):
			mx += 4 * (t + 1) - 1 + 4 * t
		if a > 1:
			mx += 1
	print(mx)


for _ in range(int(input())):
	n = int(input())
	i = 1
	j = 1
	factor = 1
	ans = 0
	while i != n:
		ans += (j * 4 + 4) * factor
		j = j + 2
		factor += 1
		i += 2
	print(ans)


def solve(N):
	N = (N - 1) // 2
	ans = N * (N + 1) * (2 * N + 1) // 6 * 8
	print(ans)
t = int(input())
while t != 0:
	n = int(input())
	solve(n)
	t -= 1


def func():
	n = int(input())
	co = 0
	k = 2
	i = 1
	while i <= n / 2:
		co += 4 * k * i
		i += 1
		k += 2
	return co
for _ in range(int(input())):
	print(func())


for _ in range(int(input())):
	n = int(input())
	print(8 * sum([i * i for i in range(1, n // 2 + 1)]))


def qc(n):
	res = 0
	for i in range(n + 1):
		res += i * i * 8
	return sum(map(lambda x: x * x * 8, range(n + 1)))
t = int(input())
for i in range(t):
	n = (int(input()) - 1) // 2
	print(qc(n))


t = int(input())
list = []
for i in range(t):
	n = int(input())
	list.append(n)

def answer(n):
	a = (n + 1) // 2 - 1
	ans = 0
	for i in range(a + 1):
		ans += 8 * i ** 2
	return ans
for i in list:
	print(answer(i))


t = int(input())
for i in range(0, t):
	n = int(input())
	x = n * (n + 1) * (n - 1)
	print(x // 3)


t = int(input())
for j in range(t):
	n = int(input())
	s = 0
	for i in range(1, n // 2 + 1):
		s = s + 8 * i ** 2
	print(s)


a = int(input())

def getn(n):
	return n * (2 * n - 1)
for i in range(0, a):
	n = int(input())
	n = n // 2
	summ = 0
	for i in range(1, n + 1):
		summ = summ + getn(i)
	print(4 * summ + 2 * n * (n + 1))


t = int(input())
while t:
	t -= 1
	n = int(input())
	z = n // 2
	tbm = 0
	tba = 0
	for i in range(1, z + 1):
		tbm += 8
		tba += tbm * i
	print(tba)


for _ in range(int(input())):
	n = int(input())
	z = 0
	for i in range(1, n // 2 + 1):
		z += i ** 2
	print(8 * z)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	k = (n - 1) // 2
	ans = 8 * k * (k + 1) * (2 * k + 1)
	ans //= 6
	print(ans)


cases = int(input())
while cases > 0:
	size = int(input())
	n = 0
	ans = 0
	base = size * size // 4
	while n < size // 2:
		ans += base + (n * n + 2 * n + 1)
		n += 1
	ans *= 2
	ans += base
	print(ans)
	cases -= 1


for _ in range(int(input())):
	n = int(input())
	ans = 0
	t = 3
	m = n // 2
	for i in range(m):
		sides = 2 * (2 * t - 2)
		ans += sides * (i + 1)
		t += 2
	print(ans)


T = int(input())
while T > 0:
	T = T - 1
	n = int(input())
	x = 8
	cnt = 1
	sum = 0
	for i in range(n // 2):
		sum += (i + 1) * x
		x = x + 8
	print(sum)


t = int(input())
while t:
	t -= 1
	n = int(input())
	n = int((n - 1) / 2)
	result = int(n * (n + 1) * (2 * n + 1) / 6) * 8
	print(result)


I = input
for _ in range(int(I())):
	n = int(I())
	if n == 1:
		print(0)
	else:
		ans = 0
		t = 1
		m = 8
		for i in range(n // 2):
			ans += t * m
			t += 1
			m += 8
		print(ans)


import sys
t = int(input())
for i in range(t):
	n = int(input())
	ans = 0
	for j in range(n + 1):
		if j == 1:
			continue
		if j % 2 == 0:
			continue
		ans += (j ** 2 - (j - 2) ** 2) * (j // 2)
	print(ans)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for i2 in range(int(input())):
	n = int(input())
	k = (n - 1) // 2
	t = n
	ans = 0
	while k >= 1:
		ans += (t - 1) * 4 * k
		k -= 1
		t -= 2
	print(ans)


import sys, math, cmath, time
start_time = time.time()
tt = 0

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	return input().strip()

def invr():
	return map(int, input().split())

def solve():
	n = inp()
	c = 0
	for i in range(n // 2):
		c = c + (i + 1) * (2 * (2 * (i + 1) + 1) + 2 * (2 * (i + 1) - 1))
	print(c)

def main():
	if not ONLINE_JUDGE:
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	t = 1
	t = inp()
	for tt in range(t):
		solve()
	if not ONLINE_JUDGE:
		print('Time Elapsed :', time.time() - start_time, 'seconds')
	sys.stdout.close()

def counter(a):
	q = [0] * max(a)
	for i in range(len(a)):
		q[a[i] - 1] = q[a[i] - 1] + 1
	return q

def string_counter(a):
	q = [0] * 26
	for i in range(len(a)):
		q[ord(a[i]) - 97] = q[ord(a[i]) - 97] + 1
	return q
ONLINE_JUDGE = __debug__
if ONLINE_JUDGE:
	input = sys.stdin.readline
main()


for _ in range(int(input())):
	n = int(input())
	su = n // 2
	ans = 0
	count = 0
	for i in range(1, su + 1):
		ans += 8 * i
	for j in range(2, su + 1):
		count += (j - 1) * j
	print(ans + 8 * count)


t = int(input())
import math
for _ in range(t):
	n = int(input())
	if n == 1:
		print(0)
	else:
		s = 0
		for i in range(n // 2):
			s += (i + 1) ** 2 * 8
		print(s)


t = int(input())
for i in range(t):
	n = int(input())
	l = 0
	x = n // 2
	for i in range(1, x + 1):
		l = l + 8 * i * i
	print(l)


t = int(input())
for i in range(t):
	n = int(input())
	x = n // 2
	z = x - 1
	y = 4 * x * (x + 1) + 8 * z * (z + 1) * (z + 2) // 3
	print(y)


import math
for i in range(int(input())):
	n = int(input())
	output = 0
	for i in range(math.ceil(n / 2)):
		output += i * ((1 + 2 * i) ** 2 - (1 + 2 * (i - 1)) ** 2)
	print(output)


def findsum(n):
	tempvalue = int((n - 1) / 2)
	tempeightmultiple = 8
	tempnumbermultiple = 1
	sum = 0
	for i in range(tempvalue):
		sum += tempeightmultiple * tempnumbermultiple
		tempeightmultiple += 8
		tempnumbermultiple += 1
	print(sum)
a = int(input())
for i in range(a):
	findsum(int(input()))


t = int(input())
for i in range(t):
	a = int(input())
	if a == 1:
		print('0')
	else:
		n = (a - 1) / 2
		k = n * (n + 1) * (2 * n + 1)
		print(int(k / 6 * 8))


T = int(input())
for _ in range(T):
	N = int(input())
	output = 0
	for i in range(N // 2):
		output += 8 * (i + 1) * (i + 1)
	print(output)


def solve(n):
	if n == 1:
		return 0
	if n == 3:
		return 8
	mid = n // 2
	i = mid
	ans = 0
	while i >= 0:
		ans += (mid - i) * ((1 + (mid - i - 1) * 2 + 1) * 4)
		i -= 1
	return ans
t = int(input())
for _ in range(t):
	inp = input()
	n = int(inp)
	print(solve(n))


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(0)
	if n != 1:
		s = 0
		a = (n - 1) // 2
		for i in range(a):
			s += 8 * (i + 1) * (i + 1)
		print(s)


t = int(input())
for q in range(t):
	n = int(input())
	cont = 0
	ini = 1
	for k in range(1, n // 2 + 1):
		cont += ini * k
		ini += 2
	cont *= 4
	for i in range(1, n // 2 + 1):
		cont += i * 4
	print(cont)


for _ in range(int(input())):
	n = int(input())
	c = 0
	for i in range(1, n + 1, 2):
		c += i // 2 * (2 * i + 2 * (i - 2))
	print(c)


from sys import stdin
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	s = 0
	cur = 3
	for i in range(1, n // 2 + 1):
		s += (pow(cur, 2) - pow(cur - 2, 2)) * i
		cur += 2
	if n % 2 == 0:
		s += n + n - 1
		print(s)
	else:
		print(s)


for i in range(int(input())):
	val = int(input())
	a = 0
	b = val // 2
	c = val * 2 + (val - 2) * 2
	for j in range(b, 0, -1):
		a += c * j
		c -= 8
	print(a)


def distance(i, j, center):
	if i > j:
		(i, j) = (j, i)
	s = center - i
	j -= i
	s += center - j
	return s
for _ in range(int(input())):
	n = int(input())
	s = 0
	for i in range(3, n + 2, 2):
		s += 4 * (i - 1) * (i // 2)
	print(s)


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
import sys

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		k = n // 2
		ans = 4 * n * k * (k + 1) // 3
		sys.stdout.write(str(ans) + '\n')
main()


for _ in range(int(input())):
	n = int(input())
	c = n // 2
	(i, s, x) = (0, 0, 0)
	while i <= c:
		s += i * x
		x += 8
		i += 1
	print(s)


ans = [0] * 500002
for i in range(3, len(ans), 2):
	k = (i - 1) // 2
	ans[i] = ans[i - 2] + k * (i ** 2 - (i - 2) ** 2)
nc = int(input())
for c in range(nc):
	n = int(input())
	print(ans[n])


import sys
input = sys.stdin.readline
from collections import defaultdict as dd
t = int(input())
while t:
	n = int(input())
	a = 8
	res = 0
	for i in range(1, n // 2 + 1):
		res += a * i * i
	print(res)
	t -= 1


for t in range(int(input())):
	n = int(input())
	m = (n - 1) // 2
	sum = 0
	while n != 1:
		sum = sum + n * 2 * m + (n - 2) * 2 * m
		n -= 2
		m -= 1
	print(sum)


f = int(input())
a = [0] * 500000
p = 8
j = 1
for i in range(3, 500000, 2):
	a[i - 1] = p * j + a[i - 3]
	p += 8
	j += 1
for i10 in range(f):
	n = int(input())
	print(a[n - 1])


l = [0] * 500009
l[1] = 0
l[3] = 8
l[5] = 40
for i in range(7, 500009, 2):
	l[i] = l[i - 2] + i // 2 * (2 * i) + i // 2 * (2 * (i - 2))
for _ in range(int(input())):
	n = int(input())
	print(l[n])


T = int(input())
for i in range(T):
	n = int(input())
	if n == 1:
		print('0')
	else:
		k = n // 2
		s = 0
		x = 8
		y = 1
		for j in range(k):
			s = s + x * y
			y = y + 1
			x = x + 8
		print(s)


import sys
cases = int(sys.stdin.readline())
for _ in range(cases):
	n = int(sys.stdin.readline())
	res = 0
	j = 0
	for i in range(1, n + 1, 2):
		res += j * (4 * i - 4)
		j += 1
	print(res)


for i in range(int(input())):
	n = int(input())
	print(n * (n * n - 1) // 3)


ans = [0] * (1000 * 1000)
for i in range(3, len(ans), +2):
	ans[i] = int(ans[i - 2] + (4 * i - 4) * (0.5 * i - 0.5))
t = int(input())
for _ in range(t):
	print(ans[int(input())])


for _ in range(int(input())):
	n = int(input())
	n = n // 2
	sq3 = n ** 3
	sq2 = n ** 2
	sq1 = n
	res = (8 * sq3 + 12 * sq2 + 4 * sq1) // 3
	print(res)


TEST = int(input())
answers = []
for _ in range(TEST):
	n = int(input())
	moves = 0
	for i in range(1, n // 2 + 1):
		moves += i * (i * 2)
	answers.append(moves * 4)
for ans in answers:
	print(ans)


for _ in range(int(input())):
	n = int(input())
	a = n * 2 + (n - 2) * 2
	m = n // 2
	s = 0
	while m != 0:
		s = s + a * m
		m = m - 1
		a = a - 8
	print(s)


def X(n):
	if n <= 0:
		return 0
	n = n / 2
	return n * (n + 1) * (2 * n + 1) * 8 / 6
t = input()
t = int(t)
for i in range(t):
	n = input()
	n = int(n)
	print(int(X(n - 1)))


t = int(input())
for i in range(0, t):
	a = int(input())
	s = 0
	for i in range(3, a + 1, 2):
		s += (i * i - (i - 2) * (i - 2)) * (i // 2)
	print(s)


t = int(input())
for i in range(0, t):
	n = int(input())
	n1 = n // 2
	num = 0
	n2 = 1
	for j in range(0, n1 + 1):
		num += j * n2
		n2 += 2
	n1 = n1 * (n1 + 1) // 2
	num *= 4
	num -= n1 * 4
	print(num)


t = int(input())
i = 0
while i < t:
	n = int(input())
	a = n
	count = 0
	prev = 0
	while a > 0:
		if a == 1:
			break
		b = (a - 1) // 2
		a = a - 2
		ans = 8 * b + prev
		count = count + ans
		prev = ans
	print(count)
	i = i + 1


T = int(input())
for i in range(0, T):
	n = int(input())
	ans = 0
	for j in range(1, int((n + 1) / 2)):
		ans += (n - 2 * (j - 1) - 1) * 4 * (int((n + 1) / 2) - j)
	print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	if n <= 1:
		ans = 0
	else:
		prev = 1
		move = 1
		ans = 0
		for i in range(3, n + 1, 2):
			sq = i * i - prev * prev
			ans += sq * move
			move += 1
			prev = i
	print(ans)


for _ in range(int(input())):
	n = int(input())
	time = 0
	kol = 0
	for i in range(1, (n - 1) // 2 + 1):
		kol += 8
		time = kol * i + time
	print(time)


num = int(input(''))
i = 0
while i < num:
	n = int(input(''))
	sum = 0
	k = 0
	while k <= n // 2:
		sum += 8 * k ** 2
		k += 1
	i += 1
	print(sum)


for case in range(int(input())):
	n = int(input())
	ans = 0
	for i in range(n // 2 + 1):
		ans += i * i
	print(ans * 8)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		a = 1
		s = 1
		c = 8
		t = 0
		while a < n:
			t += s * c
			a += 2
			s += 1
			c += 8
		print(t)


a = int(input())
c = 0
e = 0
for i in range(a):
	b = int(input())
	for i in range(1, int((b + 1) / 2)):
		d = (4 + e) * i
		c = c + d
		e = e + 4
	print(2 * c)
	c = 0
	e = 0


t = int(input())
for j in range(t):
	n = int(input())
	mid = n // 2
	s = 0
	for i in range(n, 0, -2):
		s = s + (i * 4 - 4) * mid
		mid = mid - 1
	print(s)


def soln(n):
	result = 0
	perim = 8
	for i in range(1, n // 2 + 1):
		result += perim * i
		perim += 8
	return result

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		result = soln(n)
		print(result)

def test():
	arr = [2, 1, 5, 4, 3]
	print(soln(arr))
main()


t = int(input())
for i in range(t):
	n = int(input())
	total = (n - 1) * n * (n + 1) // 3
	print(total)


import sys
t = int(sys.stdin.readline())
for _ in range(t):
	n = int(sys.stdin.readline())
	mid = n // 2
	result = mid * (mid + 1) * (2 * mid + 1) / 6
	print(int(result) * 8)


from sys import stdout
i = int
for _ in range(int(input())):
	n = i(input())
	stdout.write(str((n ** 3 - n) // 3) + '\n')


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print('0')
	else:
		j = 1
		k = 1
		sum = 0
		while j <= n // 2:
			sum += 8 * k * j
			j += 1
			k += 1
		print(sum)


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(0)
	else:
		a = n // 2
		total = 0
		for i in range(a, 0, -1):
			total += 4 * i * n - i * 4
			n -= 2
		print(total)


arr = [0] * 10 ** 6
k = 1
for i in range(3, 10 ** 6, 2):
	arr[i] = arr[i - 2] + k * (i * 2 + (i - 2) * 2)
	k += 1
for _ in range(int(input())):
	n = int(input())
	print(arr[n])


for i in range(int(input())):
	n = int(input())
	w = n // 2
	ct = 0
	ct += w * (w + 1) * 4
	y = (n - 3) // 2
	while y > 0:
		ct += y * (y + 1) * 8
		y -= 1
	print(ct)


t = int(input())
for ii in range(t):
	n = int(input())
	ans = 0
	for i in range(1, n // 2):
		ans += (n // 2 - i + 1) * (n // 2 - i)
	ans *= 8
	o = (1 + n // 2) * (n // 2) // 2
	ans += o * 8
	print(ans)


l = [0] * 500000
l[1] = 0
for i in range(3, 500000, 2):
	l[i] = l[i - 2] + 2 * (i - 1) * (i - 1)
for _ in range(int(input())):
	n = int(input())
	print(l[n])


t = int(input())
while t > 0:
	n = int(input())
	moves = 0
	while n > 1:
		moves += (4 * n - 4) * (n // 2)
		n = n - 2
	print(moves)
	t -= 1


for T in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		i = (n - 1) // 2
		v = i * (i + 1) * (2 * i + 1) * 8
		print(v // 6)


el = int(input())
for i in range(el):
	num = int(input())
	temp = 1
	count = 0
	curr = 1
	while True:
		if temp == num:
			break
		count = count + ((temp + 2) * 2 + temp * 2) * curr
		temp = temp + 2
		curr = curr + 1
	print(count)


def solve(n):
	ans = 0
	key = n // 2
	while key != 0:
		ans = ans + (2 * (key * n) + 2 * (key * (n - 2)))
		key -= 1
		n -= 2
	print(ans)
t = int(input())
for i in range(t):
	n = int(input())
	solve(n)


for z in range(int(input())):
	n = int(input())
	print(n // 2 * (n // 2 + 1) * n * 4 // 3)


q = int(input())
for _ in range(q):
	n = int(input())
	w = 0
	l = 1
	ans = 0
	while l <= n:
		if l == 1:
			l += 2
			w += 1
		else:
			ans += w * (l + 2 * (l - 1) + l - 2)
			l += 2
			w += 1
	print(ans)


t = int(input())
while t > 0:
	t = t - 1
	n = int(input())
	n = n // 2
	n = n * (n + 1) * (2 * n + 1) * 8 / 6
	print(int(n))


for _ in range(int(input())):
	n = int(input())
	x = 0
	for i in range((n - 1) // 2):
		x += (i + 1) * (i + 1)
	print(str(8 * x))


moves = [0] * (5 * 10 ** 5 // 2 + 10)

def move():
	s = 0
	for i in range(1, 5 * 10 ** 5 // 2 + 2, 1):
		s += 8
		moves[i] = moves[i - 1] + s * i
move()
for _ in range(int(input())):
	n = int(input())
	print(moves[n // 2])


t = int(input())
for t1 in range(t):
	n = int(input())
	rsp = 0
	for i in range(n, 1, -2):
		rsp += (i * 2 + (i - 2) * 2) * ((i - 1) / 2)
	print(int(rsp))


t = int(input())
for i in range(t):
	n = int(input())
	k = n
	ans = 0
	for j in range(k // 2):
		ans += n // 2 * (n * 4 - 4)
		n -= 2
	print(ans)


import math as mt
import sys, string
input = sys.stdin.readline
import random
from collections import deque, defaultdict
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())
t = I()
for _ in range(t):
	n = I()
	k = n // 2
	s = k * (k + 1) * (2 * k + 1) // 6
	print(8 * s)


t = int(input())
for w in range(t):
	n = int(input())
	s = 0
	i = 1
	j = 0
	d = 0
	while i <= n:
		s += (4 * i - 4) * j
		i += 2
		j += 1
		d = s
	print(s)


import math
t = int(input())
for i in range(t):
	n = int(input())
	ans = 0
	if n == 1:
		print(ans)
	else:
		quo = n ** 2 - 1
		index = 1
		while quo > 0:
			quo = quo - 8 * (index - 1)
			index += 1
		req = index - 2
		ans = 8 * req * (req + 1) * (2 * req + 1)
		ans = int(ans / 6)
		print(ans)


k = 5 * 10 ** 5
ans = [0 for _ in range(k)]
for i in range(1, k + 1, 2):
	ans[i] = (i ** 2 - (i - 2) ** 2) * ((i - 1) // 2)
t = int(input().strip())
for _ in range(t):
	n = int(input().strip())
	print(sum(ans[:n + 1]))


for i in range(int(input())):
	n = int(input())
	k = 0
	for j in range(0, n, 2):
		k += 2 * j * j
	print(k)


t = int(input())

def solve(n):
	sm = 0
	idx = 1
	for i in range(1, n // 2 + 1):
		sm += 8 * i * idx
		idx += 1
	print(sm)
for _ in range(t):
	n = int(input())
	solve(n)


from math import pow
t = int(input())
while t:
	t -= 1
	n = int(input())
	su = 0
	i = 1
	while i <= n:
		su += (i - 1) / 2 * (pow(i, 2) - pow(i - 2, 2))
		i += 2
	print(int(su))


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print('0')
		continue
	count = 1
	tempn = 1
	ans = 0
	while True:
		numtiles = 4 * tempn + 4
		ans += numtiles * count
		tempn += 2
		count += 1
		if tempn == n:
			break
	print(ans)


for _ in range(int(input())):
	n = int(input())
	(sums, muls) = (0, 8)
	itern = n // 2
	for i in range(1, itern + 1):
		sums += muls * i
		muls += 8
	print(sums)


t = int(input())
for i in range(t):
	a = int(input())
	s = 0
	t = 0
	if a > 1:
		for j in range(3, a + 1, 2):
			s += 8 * (j // 2) * (j // 2)
	print(s)


t = int(input())
for _ in range(t):
	ans = 0
	n = int(input())
	if n == 1:
		print(0)
		continue
	ptr = 1
	for i in range(3, n + 2, 2):
		ans += ptr * ptr * 8
		ptr += 1
	print(ans)


from sys import stdin
from collections import Counter, deque
from itertools import product
T = int(input())
for _ in range(T):
	n = int(input())
	sm = 0
	for u in range(3, n + 1, 2):
		v = (u - 1) // 2
		sm += 8 * v * v
	print(sm)


t = int(input())
for i in range(t):
	n = int(input())
	su = 0
	for j in range(1, n // 2 + 1):
		su = su + j * j * 2
	su = su * 4
	print(su)


def total_moves(n):
	moves = 0
	while n != 1:
		moves += 4 * (n - 1) * (n - 1 - int(n / 2))
		n -= 2
	return moves
t = int(input())
for t_itr in range(t):
	n = int(input())
	result = total_moves(n)
	print(result)


for _ in range(int(input())):
	n = int(input())
	ans = 0
	p = 1
	k = 1
	for i in range(3, n + 1, 2):
		p = (i - 2) * 4 + 4
		ans += k * p
		k += 1
	print(ans)


for _ in range(int(input())):
	n = int(input())
	x = 0
	step = 0
	cnt = 1
	ans = 0
	while cnt < n:
		ans = ans + (x + 8) * (step + 1)
		step += 1
		x += 8
		cnt += 2
	print(ans)


t = int(input())
for q in range(t):
	n = int(input())
	if n == 1:
		print(0)
		continue
	m = (n - 1) // 2
	rst = 0
	for x in range(1, m + 1):
		rst += 8 * x ** 2
	print(rst)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from math import factorial
from collections import Counter, defaultdict
from heapq import heapify, heappop, heappush

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

def RLL():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def N():
	return int(input())

def comb(n, m):
	return factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0

def perm(n, m):
	return factorial(n) // factorial(n - m) if n >= m else 0

def mdis(x1, y1, x2, y2):
	return abs(x1 - x2) + abs(y1 - y2)
mod = 998244353
INF = float('inf')

def main():
	for _ in range(N()):
		n = N()
		res = 0
		tag = 1
		for i in range(3, n + 1, 2):
			res += (i * 2 + (i - 2) * 2) * tag
			tag += 1
		print(res)
main()


import sys
I = sys.stdin.readline
ans = ''
for _ in range(int(I())):
	n = int(I())
	x = 0
	for i in range(1, n // 2 + 1):
		x += 8 * i * i
	ans += str(x) + '\n'
print(ans)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		k = n // 2
		sum1 = k * (k + 1) // 2 * 8
		i = 1
		m = k
		k = k - 1
		sum2 = 0
		for j in range(0, m - 1):
			sum2 = sum2 + k * (k + 1) // 2 + k * i
			i += 1
			k = k - 1
		k = 1
		i = 1
		print(sum1 + sum2 * 8)


from functools import reduce
import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def arr():
	return [int(i) for i in input().split()]

def sarr():
	return [int(i) for i in input()]

def inn():
	return int(input())
mo = 1000000007
t = inn()
while t:
	t -= 1
	n = inn()
	ans = 0
	for i in range(3, n + 1, 2):
		res = i // 2
		ans += (i * 4 - 4) * res
	print(ans)


T = int(input())
for t in range(T):
	n = int(input())
	value = 0
	while n >= 3:
		temp = (n * n - (n - 2) * (n - 2)) * ((n - 1) // 2)
		n -= 2
		value += temp
	print(value)


def fcnt():
	result = ''
	for _ in range(int(input())):
		n = int(input())
		z = 0
		for i in range(n, 2, -2):
			z += (i * 2 + (i - 2) * 2) * (i // 2)
		result += str(z) + '\n'
	print(result[:-1])
fcnt()


t = int(input())
ans = [8 * i * i for i in range(5 * 10 ** 5)]
for _ in range(t):
	n = int(input())
	m = n // 2
	print(sum(ans[:m + 1]))


t = int(input())
while t:
	n = int(input())
	if n == 1:
		print('0')
	else:
		k = (n + 1) // 2 - 1
		print(2 * 4 * k * (k + 1) * (2 * k + 1) // 6)
	t -= 1


import sys, bisect, string, math, time, functools, random, fractions
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
from itertools import permutations, combinations, groupby

def Golf():
	(*a,) = map(int, open(0))

def I():
	return int(input())

def S_():
	return input()

def IS():
	return input().split()

def LS():
	return [i for i in input().split()]

def LI():
	return [int(i) for i in input().split()]

def LI_():
	return [int(i) - 1 for i in input().split()]

def NI(n):
	return [int(input()) for i in range(n)]

def NI_(n):
	return [int(input()) - 1 for i in range(n)]

def StoLI():
	return [ord(i) - 97 for i in input()]

def ItoS(n):
	return chr(n + 97)

def LtoS(ls):
	return ''.join([chr(i + 97) for i in ls])

def GI(V, E, ls=None, Directed=False, index=1):
	org_inp = []
	g = [[] for i in range(V)]
	FromStdin = True if ls == None else False
	for i in range(E):
		if FromStdin:
			inp = LI()
			org_inp.append(inp)
		else:
			inp = ls[i]
		if len(inp) == 2:
			(a, b) = inp
			c = 1
		else:
			(a, b, c) = inp
		if index == 1:
			a -= 1
			b -= 1
		aa = (a, c)
		bb = (b, c)
		g[a].append(bb)
		if not Directed:
			g[b].append(aa)
	return (g, org_inp)

def GGI(h, w, search=None, replacement_of_found='.', mp_def={'#': 1, '.': 0}, boundary=1):
	mp = [boundary] * (w + 2)
	found = {}
	for i in range(h):
		s = input()
		for char in search:
			if char in s:
				found[char] = (i + 1) * (w + 2) + s.index(char) + 1
				mp_def[char] = mp_def[replacement_of_found]
		mp += [boundary] + [mp_def[j] for j in s] + [boundary]
	mp += [boundary] * (w + 2)
	return (h + 2, w + 2, mp, found)

def TI(n):
	return GI(n, n - 1)

def bit_combination(n, base=2):
	rt = []
	for tb in range(base ** n):
		s = [tb // base ** bt % base for bt in range(n)]
		rt += [s]
	return rt

def gcd(x, y):
	if y == 0:
		return x
	if x % y == 0:
		return y
	while x % y != 0:
		(x, y) = (y, x % y)
	return y

def show(*inp, end='\n'):
	if show_flg:
		print(*inp, end=end)
YN = ['YES', 'NO']
Yn = ['Yes', 'No']
mo = 10 ** 9 + 7
inf = float('inf')
FourNb = [(1, 0), (-1, 0), (0, 1), (0, -1)]
EightNb = [(1, 0), (-1, 0), (0, 1), (0, -1), (1, 1), (-1, -1), (1, -1), (-1, 1)]
compas = dict(zip('EWNS', FourNb))
l_alp = string.ascii_lowercase
input = lambda : sys.stdin.readline().rstrip()

class Tree:

	def __init__(self, inp_size=None, ls=None, init=True, index=0):
		self.LCA_init_stat = False
		self.ETtable = []
		if init:
			if ls == None:
				self.stdin(inp_size, index=index)
			else:
				self.size = len(ls) + 1
				(self.edges, _) = GI(self.size, self.size - 1, ls, index=index)
		return

	def stdin(self, inp_size=None, index=1):
		if inp_size == None:
			self.size = int(input())
		else:
			self.size = inp_size
		(self.edges, _) = GI(self.size, self.size - 1, index=index)
		return

	def listin(self, ls, index=0):
		self.size = len(ls) + 1
		(self.edges, _) = GI(self.size, self.size - 1, ls, index=index)
		return

	def __str__(self):
		return str(self.edges)

	def dfs(self, x, func=lambda prv, nx, dist: prv + dist, root_v=0):
		q = deque()
		q.append(x)
		v = [-1] * self.size
		v[x] = root_v
		while q:
			c = q.pop()
			for (nb, d) in self.edges[c]:
				if v[nb] == -1:
					q.append(nb)
					v[nb] = func(v[c], nb, d)
		return v

	def EulerTour(self, x):
		q = deque()
		q.append(x)
		self.depth = [None] * self.size
		self.depth[x] = 0
		self.ETtable = []
		self.ETdepth = []
		self.ETin = [-1] * self.size
		self.ETout = [-1] * self.size
		cnt = 0
		while q:
			c = q.pop()
			if c < 0:
				ce = ~c
			else:
				ce = c
				for (nb, d) in self.edges[ce]:
					if self.depth[nb] == None:
						q.append(~ce)
						q.append(nb)
						self.depth[nb] = self.depth[ce] + 1
			self.ETtable.append(ce)
			self.ETdepth.append(self.depth[ce])
			if self.ETin[ce] == -1:
				self.ETin[ce] = cnt
			else:
				self.ETout[ce] = cnt
			cnt += 1
		return

	def LCA_init(self, root):
		self.EulerTour(root)
		self.st = SparseTable(self.ETdepth, init_func=min, init_idl=inf)
		self.LCA_init_stat = True
		return

	def LCA(self, root, x, y):
		if self.LCA_init_stat == False:
			self.LCA_init(root)
		(xin, xout) = (self.ETin[x], self.ETout[x])
		(yin, yout) = (self.ETin[y], self.ETout[y])
		a = min(xin, yin)
		b = max(xout, yout, xin, yin)
		id_of_min_dep_in_et = self.st.query_id(a, b + 1)
		return self.ETtable[id_of_min_dep_in_et]

class SparseTable:

	def __init__(self, ls, init_func=min, init_idl=float('inf')):
		self.func = init_func
		self.idl = init_idl
		self.size = len(ls)
		self.N0 = self.size.bit_length()
		self.table = [ls[:]]
		self.index = [list(range(self.size))]
		self.lg = [0] * (self.size + 1)
		for i in range(2, self.size + 1):
			self.lg[i] = self.lg[i >> 1] + 1
		for i in range(self.N0):
			tmp = [self.func(self.table[i][j], self.table[i][min(j + (1 << i), self.size - 1)]) for j in range(self.size)]
			tmp_id = [self.index[i][j] if self.table[i][j] == self.func(self.table[i][j], self.table[i][min(j + (1 << i), self.size - 1)]) else self.index[i][min(j + (1 << i), self.size - 1)] for j in range(self.size)]
			self.table += [tmp]
			self.index += [tmp_id]

	def query(self, l, r):
		if r > self.size:
			r = self.size
		N = self.lg[r - l]
		return self.func(self.table[N][l], self.table[N][max(0, r - (1 << N))])

	def query_id(self, l, r):
		if r > self.size:
			r = self.size
		N = self.lg[r - l]
		(a, b) = (self.index[N][l], self.index[N][max(0, r - (1 << N))])
		if self.table[0][a] == self.func(self.table[N][l], self.table[N][max(0, r - (1 << N))]):
			b = a
		return b

	def __str__(self):
		return str(self.table[0])

	def print(self):
		for i in self.table:
			print(*i)

class Comb:

	def __init__(self, n, mo=10 ** 9 + 7):
		self.fac = [0] * (n + 1)
		self.inv = [1] * (n + 1)
		self.fac[0] = 1
		self.fact(n)
		for i in range(1, n + 1):
			self.fac[i] = i * self.fac[i - 1] % mo
			self.inv[n] *= i
			self.inv[n] %= mo
		self.inv[n] = pow(self.inv[n], mo - 2, mo)
		for i in range(1, n):
			self.inv[n - i] = self.inv[n - i + 1] * (n - i + 1) % mo
		return

	def fact(self, n):
		return self.fac[n]

	def invf(self, n):
		return self.inv[n]

	def comb(self, x, y):
		if y < 0 or y > x:
			return 0
		return self.fac[x] * self.inv[x - y] * self.inv[y] % mo
show_flg = False
show_flg = True
ans = 0
T = I()
for _ in range(T):
	n = I()
	k = (n - 1) // 2
	x = 0
	y = 0
	z = 0
	for i in range(1, k + 1):
		x += i
		y += i * (i - 1)
		z += i
	ans = x * 4 + y * 8 + 4 * z
	print(ans)


import math
t = int(input())
for _ in range(t):
	n = int(input())
	if n > 1:
		sum = 0
		k = 1
		for i in range(3, n + 1):
			if i % 2 != 0:
				sum += (i - 1) * k * 4
				k += 1
		print(sum)
	else:
		print(0)


def rn():
	a = int(input())
	return a

def rl():
	a = list(map(int, input().split()))
	return a
for _ in range(int(input())):
	n = rn()
	k = n // 2
	ans = 0
	curr = 1
	for i in range(1, k + 1):
		p = 2 * i + 1
		ans += (p * p - curr) * i
		curr = p * p
	print(ans)


for _ in range(int(input())):
	n = int(input())
	s = 0
	for i in range(3, n + 1, 2):
		k = i ** 2
		k1 = (i - 2) ** 2
		k3 = i // 2
		k4 = k - k1
		s += k3 * k4
	print(s)


cases = int(input())
l = []
for i in range(cases):
	n = (int(input()) - 1) // 2
	l.append(8 * (n + 1) * (2 * n + 1) * n // 6)
for i in l:
	print(i)


from sys import stdin
import math
inp = lambda : stdin.readline().strip()
t = int(inp())
for _ in range(t):
	n = int(inp())
	if n >= 3:
		total = 8
		c = 5
		c2 = 2
		for i in range(n // 2 - 1):
			total += c2 * (c * c - (c - 2) * (c - 2))
			c += 2
			c2 += 1
		print(total)
	else:
		print(0)


for _ in range(int(input())):
	n = int(input())
	ans = 2 * n * int(n / 2) * (int(n / 2) + 1)
	for i in range(1, n // 2 + 1):
		ans -= 4 * (2 * i * (n // 2 + 1 - i) - i)
	print(ans)


def main():
	t = int(input())
	for i in range(t):
		n = int(input())
		x = (n - 1) / 2
		print(int(8 * (x * (x + 1) * n / 6)))
main()


T = int(input())
while T > 0:
	n = int(input())
	z = 1
	cell = 8
	count = 0
	while z < int(n / 2) + 1:
		count += cell * z
		cell += 8
		z += 1
	print(count)
	T -= 1


for i in range(int(input())):
	a = int(input())
	b = (a ** 2 - 1) / 4
	k = m = 0
	while b > 0:
		k += 1
		m += k * 2 * k
		b = b - k * 2
	print(m * 4)


t = int(input())
while t:
	n = int(input())
	(l, b) = (n, n)
	m = n // 2
	s = 0
	while m:
		a = 2 * l + 2 * (b - 2)
		s = s + a * m
		l -= 2
		b -= 2
		m -= 1
	print(s)
	t -= 1


t = int(input())
for _ in range(t):
	m = (1 + int(input())) // 2
	print(4 * m * (m - 1) * (2 * m - 1) // 3)


t = int(input())
for z in range(t):
	n = int(input())
	if n == 1:
		print('0')
	else:
		moves = 0
		r = (n + 1) // 2
		for i in range(r):
			moves += 8 * i ** 2
		print(moves)


def solve():
	global dp
	n = int(input())
	print(dp[n // 2])
dp = [0] * 250000
for i in range(3, 500000, 2):
	dp[i // 2] = dp[i // 2 - 1] + 8 * (i // 2) ** 2
for _ in range(int(input())):
	solve()


def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
entries = inp()
for i in range(entries):
	n = inp()
	res = 0
	step = int((n - 1) / 2)
	for j in range(n, -1, -2):
		res += (4 * int(j) - 4) * step
		step -= 1
	print(res)


t = int(input())
for jhg in range(t):
	n = int(input())
	count = 0
	i = n
	while i > 1:
		count += (i * 2 + (i - 2) * 2) * (i // 2)
		i -= 2
	print(count)


t = int(input())
while t > 0:
	t = t - 1
	n = int(input())
	sum_n = 0
	for x in range(0, n // 2):
		sum_n = sum_n + 8 * ((n - 2 * x) // 2) ** 2
	print(sum_n)


for _ in range(int(input())):
	x = int(input())
	ans = 0
	if x == 1:
		print(ans)
	else:
		b = 0
		for i in range(0, x, 2):
			ans += i * 4 * (i - b)
			b += 1
		print(ans)


for i in range(int(input())):
	a = int(input())
	a = a // 2
	print(8 * (a * (a + 1) * (2 * a + 1) // 6))


num = int(input(''))
for i in range(num):
	list1 = []
	total = 0
	ele = 0
	n = int(input('')) // 2
	for i in range(n):
		r = i + 1
		d = r * r
		list1.append(d)
	while ele < len(list1):
		total = total + list1[ele]
		ele += 1
	print(total * 8)


t = int(input())
while t:
	n = int(input())
	m = int(8 * (n // 2) * (n // 2 + 1) * (2 * (n // 2) + 1) / 6)
	print(m)
	t -= 1


def res(k):
	r = 0
	for j in range(1, k + 1):
		r += j * j
	return 8 * r
t = int(input())
d = []
for i in range(t):
	d.append(int(input()))
for i in range(t):
	print(res(int((d[i] - 1) / 2)))


t = int(input())
while t:
	t = t - 1
	n1 = int(input())
	n = int((n1 + 1) / 2)
	ans = 0
	for i in range(0, n - 2):
		x = (n - 1) * (i + 1) - i * (i + 1) / 2
		ans = ans + int(x)
	ans = 8 * ans + 4 * n * (n - 1)
	print(ans)


for _ in range(int(input())):
	n = int(input())
	moves = 0
	ans = 0
	for side in range(1, n + 2, 2):
		pside = side - 2
		sq = side ** 2 - pside ** 2
		ans += moves * sq
		moves += 1
	print(ans)


t = int(input())
for i in range(t):
	x = int(input())
	m = x // 2
	sum = 0
	for i in range(1, m + 1):
		sum += i * i * 8
	print(sum)


t = int(input())
while t > 0:
	n = int(input())
	x = n // 2
	j = 8
	summ = 0
	for i in range(1, x + 1):
		summ += i * j
		j += 8
	print(summ)
	t -= 1


from sys import stdin
t = int(stdin.readline())
while t > 0:
	n = int(stdin.readline())
	if n == 1:
		print(0)
	elif n == 3:
		print(8)
	else:
		diff = n // 2
		ans = n * diff * 2
		summ1 = [0] * n
		summ1[0] = n * diff
		odd = n - 2
		for i in range(1, diff):
			summ1[i] = summ1[i - 1] - odd
			ans += summ1[i] * 2
			odd -= 2
			if odd == 1:
				ans += summ1[i]
		print(ans - 1)
	t -= 1


from sys import stdin, stdout
mem = [0]
for case in range(int(stdin.readline())):
	x = int(stdin.readline()) // 2
	for y in range(len(mem), x + 1):
		mem.append(mem[y - 1] + 8 * y * y)
	print(mem[x])


def sol(n):
	v = 0
	for x in range(1, n // 2 + 1):
		v += x * 8 * x
	return v
t = int(input())
for _ in range(t):
	n = int(input())
	v = sol(n)
	print(v)


t = int(input())
while t:
	t -= 1
	num = int(input())
	terms = num // 2
	min_moves = 0
	copy = num
	for i in range(terms):
		min_moves += copy + i * (i + 1) // 2 * 2
		copy += num
	min_moves *= 2
	min_moves += terms * (terms + 1) // 2 * 2
	print(min_moves)


t = int(input())
while t > 0:
	n = int(input())
	s = 0
	for i in range(3, n + 2, 2):
		s = s + 2 * ((i - 1) * (i - 1))
	print(s)
	t = t - 1


t = int(input())
for q in range(t):
	n = int(input())
	c = 0
	te = 8
	if n == 1:
		print(0)
	elif n == 3:
		print(8)
	else:
		for i in range(1, int(n / 2) + 1):
			te = 8 * i
			c += te * i
		print(c)


t = int(input())
for u in range(t):
	n = int(input())
	if n <= 1:
		print(0)
	else:
		ans = 0
		bord = 3
		for i in range(1, n // 2 + 1):
			ans += i * (bord * 2 + (bord - 2) * 2)
			bord += 2
		print(ans)


import sys, os
from io import BytesIO, IOBase
import math
from math import floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque
from heapq import merge, heapify, heappop, heappush, nsmallest
from bisect import bisect_left as bl, bisect_right as br, bisect
from itertools import permutations
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(stdin, stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
mod = pow(10, 9) + 7
mod2 = 998244353

def inp():
	return stdin.readline().strip()

def iinp():
	return int(inp())

def out(var, end='\n'):
	stdout.write(str(var) + '\n')

def outa(*var, end='\n'):
	stdout.write(' '.join(map(str, var)) + end)

def lmp():
	return list(mp())

def mp():
	return map(int, inp().split())

def smp():
	return map(str, inp().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(m, val) for j in range(n)]

def remadd(x, y):
	return 1 if x % y else 0

def ceil(a, b):
	return (a + b - 1) // b
S1 = 'abcdefghijklmnopqrstuvwxyz'
S2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

def isprime(x):
	if x <= 1:
		return False
	if x in (2, 3):
		return True
	if x % 2 == 0:
		return False
	for i in range(3, int(sqrt(x)) + 1, 2):
		if x % i == 0:
			return Fals
	return True
for _ in range(iinp()):
	n = iinp()
	n = n // 2
	print(n * (n + 1) * (2 * n + 1) // 6 * 8)


for i in range(int(input())):
	a = int(input())
	if a == 1:
		print(0)
	elif a == 3:
		print(8)
	else:
		res = 0
		for j in range(1, a - (a + 1) // 2 + 1):
			res += j * 8 * j
		print(res)


def solve():
	n = int(input())
	return int((n - 1) * n * (n + 1) / 3)
T = int(input())
for t in range(T):
	print(solve())


def main_function():
	from sys import stdin
	from sys import stdout
	input = stdin.readline
	print = stdout.write
	t = int(input())
	dp = [0] * 250002
	for i in range(250001):
		dp[i + 1] = dp[i] + i * i
	dp.pop(0)
	for _ in range(t):
		n = int(input())
		print(f'{8 * dp[n // 2]}\n')
main_function()


for u in range(int(input())):
	n = int(input())
	x = n // 2 + 1
	z = 8
	s = 0
	for i in range(1, x):
		s = s + i * z
		z = z + 8
	print(s)


t = int(input(''))
for i in range(0, t):
	n = int(input(''))
	x = int(n / 2 - 0.5)
	moves = x * n ** 2
	for j in range(1, x + 1):
		moves -= (n - 2 * j) ** 2
	print(moves)


import math
import operator

def AcDegaYe():
	n = int(input())
	if n == 1:
		print(0)
	else:
		n = int(n / 2)
		s = 0
		y = 8
		for i in range(1, n + 1):
			s += y * i * i
		print(s)
t = int(input())
for _ in range(t):
	AcDegaYe()


n = int(input())
for k in range(n):
	m = int(input())
	if m == 1:
		print(0)
	else:
		p = m // 2
		ans = 8
		o = p
		for i in range(2, o + 1):
			ans = ans + 8 * i * i
		print(ans)


t = int(input())
inputs = []
for i in range(t):
	n = int(input())
	inputs.append(n)
for n in inputs:
	answer = 0
	for i in range(n, 2, -2):
		answer += int(i / 2) * (i * 4 - 4)
	print(answer)


t = int(input())
ans = []
for i in range(t):
	n = int(input())
	s = 0
	x = (n + 1) // 2
	for i in range(1, x):
		s += i * 8 * i
	ans.append(s)
for i in range(t):
	print(ans[i])


t = int(input())
while t > 0:
	inp = int(input())
	temp = int((inp - 1) / 2)
	ans = 0
	for i in range(1, temp + 1):
		ans += ((2 * i + 1) ** 2 - (2 * i - 1) ** 2) * i
	print(ans)
	t -= 1


t = int(input())
while t > 0:
	n = int(input())
	p = (n - 1) // 2
	i = n
	count = 0
	while i >= 3:
		count = count + (i * 4 - 4) * p
		p -= 1
		i = i - 2
	print(count)
	t = t - 1


t = int(input())
for _ in range(t):
	bs = int(input())
	center = bs // 2
	ans = 0
	for i in range(bs // 2 + 1):
		ans += i * (4 * (2 * i + 1) - 4)
	print(ans)


import sys, os.path, math
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
sys.setrecursionlimit(10 ** 5)

def mod():
	return 1000000007

def i():
	return sys.stdin.readline().strip()

def ii():
	return int(sys.stdin.readline())

def li():
	return list(sys.stdin.readline().strip())

def mii():
	return map(int, sys.stdin.readline().split())

def lii():
	return list(map(int, sys.stdin.readline().strip().split()))

def solve():
	a = ii()
	a //= 2
	print(a * (a + 1) * (2 * a + 1) * 4 // 3)
for _ in range(ii()):
	solve()


def solve():
	n = int(input())
	ans = 0
	for i in range(1, n // 2 + 1):
		ans += i * 8 * i
	print(ans)
n = int(input())
for _ in range(n):
	solve()


def sol():
	x = int(input())
	v = x // 2
	res = 8 * v * (v + 1) * (2 * v + 1) // 6
	print(res)
for n in range(int(input())):
	sol()


t = int(input())
for _ in range(t):
	n = int(input())
	sm = 0
	for i in range(3, n + 1, 2):
		sm += (i * 4 - 4) * (i // 2)
	print(sm)


t = int(input())
for i in range(0, t):
	n = int(input())
	answer = (n - 1) * (n + 1) * n
	answer /= 3
	print(str(int(answer)))


from sys import stdin, gettrace
if not gettrace():

	def input():
		return next(stdin)[:-1]

def main():

	def solve():
		n = int(input())
		res = 0
		m = (n + 1) // 2
		print(8 * (m * (m - 1) * (2 * m - 1)) // 6)
	q = int(input())
	for _ in range(q):
		solve()
main()


t = int(input())
while t:
	k = 1
	ans = 0
	n = int(input())
	for i in range(3, n + 1, 2):
		ans += (4 * i - 4) * k
		k += 1
	print(ans)
	t -= 1


def input1(type=int):
	return type(input())

def input2(type=int):
	[a, b] = list(map(type, input().split()))
	return (a, b)

def input2(type=int):
	[a, b, c] = list(map(type, input().split()))
	return (a, b, c)

def input_array(type=int):
	return list(map(type, input().split()))

def input_string():
	s = input()
	return list(s)

def main():
	t = input1()
	for ci in range(t):
		n = input1()
		c = 8
		res = 0
		for i in range(1, n // 2 + 1):
			res += c * i
			c += 8
		print(res)
	return
main()


for x in range(int(input())):
	s = 0
	z = []
	n = int(input())
	for x1 in range(n, 2, -2):
		k = x1 * 4 - 4
		s += k
		z.append(s)
	print(sum(z))


def main(n):
	m = n // 2
	return 8 * (m * (m + 1) * (2 * m + 1) // 6)
t = int(input())
out_list = []
for i in range(t):
	n = int(input())
	out_list.append(main(n))
for num in out_list:
	print(num)


def boardmoves(n):
	x = n // 2
	steps = 0
	for i in range(1, x + 1):
		steps += 8 * i * i
	print(steps)
t = int(input())
for i in range(t):
	n = int(input())
	boardmoves(n)


for _x in range(int(input())):
	p = int(input())
	q = (p + 1) // 2
	q = p - q
	ma = 0
	while p > 1:
		ma += (p ** 2 - (p - 2) ** 2) * q
		q -= 1
		p -= 1
		p -= 1
	print(ma)


total = int(input())
for i in range(total):
	num = int(input()) // 2
	print(8 * (num * (num + 1) * (2 * num + 1) // 6))


t = int(input())
for i in range(0, t):
	n = int(input())
	sum = 0
	i = 1
	while i <= n:
		sum += (4 * i - 4) * (i - 1) // 2
		i += 2
	print(sum)


for t in range(int(input())):
	n = int(input())
	result = 0
	if n != 1:
		i = 1
		while i <= int(n / 2):
			result += 8 * i * i
			i += 1
	print(result)


def maxMoves(n):
	move = 1
	pos = 3
	oneSide = 0
	for i in range(n // 2, 1, -1):
		oneSide += pos * move
		pos += 2
		move += 1
	allSides = oneSide * 4
	mid = 0
	move = 1
	for i in range(n // 2, 1, -1):
		mid += move
		move += 1
	mid = mid * 4
	print(mid + allSides + n // 2 * 4 + n // 2 * (n // 2) * 4)

def main():
	t = int(input())
	for i in range(t):
		maxMoves(int(input()))
main()


n = int(input())
for k in range(n):
	m = int(input())
	if m == 1:
		print('0')
	else:
		print(int(m * ((m - 1) / 2) * ((m - 1) / 2 + 1) / 3 * 4))


dp = [0 for i in range(500001)]
idx = 1
for i in range(3, 500001, 2):
	dp[i] = dp[i - 2] + idx * 8 * idx
	idx += 1
t = int(input())
for i in range(t):
	n = int(input())
	print(dp[n])


import sys, re, math
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from heapq import heappush, heappop, heapify, nlargest, nsmallest

def STR():
	return list(input())

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST():
	return list(map(int, input().split()))

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def sortListWithIndex(listOfTuples, idx):
	return sorted(listOfTuples, key=lambda x: x[idx])

def sortDictWithVal(passedDic):
	temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
	toret = {}
	for tup in temp:
		toret[tup[0]] = tup[1]
	return toret

def sortDictWithKey(passedDic):
	return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
t = INT()
while t != 0:
	n = INT()
	cnt = 0
	ans = 0
	tmep = n // 2
	ans = 8 * (tmep * (tmep + 1) * (2 * tmep + 1) // 6)
	print(ans)
	t -= 1


t = int(input())
for case in range(t):
	n = int(input())
	S = 0
	for i in range((n - 1) // 2):
		S += 8 * (i + 1) * (i + 1)
	print(S)


import sys

def main():
	t = int(input())
	for _ in range(t):
		n = int(sys.stdin.readline().strip())
		if n == 1:
			print(0)
		else:
			ans = 0
			n -= 1
			temp = n
			while n > 0:
				ans += temp * 4
				n -= 2
				temp += n
			print(ans)
	return
main()


for _ in range(int(input())):
	n = int(input())
	i = 2
	j = 1
	out = 0
	while i <= n:
		out += i * j
		i += 2
		j += 1
	print(4 * out)


from collections import defaultdict as dd
from collections import Counter as ccd
from itertools import permutations as pp
from itertools import combinations as cc
from random import randint as rd
from bisect import bisect_left as bl
from bisect import bisect_right as br
import heapq as hq
import math
mod = pow(10, 9) + 7

def inp(flag=0):
	if flag == 0:
		return list(map(int, input().strip().split(' ')))
	else:
		return int(input())

def distance(x1, y1, x2, y2):
	return max(abs(x1 - x2), abs(y1 - y2))
for _ in range(int(input())):
	n = inp(1)
	ans2 = 0
	for i in range(1, n // 2 + 1):
		ans2 += i * i * 8
	print(ans2)


for ii in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		x = n // 2
		s = 8
		c = 8
		for i in range(2, x + 1):
			c = c + 8
			s += c * i
		print(s)


import math
import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
test_cases = inp()
for _ in range(test_cases):
	size = inp()
	counter = 0
	temp = size
	for i in range(size // 2, 0, -1):
		counter += i * (2 * temp + 2 * (temp - 2))
		temp -= 2
	print(counter)


t = int(input())
for _ in range(t):
	n = int(input())
	c = n // 2
	s = c * (c + 1) * (2 * c + 1) // 6
	print(8 * s)


t = int(input())
for i in range(t):
	n = int(input())
	res = 0
	k = int(n / 2)
	while n > 0:
		val = (4 * n - 4) * k
		res = res + val
		k = k - 1
		n = n - 2
	print(res)


t = int(input())
for _ in range(t):
	n = int(input())
	k = (n + 1) // 2
	print((8 * k ** 3 - 12 * k ** 2 + 4 * k) // 3)


from collections import Counter
import math
mod = 10 ** 9 + 7
for i in range(int(input())):
	n = int(input())
	x = 8
	ans = 0
	for i in range(n // 2):
		ans += (i + 1) * x
		x += 8
	print(ans)


q = int(input())
while q:
	n = int(input())
	ans = 0
	for i in range(n // 2, 0, -1):
		x = (n - 1) * 4 * i
		n = n - 2
		ans = ans + x
	print(ans)
	q = q - 1


import math
LI = lambda : list(map(int, input().split()))
MAP = lambda : map(int, input().split())
IN = lambda : int(input())
for _ in range(IN()):
	n = IN()
	if n == 1:
		print(0)
	else:
		a = 2 * (n - 1) // 4
		s = 0
		b = (pow(n, 2) - 1 - a) // 4
		x = int(math.sqrt(b))
		for i in range(1, x + 1):
			s += i * (2 * i - 1)
		s += x * (x + 1) // 2
		print(int(4 * s))


t = input()
for _ in range(int(t)):
	n = int(input())
	if n == 1:
		ans = 0
	else:
		i = 1
		ans = 0
		a = 8
		b = 1
		while i <= n // 2:
			ans += a * b
			a += 8
			b += 1
			i += 1
	print(ans)


from collections import defaultdict
import heapq

def solve():
	n = int(input())
	m = n // 2
	m2 = m * (m + 1) * (2 * m + 1) // 6
	print(8 * m2)
for _ in range(int(input())):
	solve()


n = int(input())
for i in range(n):
	lens = int(input())
	count = 0
	for j in range(3, lens + 1, 2):
		count += 2 * (j - 1) * (j - 1)
	print(count)


t = int(input())
for _ in range(t):
	n = int(input())
	layer = n // 2
	res = 0
	i = 1
	j = 3
	while i <= layer:
		res += 2 * i * j + 2 * i * (j - 2)
		i += 1
		j += 2
	print(res)


T = int(input())
for t in range(T):
	N = int(input())
	sum = 0
	temp = int(N / 2)
	sum += 4 * (temp * (temp + 1) * (4 * temp - 1)) / 6
	sum += temp * (temp + 1) * 2
	print(int(sum))


from sys import stdin, stdout, setrecursionlimit
for _ in range(int(input())):
	n = int(input())
	summa = 0
	while n > 0:
		summa += 4 * (n // 2) + 4 * (n - 2) * (n // 2)
		n -= 2
	print(summa)


for i in range(int(input())):
	n = int(input())
	k = 0
	if n == 1:
		print(0)
		continue
	c = 1
	for j in range(1, n, 2):
		k += 8 * c * c
		c += 1
	print(k)


case = int(input())
while case > 0:
	case -= 1
	temp = int(input())
	print(int((temp * temp - 1) * temp / 3))


t = int(input())
for tt in range(t):
	n = int(input())
	total = 0
	prev = 0
	for i in range(n // 2 + 1):
		sq = (2 * i + 1) ** 2
		total += i * (sq - prev)
		prev = sq
	print(total)


def result(n):
	return 4 * (n * (n + 1) * (2 * n + 1)) // 3
t = int(input())
for i in range(t):
	n = int(input())
	k = (n - 1) // 2
	print(result(k))


for _ in range(int(input())):
	n = int(input())
	total = 0
	l = n // 2
	for i in range(l):
		total += (n - 1) * 4 * (l - i)
		n = n - 2
	print(total)


(t, L) = (int(input()), [])
for _ in range(t):
	L.append(int(input()))
for n in L:
	m = 0
	for i in range(1, n + 1, 2):
		m += 4 * (i - 1) * (i // 2)
	print(m)


from sys import stdout, stdin
(_input, _print) = (stdin.buffer.readline, stdout.write)
(_sum, _int, _range) = (sum, int, range)

def solution():
	for _ in _range(_int(_input())):
		n = _int(_input())
		summary = 0
		for i in _range(n // 2 + 1):
			summary += ((i * 2 + 1) * 2 + (i * 2 - 1) * 2) * i
		print(summary)
solution()


from math import ceil
for _ in range(int(input())):
	n = int(input())
	sum_of_sq = n * (n + 1) * (n - 1) // 24
	print(8 * sum_of_sq)


def get():
	N = int(input())
	if N == 1:
		return 0
	else:
		ans = 0
		k = 1
		for i in range(3, N + 1, 2):
			ans += (i * 4 - 4) * k
			k += 1
		return ans
for _ in range(int(input())):
	print(get())


t = int(input())
for ts in range(t):
	n = int(input())
	if n == 1:
		print(0)
	else:
		suma = 0
		k = 1
		for i in range(3, n + 1, 2):
			suma = suma + k * (4 * i - 4)
			k = k + 1
		print(suma)


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(0)
	else:
		l = [8]
		for i in range(3, n, 2):
			l.append(l[-1] + 8)
		j = 0
		for i in range(1, len(l) + 1):
			l[j] *= i
			j += 1
		print(sum(l))


import sys
from os import path
if path.exists('C:/Users/prana/Desktop/sublime/input.txt'):
	sys.stdin = open('C:/Users/prana/Desktop/sublime/input.txt', 'r')
	sys.stdout = open('C:/Users/prana/Desktop/sublime/output.txt', 'w')

def solve():
	n = int(input())
	ans = 0
	for i in range(1, (n + 1) // 2):
		temp = (2 * i + 1) * 4 - 4
		ans += temp * i
	print(ans)
T = 1
T = int(input())
for _ in range(1, T + 1):
	print('Case #', _, file=sys.stderr)
	solve()


for _ in range(int(input())):
	n = int(input())
	s = 0
	for i in range(1, n // 2 + 1):
		p = 2 * i + 1
		no_of_cell = p * 4 - 4
		s += no_of_cell * i
	print(s)


t = int(input())
ans = [0, 0]
for i in range(2, 500001):
	if i % 2 == 0:
		ans.append(0)
	else:
		ans.append(ans[i - 2] + (4 * i - 4) * (i // 2))
for i in range(t):
	n = int(input())
	print(ans[n])


for t in range(int(input())):
	n = int(input())
	count = 0
	for i in range(1, n + 1):
		if i % 2 == 0:
			continue
		else:
			diff = int(i / 2)
			no_of_ele = i ** 2 - (i - 2) ** 2
			count += diff * no_of_ele
	print(count)


for i in range(int(input())):
	n = int(input())
	p = n // 2
	s = p * (p + 1)
	s += 2 * p * (p + 1) * (p - 1) // 3
	print(4 * s)


k = int(input())
for y in range(k):
	n = int(input())
	b = n * n
	arr = [1]
	b -= 1
	a = 8
	i = 1
	while b > 0:
		b -= a
		arr.append(a)
		i += 1
		a = 8 * i
	sum1 = 0
	for i in range(len(arr)):
		sum1 += i * arr[i]
	print(sum1)


for s in [*open(0)][1:]:
	a = int(s)
	print((a ** 3 - a) // 3)


for _ in range(int(input())):
	j = 3
	n = int(input())
	arr = []
	for i in range(n // 2):
		arr.append(4 * j - 4)
		j += 2
	s = 0
	for i in range(len(arr)):
		s += arr[i] * (i + 1)
	print(s)


t = int(input())
fact = 1
for i in range(0, t):
	n = int(input())
	i = 3
	summ = 0
	while i <= n:
		summ += (i - 1) / 2 * (i * 2 + (i - 2) * 2)
		i += 2
	print(int(summ))


import os
import sys
from io import BytesIO, IOBase

def solution(n):
	if n == 1:
		write(0)
		return
	hmm = n // 2
	the_sum = hmm * (hmm + 1) * (2 * hmm + 1) // 6
	res = 8 * the_sum
	write(res)

def main():
	for _ in range(r_int()):
		n = r_int()
		solution(n)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')

def write(*args, end='\n'):
	for x in args[:-1]:
		sys.stdout.write(str(x) + ' ')
	sys.stdout.write(str(args[-1]))
	sys.stdout.write(end)

def r_array():
	return [int(x) for x in input().split()]

def r_int():
	return int(input())
main()


t = int(input())
ans = []
for i in range(t):
	n = int(input())
	mid = n // 2
	count = 0
	for j in range(mid):
		count += (j + 1) * (2 * j + 1)
	count += mid * (mid + 1) // 2
	ans.append(4 * count)
for i in ans:
	print(i)


from fractions import Fraction
import bisect
import os
from collections import Counter
import bisect
from collections import defaultdict
import math
import random
import heapq as hq
from math import sqrt
import sys
from functools import reduce, cmp_to_key
from collections import deque
import threading
from itertools import combinations
from io import BytesIO, IOBase
from itertools import accumulate

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def tinput():
	return input().split()

def rinput():
	return map(int, tinput())

def rlinput():
	return list(rinput())

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))
for _ in range(iinput()):
	n = iinput()
	val = (n - 1) // 2
	val2 = val * (val + 1) // 2
	ans = val2
	for i in range(1, val + 1):
		ans += i * (2 * i - 1)
	print(ans * 4)


ar = [0] * 500010
no = 8
idx = 1
ar[1] = 0
for i in range(3, 500001, 2):
	ar[i] = ar[i - 2] + no * idx
	no += 8
	idx += 1
t = int(input())
while t > 0:
	x = int(input())
	print(ar[x])
	t -= 1


t = int(input())
while t > 0:
	t = t - 1
	n = int(input())
	m = n // 2
	r = m * (m + 1) * (2 * m + 1) // 6
	print(8 * r)


import sys
T = int(sys.stdin.readline())
for _ in range(T):
	N = int(sys.stdin.readline())
	result = 0
	count = 1
	while not N == 1:
		result += (N - 1) * 4 * (N // 2)
		N -= 2
	print(result)


def getN():
	return int(input())

def getNM():
	return map(int, input().split())

def getList():
	return list(map(int, input().split()))
from collections import defaultdict, deque
from sys import exit
import math
import copy
from bisect import bisect_left
import sys
INF = 10 ** 17
MOD = 998244353

def solve():
	n = getN()
	ans = 0
	radius = n // 2
	for r in range(radius):
		ra = r + 1
		ans += ra * ((ra * 2 + 1) ** 2 - (ra * 2 - 1) ** 2)
	print(ans)

def main():
	n = getN()
	for _ in range(n):
		solve()
main()


for _ in range(int(input())):
	n = int(input())
	s = 0
	for i in range(3, n + 1, 2):
		s += i // 2 * (i - 1) * 4
	print(s)


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(0)
		continue
	k = 0
	while n - 1 != 0:
		k += (n - 1) * 4 * (n // 2)
		n -= 2
	print(k)


for q_ in range(int(input())):
	n = int(input())
	nh = n // 2
	res = 2 * (nh * (1 + nh))
	acc = sum([i for i in range(1, nh + 1)])
	for i in range(nh):
		acc = acc + i
		res += 4 * acc
	print(res)


import math

def solve():
	n = int(input())
	x = n // 2
	return int(8 * (x * (x + 1) * (2 * x + 1) / 6))

def main():
	t = int(input())
	while t:
		print(solve())
		t -= 1
main()


def main():
	n = int(input())
	ans = 0
	temp = 0
	while n > 1:
		ans += n * 4 - 4
		temp += ans
		n -= 2
	print(temp)
	return
t = int(input())
while t:
	main()
	t -= 1


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	m = n // 2 + 1
	if n == 1:
		print(0)
	else:
		ans = 8
		for i in range(2, m, 1):
			res = 8 * i
			ans += res * i
		print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	j = 1
	s = 0
	c = 1
	for i in range(3, n + 1, 2):
		s = s + (i ** 2 - c) * j
		c = i ** 2
		j += 1
	print(s)


t = int(input())
n = []
for i in range(t):
	n.append(int(input()))
for i in n:
	c = 0
	for j in range(int((i + 1) / 2)):
		c += ((i - 2 * j) * 4 - 4) * (int((i + 1) / 2) - j - 1)
	print(c)


q = int(input())
for _ in range(q):
	n = int(input())
	if n == 1:
		print(0)
		continue
	ans = 0
	for d in range(1, n // 2 + 1):
		m = d * 2 + 1
		ans += d * (4 * m - 4)
	print(ans)


for _ in range(int(input())):
	n = int(input())
	m = n // 2
	s = 0
	for i in range(1, m + 1):
		s += i * i * 8
	print(s)


t = int(input())
d = {1: 0}
i = 3
j = 1
while i <= 500000:
	d[i] = d[i - 2] + (2 * i + 2 * (i - 2)) * j
	i += 2
	j += 1
for rep in range(t):
	n = int(input())
	print(d[n])


N = int(input())
for _ in range(N):
	n = int(input())
	ans = 0
	mid = n // 2
	for i in range(1, n + 2, 2):
		ans += (i - 1) // 2 * (i ** 2 - (i - 2) ** 2)
	print(ans)


for _ in range(int(input())):
	print(sum(map(lambda x: 4 * (x - 1) * (x // 2), range(1, int(input()) + 1)[::2])))


for _ in range(int(input())):
	n = int(input())
	if n == 0:
		print(0)
	else:
		cnt = 1
		s = 0
		for i in range(3, n + 1, 2):
			s += cnt * (i * 4 - 4)
			cnt += 1
		print(s)


a = int(input())
for i in range(a):
	n = int(input())
	s = 0
	k = n
	for j in range(n // 2):
		g = k ** 2 - (k - 2) ** 2
		s += g * (k // 2)
		k = k - 2
	print(s)


x = int(input())
for i in range(x):
	n = int(input())
	summator = 0
	for j in range(1, n, 2):
		summator += 2 * (n - j) ** 2
	print(summator)


test = int(input())
for _ in range(test):
	n = int(input())
	s = n // 2
	step = 0
	for i in range(1, s + 1):
		step += i * i * 8
	print(step)


for i in range(int(input())):
	n = int(input())
	k = [0 for i in range(n + 1)]
	fg = 1
	for j in range(3, n + 1, 2):
		fj = (j * j - (j - 2) ** 2) * fg
		k[j] = k[j - 2] + fj
		fg += 1
	print(k[n])


N = 500010 // 2
t = int(input())
A = [0] * N
for i in range(1, N):
	j = 2 * i + 1
	A[i] = i * 8 * (j // 2) + A[i - 1]
while t:
	n = int(input())
	print(A[n // 2])
	t -= 1


for _ in range(int(input())):
	n = int(input())
	print(n * (n ** 2 - 1) // 3)


import sys
input = sys.stdin.readline
t = int(input())
for i in range(t):
	n = int(input())
	ans = 0
	for i in range(1, n // 2 + 1):
		ans += 8 * i * i
	sys.stdout.write(str(ans) + '\n')


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		x = n // 2
		prev = 1
		s = 1
		ans = 0
		for i in range(x):
			s += 2
			a = s * s
			a -= prev
			ans += a * (i + 1)
			prev = s * s
		print(ans)


import sys
input = sys.stdin.readline
from collections import *
t = int(input())
for _ in range(t):
	n = int(input())
	m = (n + 1) // 2
	ans = 0
	c = 8
	for i in range(1, m):
		ans += c * i
		c += 8
	print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	j = 8
	x = 0
	for i in range(1, n // 2 + 1):
		x += j * i
		j += 8
	print(x)


t = int(input())
for i in range(t):
	n = int(input())
	min_mov = sum([j * j * 8 for j in range(n // 2 + 1)])
	print(min_mov)


try:
	for _ in range(int(input())):
		n = int(input())
		ans = 0
		for i in range(1, n // 2 + 1):
			ans += 8 * i * i
		print(ans)
except:
	pass


dp = [0] * 500005
dp[1] = 0
temp = 0
k = 1
for i in range(3, 500005, 2):
	temp = (temp // 4 + 2) * 4
	dp[i] = dp[i - 2] + k * temp
	k += 1
for _ in range(int(input())):
	n = int(input())
	print(dp[n])


def solve_task(n):
	n = int(n)
	if n == 1:
		return 0
	steps = 0
	for i in range(n, 1, -2):
		steps += (i * 2 + (i - 2) * 2) * (i // 2)
	return steps

def main():
	n_tests = int(input())
	solutions = []
	for t in range(n_tests):
		task = input()
		solutions.append(solve_task(task))
	for s in solutions:
		print(s)
main()


import sys

def minp():
	return sys.stdin.readline().strip()

def mint():
	return int(minp())

def mints():
	return map(int, minp().split())

def solve():
	n = mint()
	m = n // 2
	print(8 * m * (m + 1) * (2 * m + 1) // 6)
for i in range(mint()):
	solve()


tc = int(input())
for i in range(tc):
	size = int(input())
	prev = 1
	ans = 0
	for j in range(1, size + 1, 2):
		all = j * j
		ans += (all - prev) * ((j + 1) / 2 - 1)
		prev = all
	print(int(ans))


for i in range(int(input())):
	n = int(input())
	sub_n = n - 2
	n_sq = n * n
	print((n - 1) // 2 * n_sq - sub_n * (sub_n + 1) * (sub_n + 2) // 6)


from sys import stdin, exit
input = stdin.readline

def i():
	return input()

def ii():
	return int(input())

def iis():
	return map(int, input().split())

def liis():
	return list(map(int, input().split()))

def print_array(a):
	print(' '.join(map(str, a)))
ans = [0]
start = 0
for i in range(1, 5 * 10 ** 5 + 1, 2):
	ans.append(ans[-1] + (i * 4 - 4) * start)
	ans.append(ans[-1])
	start += 1
t = ii()
for _ in range(t):
	n = ii()
	print(ans[n])


t = int(input())
while t:
	n = int(input())
	m = (n - 1) / 2
	ans = 8 / 6 * m * (m + 1) * (2 * m + 1)
	print(round(ans))
	t -= 1


for _ in range(int(input())):
	n = int(input())
	m = n - 1
	l = []
	while m > 0:
		l.append(m * 4)
		m -= 2
	l.reverse()
	for i in range(len(l)):
		l[i] = l[i] * (i + 1)
	print(sum(l))


t = int(input())
while t > 0:
	n = int(input())
	n1 = n // 2
	sum = n1 * (n1 + 1) * (2 * n1 + 1) * 4 // 3
	print(sum)
	t -= 1


t = int(input())

def steps(n):
	answer = 0
	for i in range(1, (n - 1) // 2 + 1):
		answer += 8 * i * i
	return answer
for _ in range(t):
	n = int(input())
	print(steps(n))


t = int(input())
ans = []
for s in range(t):
	n = int(input())
	q = int(n // 2)
	m = 4 * q * (q + 1) * (2 * q + 1)
	ans.append(int(m / 3))
for it in ans:
	print(it)


t = int(input())
for i in range(t):
	n = int(input())
	s = 0
	for j in range(n // 2):
		temp = n - 2 * j
		s += (4 * temp - 4) * (n // 2 - j)
	print(s)


from math import pow
t = int(input())
while t != 0:
	n = int(input())
	n = (n - 1) // 2
	s = 0
	for i in range(n + 1):
		s += 8 * i * i
	print(s)
	t -= 1


import sys
sys.setrecursionlimit(2000)
from collections import Counter
from functools import reduce
t = [int(val) for val in sys.stdin.readline().split()][0]
N = 5 * 10 ** 5 + 2
i = [val for val in range(1, N, 2)]
a = {}
a[1] = 0
for (ind, val) in enumerate(i[1:]):
	a[val] = a[val - 2] + 8 * (ind + 1) ** 2
for test in range(t):
	n = [int(val) for val in sys.stdin.readline().split()][0]
	print(a[n])


q = int(input())
for i in range(q):
	n = int(input())
	total = n * n - 1
	k = 1
	cnt = 0
	if n % 2 != 0:
		while total > 0:
			total = total - 8 * k
			cnt = cnt + 8 * k * k
			k += 1
		print(cnt)
	else:
		n = n - 1
		k = 1
		cnt = 0
		while total - 8 * k >= 0:
			total = total - 8 * k
			cnt = cnt + 8 * k * k
			k += 1
		cnt += total * k
		print(cnt)


from collections import deque
t = int(input())
rez = []
for i in range(t):
	n = int(input())
	s = 0
	k = 0
	t1 = 0
	j = 1
	while j <= n:
		s += k * t1
		k += 8
		t1 += 1
		j += 2
	rez.append(s)
for i in range(len(rez)):
	print(rez[i])


t = int(input())
for _ in range(t):
	n = int(input())
	val = n // 2
	res = val * (val + 1) * (2 * val + 1)
	res *= 8
	print(res // 6)


from collections import Counter
import math

def solve():
	n = int(input())
	v1 = n // 2
	if n == 1:
		print(0)
	else:
		sum1 = 0
		c = 0
		v = 0
		for i in range(v1):
			c = c + 8
			v = v + 1
			sum1 += c * v
		print(sum1)
for _ in range(int(input())):
	solve()


t = int(input())
while t > 0:
	n = int(input())
	n = n * n - 1
	total = 0
	e = 1
	while 1:
		if n > 8:
			if n - 8 * e < 0:
				total += n * e
				break
			n = n - 8 * e
			total += 8 * e * e
			e += 1
		else:
			total += n * e
			break
	print(total)
	t -= 1


from math import *

def main():
	for _ in range(int(input())):
		n = int(input())
		(times, start) = ((n - 1) // 2, (n - 1) // 2)
		ans = 0
		sides = n
		for i in range(start):
			ans += sides * times + 2 * ((sides - 1) * times) + (sides - 2) * times
			sides -= 2
			times -= 1
		print(ans)
main()


for i in range(int(input())):
	n = int(input())
	(sum, count, flag) = (0, 1, 1)
	if n == 1:
		print(0)
		flag = 0
	for i in range(3, n + 1, 2):
		sum = sum + i * count * 4 - 4 * count
		count = count + 1
	if flag == 1:
		print(sum)


T = int(input())

def ans(n):
	n = n // 2
	return 8 * (n * (n + 1) * (2 * n + 1)) // 6
for t in range(T):
	n = int(input())
	print(ans(n))


import sys
import math
import itertools
from copy import copy
from collections import deque, Counter
from decimal import Decimal

def s():
	return input()

def i():
	return int(input())

def S():
	return input().split()

def I():
	return map(int, input().split())

def L():
	return list(input().split())

def l():
	return list(map(int, input().split()))

def lcm(a, b):
	return a * b // math.gcd(a, b)
sys.setrecursionlimit(10 ** 9)
mod = 10 ** 9 + 7
t = i()
for k in range(t):
	n = i()
	ans = 0
	for j in range(1, n + 1, 2):
		ans += (j - 1) * (j // 2) * 4
	print(ans)


t = int(input())
for j in range(t):
	n = int(input())
	s = 0
	k = 1
	f = 1
	for i in range(3, n + 1, 2):
		a = i ** 2
		s = s + (a - k) * f
		k = a
		f = f + 1
	print(s)


t = int(input())
for i in range(t):
	n = int(input())
	a = n // 2
	ans = 0
	ans += a * (a + 1) * 2
	y = 0
	for j in range(a):
		y = y + (j + 1) * (2 * j + 1)
	print(ans + 4 * y)


n = int(input())
for i in range(n):
	k = int(input())
	r = k
	s = 0
	for i in range(k // 2, 0, -1):
		s = s + (r * 4 - 4) * i
		r = r - 2
	print(s)


for i in range(int(input())):
	n = int(input())
	l = (n - 1) // 2
	c = 1
	k = 1
	ans = 0
	while l:
		l -= 1
		ans += ((c + 2) ** 2 - c ** 2) * k
		c += 2
		k += 1
	print(ans)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
		continue
	m = n // 2
	k = 8
	c = 1
	s = 0
	for i in range(m):
		s = s + c * k
		k = k + 8
		c = c + 1
	print(s)


cases = int(input())
for i in range(cases):
	n = int(input())
	tot = 0
	if n == 1:
		print(0)
		continue
	else:
		for i in range(1, (n - 1) // 2 + 1):
			tot += pow(i, 2)
		print(tot * 8)


t = int(input())
for i in range(t):
	n = int(input())
	res = n * (n + 1) * (2 * n + 1) // 6 - n * (n + 1) // 2
	print(res)


for __ in range(int(input())):
	n = int(input())
	x = 1
	a = 0
	inn = 1
	for i in range(0, n // 2 + 1):
		a += (x * x - inn) * i
		inn = x * x
		x += 2
	print(a)


def fun(n):
	n = n // 2
	n = n * (n + 1) * (2 * n + 1) * 8
	n = n // 6
	print(n)
for i in range(0, int(input())):
	n = int(input())
	fun(n)


t = int(input())
for T in range(t):
	n = int(input())
	if n == 1:
		print(0)
		continue
	if n == 3:
		print(8)
		continue
	step = 3
	val = 2
	total = pow(n, 2)
	prev = 8
	ans = 0
	while step < n:
		ans += prev
		ans += (pow(step + 2, 2) - pow(step, 2)) * val
		val += 1
		step += 2
	ans -= 8 * ((n - 5) // 2)
	print(ans)


def solve(n):
	res = 0
	for i in range(1, (n + 1) // 2):
		res += i * i * 8
	return res

def main():
	T = int(input())
	for _ in range(T):
		n = int(input())
		print(solve(n))
main()


def lsput():
	return list(map(int, input().split()))

def mput():
	return map(int, input().split())

def lsplit():
	return list(map(int, list(input())))
t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(0)
		continue
	else:
		n = n - 1
		n = n // 2
		s = n * (n + 1) * (2 * n + 1) / 6
		s = int(s) * 8
		print(s)


def solve(n):
	cnt = 0
	if n == 1:
		return cnt
	else:
		while n - 2 >= 1:
			cnt += (n ** 2 - (n - 2) ** 2) * (n // 2)
			n -= 2
		return cnt
for _ in range(int(input())):
	n = int(input())
	print(solve(n))


import sys
input = sys.stdin.buffer.readline

def I():
	return list(map(int, input().split()))

def sieve(n):
	a = [1] * n
	for i in range(2, n):
		if a[i]:
			for j in range(i * i, n, i):
				a[j] = 0
	return a
for __ in range(int(input())):
	n = int(input())
	s = 0
	for i in range(1, (n - 1) // 2 + 1):
		s += i * 8 * i
	print(s)


q = int(input())
for i in range(q):
	n = int(input())
	n = n // 2
	summ = 0
	print(8 * n * (n + 1) * (2 * n + 1) // 6)


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(0)
		continue
	i = 8
	j = 3
	dist = 1
	while j < n:
		j += 2
		dist += 1
		i += (4 * j - 4) * dist
	print(i)


for __ in range(int(input())):
	n = int(input())
	d = int(n / 2)
	s = int(d * (d + 1) * (2 * d + 1) / 6)
	print(8 * s)


t = int(input())
for g in range(t):
	n = int(input())
	res = 0
	for i in range(0, n + 1, 2):
		res = res + i / 2 * (i / 2) * 8
	print(round(res))


t = int(input())
for tt in range(t):
	n = int(input())
	if n == 1:
		print(0)
	else:
		n = n // 2
		s = 0
		d = 8
		for i in range(1, n + 1):
			s = s + d * i
			d = 8 * (i + 1)
		print(s)


T = int(input())
for t in range(T):
	n = int(input())
	ans = 0
	for i in range(3, n + 1, 2):
		ans += i // 2 * (pow(i, 2) - pow(i - 2, 2))
	print(ans)


for _ in range(int(input())):
	n = int(input())
	ans = 0
	(cx, cy) = (n // 2, n // 2)
	for i in range(1, n // 2 + 1):
		ans += 8 * i * i
	print(ans)


n = int(input())
a = []
for i in range(n):
	a.append(int(input()))

def squaresum(n):
	sm = 0
	for i in range(1, n + 1):
		sm = sm + i * i
	return sm
for i in a:
	print(8 * squaresum(int(i // 2)))


from sys import stdin

def solve(n):
	p = (n - 1) // 2
	ans = 8 * p * (p + 1) * (p * 2 + 1) // 6
	print(ans)
	return

def main():
	inp = stdin.readline
	for _ in range(int(inp())):
		n = int(inp())
		solve(n)
main()


t = int(input())

def solve(n):
	if n == 1:
		return 0
	amt = 0
	outrow = 8
	j = 1
	for i in range(1, n, 2):
		amt += j * outrow
		outrow += 8
		j += 1
	return amt
for _ in range(t):
	n = int(input())
	print(solve(n))


t = int(input())
while t:
	t -= 1
	n = int(input())
	c = 0
	v = n // 2
	p = n // 2
	for i in range(n, 2, -2):
		c += (4 * i - 4) * p
		p -= 1
	print(c)


def solve1():
	n = int(input())
	ans = 0
	cnt = 1
	for i in range(3, n + 1, 2):
		ans += (4 * i - 4) * cnt
		cnt += 1
	print(ans)
for _ in range(int(input())):
	solve1()


t = int(input())
for _ in range(t):
	n = int(input())
	validLayers = n // 2
	count = 0
	for i in range(1, validLayers + 1):
		count += 8 * i * i
	print(count)


t = int(input())
memo = [0]
for n in range(1, 250001):
	memo.append(n * (4 * (2 * n - 1) + 4) + memo[n - 1])
for _ in range(t):
	n = int(input())
	print(memo[n // 2])


def a(n):
	if n == 1:
		return 0
	else:
		return (n - 1) * 4 * (n // 2) + a(n - 2)
a = list()
t = int(input())
for _ in range(t):
	n = int(input())
	a.append(0)
	for i in range(3, n + 2, 2):
		a.append((i - 1) * 4 * (i // 2) + a[len(a) - 1])
	print(a[len(a) - 1])


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		t = n // 2
		u = n - 2
		total = t * n
		k = total
		for i in range(t - 1):
			k -= u
			total += k
			u -= 2
		total *= 2
		total += k - u
		print(total)


t = int(input())
for _ in range(t):
	n = int(input())
	total = 0
	for a in range(1, n // 2 + 1):
		b = 2 * a + 1
		total += a * (b * 2 + (b - 2) * 2)
	print(total)


t = int(input())
for z in range(t):
	n = int(input())
	a = 3
	b = 1
	s = 0
	for i in range(1, n // 2 + 1):
		s += i * (a + b)
		a = a + 2
		b = b + 2
	print(2 * s)


import math
test = int(input())
for i in range(test):
	n = int(input())
	S = 0
	for i in range(1, math.ceil(n / 2)):
		S += i * i * 8
	print(S)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	elif n < 4:
		print(n * n - 1)
	else:
		total = 0
		short = 0
		for i in range(n // 2):
			short += i + 1
		total += 8 * short
		long_p = 0
		for i in range(n // 2 - 1):
			long_p += (n - 2 * i - 3) * (n // 2 - i)
		total += 4 * long_p
		print(total)


t = int(input())
for test in range(t):
	n = int(input())
	if n == 1:
		print(0)
	else:
		o = (n - 1) // 2
		sq = 1
		s = 0
		for i in range(o):
			s += 8 * sq * sq
			sq += 1
		print(s)


t = int(input())
while t:
	n = int(input())
	if n == 1:
		print('0')
	else:
		n = n // 2
		ans = n * (n + 1) * (2 * n + 1) * 8 // 6
		print(ans)
	t -= 1


t = int(input())
for i in range(t):
	n = int(input())
	ans = 0
	m = n // 2
	for j in range(m):
		ans = ans + (n - 2 * j - 1) * 4 * (m - j)
	print(ans)


t = int(input())
while t:
	n = int(input())
	mid = (n - 1) // 2
	su = 0
	x = mid
	while x:
		su += 2 * x * x - x
		x -= 1
	su *= 4
	su += 2 * (mid * (mid + 1))
	print(su)
	t -= 1


def BlockCountOfPhase(phase):
	if phase == 1:
		return 1
	elif phase == 2:
		return 8
	else:
		return ((phase - 3) * 2 + 1) * 4 + 12
for _ in range(int(input())):
	n = int(input())
	Nphase = int((n + 1) / 2)
	ans = 0
	for i in range(1, Nphase + 1):
		ans += BlockCountOfPhase(i) * (i - 1)
	print(ans)


T = int(input())
sz = int(5 * 100000.0 + 1)
pre = [0] * sz
for i in range(1, sz):
	if i % 2 == 1:
		pre[i] = (4 * (i - 2) + 4) * (i // 2)
	pre[i] += pre[i - 1]
for t in range(T):
	n = int(input())
	print(pre[n])


import math
t = int(input())
lst = list()
for i in range(t):
	n = int(input())
	lst.append(n)
for i in lst:
	a = 1
	c = 1
	p = 0
	while i > a:
		d = (a + 2) ** 2 - a ** 2
		p = p + d * c
		c = c + 1
		a = a + 2
	print(p)


t = int(input())
while t:
	t -= 1
	n = int(input())
	i = 1
	sum = 0
	sum1 = 0
	k = n * n - 1
	while sum < k:
		l = i * 8
		sum += l
		sum1 += i * l
		i += 1
	print(sum1)


def ways(chislo):
	n = (chislo - 1) // 2
	return ((2 * n + 1) ** 2 - (2 * (n - 1) + 1) ** 2) * n
for _ in range(int(input())):
	n = int(input())
	summ = 0
	while n != 1:
		summ += ways(n)
		n -= 2
	print(summ)


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	ans = 0
	for (idx, i) in enumerate(range(1, n + 1, 2)):
		pi = idx * (i * i - (i - 2) * (i - 2))
		ans += pi
	print(ans)


from sys import stdin
from collections import deque
mod = 10 ** 9 + 7
import sys
import random
from queue import PriorityQueue
from bisect import bisect_right
from bisect import bisect_left
from collections import defaultdict
from math import sqrt, factorial, gcd, log2, inf, ceil
import heapq
input = lambda : sys.stdin.readline().rstrip()
from sys import stdin, stdout
from heapq import heapify, heappush, heappop
from itertools import permutations
from math import factorial as f

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p
import sys
t = int(input())
for _ in range(t):
	n = int(input())
	k = (n - 1) // 2
	z = 8 * (k * (k + 1) * (2 * k + 1) // 6)
	print(z)


t = int(input())
for ii in range(0, t):
	n = int(input())
	summa = 0
	s_n = 0
	k_n = 1
	while k_n <= n:
		summa = summa + 4 * (k_n - 1) * s_n
		k_n += 2
		s_n += 1
	print(summa)


t = int(input())
for _ in range(t):
	n = int(input())
	strt = n // 2
	ans = strt * (strt + 1) // 2 * 2
	dup = ans
	supp = ans
	add = 1
	for i in range(strt):
		supp = supp + add
		ans += supp
		add += 2
	ans = ans - dup
	ans = ans * 2
	ans += dup
	print(ans)


t = int(input())
n = []
for i in range(t):
	a = int(input())
	n.append(a)
for i in range(len(n)):
	s = n[i] // 2
	ans = 8 * (s * (s + 1) * (2 * s + 1) // 6)
	print(ans)


from sys import stdin, stdout
inp = stdin.readline
out = stdout.write
for _ in range(int(inp())):
	n = int(inp())
	k = (n - 1) // 2
	out(str(8 * k * (k + 1) * (2 * k + 1) // 6) + '\n')


import sys
import bisect
Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
for _ in range(int(ri())):
	n = int(ri())
	no = (n - 1) // 2
	ans = 0
	for i in range(1, no + 1):
		ans += (2 * (2 * i + 1) + 2 * i - 1 + 2 * i - 1) * i
	print(ans)


def main():
	t = int(input())
	for i in range(t):
		solve()

def solve():
	n = int(input())
	current = n
	layers = current // 2
	moves = 0
	for i in range(layers):
		moves += 4 * (current - 1) * layers
		layers -= 1
		current -= 2
	print(moves)
main()


t = int(input())
for i in range(t):
	n = int(input())
	steps = 0
	eight = 8
	for j in range(1, n // 2 + 1):
		steps += j * eight
		eight += 8
	print(steps)


import sys

def main():
	t = int(input())
	while t:
		n = int(input())
		n = n // 2
		r = int(4 * n * (n + 1) * (2 * n + 1) / 3)
		print(r)
		t -= 1
main()


import math as m
t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(0)
	else:
		e = 0
		ans = 0
		for i in range(n - m.ceil(n / 2)):
			ans += (i + 1) * (e + 8)
			e += 8
		print(ans)


cases = int(input())
for i in range(cases):
	a = int(input())
	tot = 0
	for j in range((a - 1) // 2):
		tot += (j + 1) * (4 * (2 * j + 1) + 4)
	print(tot)


import math
import sys
t = int(input())
for i in range(t):
	n = int(input())
	n = n // 2
	print(8 * n * (n + 1) * (2 * n + 1) // 6)


t = int(input())
answer = []
for _ in range(t):
	n = int(input())
	keys = n // 2
	sums = 0
	for i in range(keys):
		row = (1 + i) * 2 + 1
		col = row - 2
		sums = sums + (row * 2 + col * 2) * (i + 1)
	answer.append(sums)
for item in answer:
	print(item)


def solve(n):
	n = (n - 1) // 2
	return int(8 * n * (n + 1) * (2 * n + 1) / 6)

def solve_(n):
	i = 1
	summ = 0
	while i <= (n - 1) / 2:
		summ += i * i
		i += 1
	return summ * 8

def main():
	t = int(input())
	rest = []
	for _ in range(t):
		n = int(input())
		rest.append(solve(n))
	for i in rest:
		print(i)
main()


t = int(input())
ans = []
for i in range(t):
	n = int(input())
	if n == 1:
		ans.append(0)
	else:
		j = 1
		k = 8
		res = 0
		n1 = 1
		while n1 != n:
			res += k * j
			k += 8
			j += 1
			n1 += 2
		ans.append(res)
for i in range(t):
	print(ans[i])


ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
for _ in range(ii()):
	n = ii()
	c = 0
	for i in range(n, 0, -1):
		c = c + i * (i - 1)
	print(c)


(z, zz) = (input, lambda : list(map(int, z().split())))
zzz = lambda : [int(i) for i in stdin.readline().split()]
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from string import *
from re import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from itertools import accumulate as ac

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0 and x != 2 or x == 0:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = True
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)
num = int(z())
for _ in range(num):
	n = int(z())
	middel = n // 2
	ans = 0
	k = 8
	for i in range(1, middel + 1):
		ans += i * k * i
	print(ans)


import sys
import math
from collections import Counter, defaultdict
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass

def takeInput():
	return [int(x) for x in input().strip().split()]
t = int(input())
while t != 0:
	t -= 1
	n = int(input())
	factor = 8
	count = 0
	for i in range(1, n // 2 + 1):
		count += factor * i
		factor += 8
	print(count)


q = int(input())
while q:
	n = (int(input()) - 1) // 2
	print(8 * n * (n + 1) * (2 * n + 1) // 6)
	q -= 1


for _ in range(int(input())):
	n = int(input())
	sums = 0
	while n >= 3:
		sums += int(n / 2) * (4 * n - 4)
		n -= 2
	print(sums)


testcases = int(input())
while testcases > 0:
	testcases = testcases - 1
	n = int(input())
	if n == 1:
		print(0)
		continue
	n = n // 2
	print(n * (n + 1) * (2 * n + 1) * 8 // 6)


import sys
import math

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def printwsp(*args):
	return print(*args, end='')

def printsp(*args):
	return print(*args, end=' ')

def printchk(*args):
	return print(*args, end='tst, ')
MODPRIME = int(1000000000.0 + 7)
BABYMOD = 998244353
for _testcases_ in range(int(input())):
	n = int(input())
	st = 8
	ans = 0
	for i in range(n // 2):
		ans += st * (i + 1)
		st += 8
	print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	num = n // 2
	ans = 0
	s = num * (num + 1) // 2
	for i in range(1, num + 1):
		ans = ans + s * 8
		s = s - i
	print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(0)
		continue
	ans = 0
	v = 1
	for j in range(3, n + 1, 2):
		ans += (j * j - (j - 2) * (j - 2)) * v
		v += 1
	print(ans)


def readStr():
	return input()

def readInts():
	return list(map(int, readStr().split(' ')))

def main(n):
	k = (n + 1) // 2
	s = 0
	for i in range(k):
		s += 8 * i * i
	return s
(t,) = readInts()
for _ in range(t):
	(n,) = readInts()
	s = main(n)
	print(s)


def numCells(n):
	return 2 * n + 2 * (n - 2)

def solve():
	num_cases = int(input())
	for case in range(num_cases):
		n = int(input())
		res = 0
		for i in range(3, n + 1, 2):
			cell_dist = i // 2
			res += cell_dist * numCells(i)
		print(res)
	return
solve()


t = int(input())
while t > 0:
	n = int(input())
	ans = 0
	for i in range(0, n + 1):
		if i % 2 == 1:
			ans = ans + (4 * i - 4) * (i // 2)
	print(ans)
	t = t - 1


def inpint():
	return int(input())

def main():
	t = inpint()
	for _ in range(t):
		n = inpint()
		m = (n - 1) // 2
		ans = 4 * m * (m + 1) * (2 * m + 1) // 3
		print(ans)
main()


for z in range(int(input())):
	n = int(input())
	sum = 0
	for i in range(1, n + 1, 2):
		sum += int(i // 2 * (4 * i - 4))
	print(sum)


def solve():
	n = int(input())
	iters = n // 2
	out = 0
	for i in range(iters + 1):
		out += 8 * i * i
	print(out)

def __starting_point():
	t = int(input())
	for tc in range(t):
		solve()
__starting_point()


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		x = n // 2
		ans = 0
		for x in range(1, x + 1):
			box = 2 * x + 1
			box = box * 2 + (box - 2) * 2
			ans += box * x
		print(ans)


import sys
input = sys.stdin.buffer.readline
t = int(input())
ans = []
for _ in range(t):
	n = int(input()) // 2
	ans.append(4 * n * (n + 1) * (2 * n + 1) // 3)
print('\n'.join(map(str, ans)))


from sys import stdin
from math import sqrt
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	s = 0
	if n == 1:
		print(0)
	else:
		m = 1
		for i in range(3, n + 1, 2):
			s += (2 * i + (i - 2) * 2) * m
			m += 1
		print(s)


def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def smallestDivisor(n):
	if n % 2 == 0:
		return 2
	i = 3
	while i * i <= n:
		if n % i == 0:
			return i
		i += 2
	return n
for _ in range(int(input())):
	n = ii()
	sum = 0
	k = 0
	l = 3
	for i in range((n - 1) // 2):
		k += 1
		j = 2 * l + 2 * (l - 2)
		l += 2
		sum += j * k
	print(sum)


test_count = int(input())

def ans(p):
	p = (p - 1) / 2
	a = 2 * p * (p + 1) * (2 * p + 1) / 3
	return int(a * 2)
for i in range(test_count):
	print(ans(int(input())))


for xyz in range(0, int(input())):
	n = int(input())
	n = n // 2
	ans = n * (n + 1) * (2 * n + 1)
	ans = ans / 6
	print(int(8 * ans))


cases = int(input())
for x in range(cases):
	x = int(input())
	s = 0
	while x > 1:
		s += (x * 2 + (x - 2) * 2) * int(x / 2)
		x -= 2
	print(s)


for _ in range(int(input())):
	n = int(input())
	no = n // 2
	temp = no * (no + 1) * (2 * no + 1) // 6
	print(8 * temp)


def solve(n):
	total = 0
	cnt = 3
	moves = 0
	if n == 1:
		print(0)
		return
	while cnt <= n:
		figure = cnt * cnt
		outer = figure - (cnt - 2) * (cnt - 2)
		moves += 1
		total += moves * outer
		cnt += 2
	print(total)
	return
t = int(input())
for _ in range(t):
	n = int(input())
	solve(n)


def solution(n):
	sum_ = 0
	for i in reversed(range(1, n // 2 + 1)):
		per = (i * 2 + 1) * 4 - 4
		sum_ += per * i
	return sum_

def main():
	for test in range(int(input())):
		n = int(input())
		print(solution(n))
main()


def f(n):
	if n % 2:
		return 8 * sum((i * i for i in range(1, n // 2 + 1)))
	return f(n - 1) + n * n - n // 2
for _ in range(int(input())):
	print(f(int(input())))


for _ in range(int(input())):
	n = int(input())
	if n == 0:
		print(0)
	else:
		temp = 0
		i = 3
		while i <= n:
			t = (i - 1) // 2
			t = t * 4
			t = t * (i - 1)
			temp += t
			i += 2
		print(temp)


import math
from collections import deque as dq

def si():
	return input()

def ii():
	return int(input())

def mii():
	return map(int, input().split())

def lii():
	return list(map(int, input().split()))

def matr(n):
	return [list(mii()) for _ in range(n)]
for _ in range(ii()):
	n = ii()
	p = 0
	k = n // 2
	while k > 0:
		p += k * 8 * k
		k -= 1
	print(p)


arr = []

def function(f):
	factor = (f - 1) // 2
	p = factor * 8
	arr.append(p * factor)
for _ in range(int(input())):
	n = int(input())
	curr = n
	while curr != 1:
		function(curr)
		curr -= 2
	print(sum(arr))
	arr = []


t = int(input())
for z in range(t):
	n = int(input())
	n1 = int(n / 2)
	answer = 8 * n1 * (n1 + 1) / 2
	for i in range(2, n1 + 1):
		answer += 8 * i * (i - 1)
	print(int(answer))


ran = 500000
a = [i ** 2 - (i - 2) ** 2 for i in range(1, ran, 2)]
tmp = 0
b = [0] * (ran // 2)
for i in range(-(ran // -2)):
	tmp += a[i] * i
	b[i] = tmp
for _ in range(int(input())):
	k = int(input())
	print(b[k // 2])


for i in range(int(input())):
	n = int(input())
	a = int(n / 2) + 1
	s = 0
	while n != 1:
		a = int(n / 2) + 1
		b = n ** 2 - (n - 2) ** 2
		s += b * (n - a)
		n -= 2
	print(s)


def board_moves():
	test = int(input())
	for _ in range(test):
		n = int(input())
		x = (n - 1) / 2
		y = 4 * x * (x + 1)
		z = (n - 3) / 2
		total_moves = int(1 / 3 * (8 * z * (z + 1) * (z + 2)) + y)
		print(total_moves)
board_moves()


t = int(input())
for _ in range(t):
	n = int(input())
	s = 0
	p = int((n - 1) / 2)
	if n > 1:
		l = int(n / 2) + 1
		for i in range(1, l):
			s = s + (n + (n - 2)) * 2 * p
			n = n - 2
			p = p - 1
	print(s)


t = int(input())
for x in range(t):
	n = int(input())
	cell = (n // 2 + 1, n // 2 + 1)
	k = cell[0]
	outer = n - k
	j = outer - 1
	ttl = 0
	series = 2 * j + 1
	line = 0
	for i in range(n // 2 + 1):
		if i == 0:
			ttl += outer * n
			line = outer * n
		else:
			a = line - series
			ttl += a
			line = line - series
			series -= 2
	print(ttl * 2 - line)


t = int(input())
Q = []
maq = 0
for _ in range(t):
	n = int(input())
	Q.append(n)
	maq = max(maq, n)
DP = [0] * maq
for i in range(maq - 1):
	DP[i + 1] = DP[i] + (i + 2) * (i + 1)
for j in Q:
	print(DP[j - 1])


for _ in range(int(input())):
	a = int(input())
	a = (a + 1) // 2
	z = a * (a - 1) * (2 * a - 1) * 8
	print(int(z // 6))


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		a = 8
		ans = 0
		c = (n - 1) // 2 + 1
		for i in range(1, c):
			ans += i * a
			a += 8
		print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	ans = (n ** 2 - 1) // 2
	x = (n - 1) // 2
	x = x ** 2
	s = 0
	sk = 0
	i = 1
	j = 1
	while sk < x:
		s += i * j
		sk += j
		j += 2
		i += 1
	print(ans + s * 4)


for s in [*open(0)][1:]:
	n = int(s)
	print((n ** 3 - n) // 3)


from functools import cmp_to_key
t = int(input())
for _ in range(t):
	n = int(input())
	side = n // 2
	pres = 1
	ans = 0
	for i in range(1, side + 1):
		ans += pres * i
		pres += 2
	print(ans * 4 + side * (side + 1) * 2)


t = int(input())
for _ in range(t):
	n = int(input())
	i = 8
	s = 0
	c = 1
	if n == 1:
		print(0)
	else:
		f = 8
		for i in range(n // 2):
			s = s + f * (i + 1)
			f = f + 8
		print(s)


T = int(input())
for t in range(0, T):
	n = int(input())
	k = int(n / 2)
	sum = int((8 * k * k * k + 12 * k * k + 4 * k) / 3)
	print(sum)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
		continue
	sum = 0
	var = 1
	for i in range(3, n + 1, 2):
		sum += (i ** 2 - (i - 2) ** 2) * var
		var += 1
	print(sum)


MOD = 10 ** 9 + 7

def main():
	m = 500000
	ans = [0] * m
	for i in range(3, m, 2):
		ans[i] = ans[i - 2] + 8 * (i // 2) ** 2
	test = int(input())
	for iteration in range(test):
		n = int(input())
		print(ans[n])
main()


import sys
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
for _ in range(int(input())):
	(n,) = I()
	an = 0
	x = 1
	f = 8
	for i in range(n // 2):
		an += x * f
		f += 8
		x += 1
	print(an)


exec(int(input()) * '\nn=int(input())//2;print(4*((n*(n+1)*(2*n+1))//3))')


import sys

def solve():
	return None

def main():
	q = []
	for line in sys.stdin.readlines():
		q.append(line.rstrip())
	for i in range(1, len(q)):
		k = int(q[i]) // 2
		total = 0
		i = 0
		while i != k:
			total += (i + 1) ** 2 * 8
			i += 1
		print(total)
main()


T = int(input())
for _ in range(T):
	n = int(input())
	ans = 0
	x = (n - 1) // 2
	print(8 * x * (x + 1) * (2 * x + 1) // 6)


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return list(map(int, input().split()))

def solve(n):
	if n == 1:
		return 0
	if n == 3:
		return 8
	count = 0
	for i in range(n, 2, -2):
		r = i * 2
		c = (i - 2) * 2
		m = i // 2
		count = count + (r + c) * m
	return count
t = inp()
for i in range(t):
	print(solve(inp()))


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import math

def fact(x):
	if x == 0:
		return 1
	else:
		return x * fact(x - 1)

def lower_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] >= num:
			answer = middle
			end = middle - 1
		else:
			start = middle + 1
	return answer

def upper_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] <= num:
			answer = middle
			start = middle + 1
		else:
			end = middle - 1
	return answer

def abs(x):
	return x if x >= 0 else -x

def binary_search(li, val, lb, ub):
	ans = 0
	while lb <= ub:
		mid = (lb + ub) // 2
		if li[mid] > val:
			ub = mid - 1
		elif val > li[mid]:
			lb = mid + 1
		else:
			ans = 1
			break
	return ans

def divisor(n):
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return i
	return n
import math
for t in range(int(input())):
	n = int(input())
	k = 0
	ans = 0
	for i in range(3, n + 1, 2):
		k += 1
		ans += 4 * (i - 1) * k
	print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print('0')
	elif n == 3:
		print('8')
	else:
		x = 3
		moves = 0
		while x <= n:
			moves += (x - 1) * 4 * (x // 2)
			x += 2
		print(moves)


import sys
import math as mt
t = int(input())
for __ in range(t):
	n = int(input())
	x = n // 2
	ans = 0
	k = n
	while x > 0:
		ans += x * (k * 2 + (k - 2) * 2)
		k -= 2
		x -= 1
	print(ans)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		count = 2
		sum = 3 * 3 - 1
		for i in range(5, n + 1, 2):
			sum = sum + (i * i - (i - 2) * (i - 2)) * count
			count = count + 1
		print(sum)


from __future__ import division, print_function
import sys
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
import os, sys, bisect, copy
from collections import defaultdict, Counter, deque
if os.path.exists('in.txt'):
	sys.stdin = open('in.txt', 'r')
if os.path.exists('out.txt'):
	sys.stdout = open('out.txt', 'w')

def input():
	return sys.stdin.readline()

def mapi(arg=0):
	return map(int if arg == 0 else str, input().split())
for _ in range(int(input())):
	n = int(input())
	res = 0
	while n > 0:
		res += 4 * (n - 1) * ((n - 1) // 2)
		n -= 2
	print(res)


n = int(input())
a = []
for i in range(n):
	a.append(int(input()))
for i in range(n):
	l = 3
	tam = int(a[i] // 2)
	sum = 0
	dem = 1
	for j in range(1, tam + 1):
		sum = sum + (l * 4 - 4) * dem
		l += 2
		dem += 1
	print(sum)


from sys import stdin
input = iter(stdin.readlines()).__next__
t = int(input())
for _ in range(t):
	n = int(input())
	x = n // 2
	print(8 * x * (x + 1) * (2 * x + 1) // 6)


t = int(input())
for _ in range(t):
	n = int(input())
	s = 0
	for i in range(int(n / 2) + 1):
		s += pow(i, 2) * 8
	print(s)


arr = [-1] * 500005
arr[0] = 0
arr[1] = 0
for _ in range(int(input())):
	n = int(input())
	ans = 0
	while n > 1:
		if n > 1:
			val = (n * 4 - 4) * (n // 2)
			arr[n] = val
			ans += val
			n -= 2
	print(ans)


testCases = int(input())
for _ in range(testCases):
	n = int(input())
	m = n // 2
	print(m * (m + 1) * (2 * m + 1) // 6 * 8)


for _ in range(int(input())):
	n = int(input())
	ans = 0
	st = 8
	mul = 1
	while n > 2:
		ans += st * mul
		st += 8
		mul = mul + 1
		n = n - 2
	print(ans)


import math
import collections
from sys import stdin, stdout
import bisect as bs
T = int(stdin.readline())
for _ in range(T):
	n = int(stdin.readline())
	k = (n - 1) // 2
	sc = k * (k + 1) * (2 * k + 1) // 6
	print(8 * sc)


for i in range(int(input())):
	n = int(input())
	c = n // 2 + 1
	up = n // 2
	summ = 0
	for i in range(1, up + 1):
		summ += i
	tot = 0
	count = 1
	for j in range(1, up + 1):
		tot += j * count
		count += 2
	print(tot * 4 + summ * 4)


import sys
import heapq
import math
import bisect

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def rinput():
	return map(int, input().split())

def rlinput():
	return list(map(int, input().split()))

def srlinput(fl=False):
	return sorted(list(map(int, input().split())), reverse=fl)

def main():
	print(8 * sum([i * i for i in range(1, iinput() // 2 + 1)]))
for sdfghjkl in range(iinput()):
	main()


t = int(input())
import math
for _ in range(t):
	n = int(input())
	if n == 1:
		print(0)
		continue
	n = n // 2
	sum = n * (n + 1) * (2 * n + 1) // 6 * 8
	print(sum)


t = int(input())
for _ in range(t):
	n = int(input())
	s = int((n - 1) / 2)
	summ = int(s * (s + 1) / 2)
	for k in range(2, s + 1):
		summ += int(s * (s + 1) / 2) - int((k - 1) * k / 2)
	summ *= 8
	print(summ)


t = int(input())
for _ in range(t):
	n = int(input())
	p = 0
	ans = 0
	num = (n - 1) / 2
	ans = 8 * num * (num + 1) * (2 * num + 1) / 6
	print(int(ans))


dp = [0] * 500001
(dp[1], dp[3], dp[5]) = (0, 8, 40)
x = 3
for i in range(7, 500001, 2):
	dp[i] = dp[i - 2] + 8 * x * x
	x += 1
for _ in range(int(input())):
	n = int(input())
	print(dp[n])


dp = [0 for i in range(500005)]
for i in range(3, 500005, 2):
	dp[i] = dp[i - 2] + i // 2 * 8 * (i // 2)
t = int(input())
while t:
	n = int(input())
	print(dp[n])
	t -= 1


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(0)
	else:
		k = 3
		num = 8
		m = 2
		while k <= n:
			if k == n:
				print(num)
				break
			else:
				k = k + 2
				num = num + (k * 4 - 4) * m
				m = m + 1


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(0)
		continue
	else:
		sm = 0
		j = 1
		for i in range(3, n + 1, 2):
			a = 2 * i + 2 * (i - 2)
			a = a * j
			sm += a
			j += 1
	print(sm)


from sys import stdin
inp = lambda : stdin.readline().strip()
t = int(inp())
for _ in range(t):
	n = int(inp())
	ans = 0
	for i in range(n, 0, -2):
		ans += 8 * (i // 2) ** 2
	print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	a = (n + 1) // 2
	out = n ** 2 * (a - 1)
	for x in range(1, a + 1):
		out -= (n - 2 * x) ** 2
	print(out + 1)


def sumsq(n):
	return n * (n + 1) * (2 * n + 1) // 6

def minmoves(n):
	return 8 * sumsq(n // 2)
t = int(input())
for i in range(t):
	n = int(input())
	print(minmoves(n))


t = int(input())
for i in range(t):
	k = 0
	n = int(input())
	if n == 1:
		print(0)
	elif n == 2:
		print(3)
	else:
		while n > 2:
			if n % 2 == 1:
				k += (n - 1) * 4 * ((n - 1) // 2)
			else:
				k += (n - 1) * 2 * (n // 2)
				k += n * 2 * (n // 2 + 1)
			n -= 2
		print(k)


import bisect
import os
from collections import Counter
import bisect
from collections import defaultdict
import math
import random
import heapq as hq
from math import sqrt
import sys
from functools import reduce, cmp_to_key
from collections import deque
import threading
from itertools import combinations
from io import BytesIO, IOBase
from itertools import accumulate

def primeFactors(n):
	prime = set()
	while n % 2 == 0:
		prime.add(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			prime.add(i)
			n = n // i
	if n > 2:
		prime.add(n)
	return list(prime)

def getFactors(n):
	factors = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				factors.append(i)
			else:
				factors.append(i)
				factors.append(n // i)
		i = i + 1
	return factors

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	num = []
	for p in range(2, n + 1):
		if prime[p]:
			num.append(p)
	return num

def lcm(a, b):
	return a * b // math.gcd(a, b)

def sort_dict(key_value):
	return sorted(key_value.items(), key=lambda kv: (kv[1], kv[0]))

def list_input():
	return list(map(int, input().split()))

def num_input():
	return map(int, input().split())

def string_list():
	return list(input())

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def binaryToDecimal(n):
	return int(n, 2)

def solve():
	n = int(input())
	if n == 1:
		print(0)
	else:
		ans = 0
		curr = 1
		x = 8
		for i in range(n // 2):
			ans += x * curr
			curr += 1
			x = x + 8
		print(ans)
t = int(input())
for _ in range(t):
	solve()


t = int(input())
results = []
for case in range(t):
	n = int(input())
	layers = n // 2
	ans = 0
	for i in range(layers):
		d = 2 * (i + 1) + 1
		figures = 4 * (d - 1)
		ans += (i + 1) * figures
	results.append(ans)
for result in results:
	print(result)


from sys import stdin, stdout
DEBUG = True

class Scan:

	def __init__(self):
		self.read = stdin.read
		self.input = stdin.readline

	def integer(self, count=1):
		if count == 1:
			return self._integer()
		return [self._integer() for _ in range(count)]

	def _integer(self):
		sym: str = self.read(1)
		while sym != '-' and (not sym.isdigit()):
			sym = self.read(1)
		(number, sign) = (0, -1) if sym == '-' else (int(sym), 1)
		sym: str = self.read(1)
		while sym.isdigit():
			number = number * 10 + int(sym)
			sym = self.read(1)
		return number * sign

	def array(self, func=int, sep=' '):
		if func == str:
			return input().split(sep)
		return list(map(func, input().split(sep)))

	def string(self, count=1):
		if count == 1:
			return self._string()
		return [self._string() for _ in range(count)]

	def _string(self):
		sym = self.read(1)
		while sym in ('\n', '\r', ' '):
			sym = self.read(1)
		s = str()
		while sym not in ('\n', '\r', ' '):
			s += sym
			sym = self.read(1)
		return s

class Write:
	pass

class Number:

	def gcd(a, b):
		while b > 0:
			(a, b) = (b, a % b)
		return a

	def lcm(a, b):
		return a * b // gcd(a, b)

	def sqrt(n):
		sqrt_n = int(n ** 0.5)
		while sqrt_n * sqrt_n < n:
			sqrt_n += 1
		while sqrt_n * sqrt_n > n:
			sqrt_n -= 1
		return sqrt_n

	def sum_n(n):
		return n * (n + 1) // 2

class Constants:
	EPS = 10 ** (-9)
	INF = 10 ** 18
	MOD = 10 ** 9 + 7

def solution(scan: Scan, write: Write):
	n = scan.integer()
	answer = 0
	j = 0
	for i in range(1, n + 1, 2):
		answer += j * (i * i - (i - 2) * (i - 2))
		j += 1
	print(answer)

def main():
	queries: int = 1
	(scan, write) = (Scan(), Write())
	queries = scan.integer()
	for _ in range(queries):
		solution(scan, write)
main()


def solve(n):
	result = 0
	counter = 0
	i = 1
	while i <= n:
		result += counter * (i - 1) * 4
		i += 2
		counter += 1
	return result
t = int(input())
for i in range(0, t):
	n = int(input())
	print(solve(n))


t = int(input())
for _ in range(t):
	n = int(input())
	r = 0
	while n > 1:
		r += (n - 1) ** 2 * 2
		n -= 2
	print(r)


import sys
input = sys.stdin.readline
from itertools import accumulate
S = [i * 4 * (2 * i) for i in range(5 * 10 ** 5 + 2)]
ANS = list(accumulate(S))
t = int(input())
for tests in range(t):
	n = int(input())
	print(ANS[n // 2])


from sys import stdin, stdout, exit as sys_ret
(f_input, f_print, f_flush) = (stdin.readline, stdout.write, stdout.flush)
for _ in range(int(f_input())):
	size = (int(f_input()) - 1) // 2
	squared = size * (size + 1) * (2 * size + 1) // 6
	f_print(str(squared * 8) + '\n')


for _ in range(int(input())):
	n = int(input())
	if n <= 3:
		print(n * n - 1)
	else:
		x1 = 8
		y1 = 1
		x = x1
		y = y1
		ans = 0
		for i in range(1, n, 2):
			ans += x * y
			x += x1
			y += 1
		print(ans)


for z in range(int(input())):
	n = int(input())
	k = n // 2
	t = k * (k + 1)
	r = t * n
	u = r * 4
	print(u // 3)


steps = [0, 8]
k = 5
for i in range(len(steps), 5 * 10 ** 5 // 2 + 1):
	boundaries = k * 2 + 2 * (k - 2)
	steps.append(steps[i - 1] + boundaries * i)
	k += 2
from sys import stdin, stdout
for testcases in range(int(stdin.readline())):
	n = int(stdin.readline())
	print(steps[n // 2])


MOD = 1000000007
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
from collections import *
for _ in range(ii()):
	n = ii()
	c = 0
	for i in range(n, 0, -1):
		c = c + i * (i - 1)
	print(c)


t = int(input())
import math
output = []
for _ in range(t):
	n = int(input())
	small_output = 0
	for i in range(math.ceil(n / 2)):
		small_output += i * ((2 * i - 1) * 4) + i * 4
	output.append(small_output)
for item in output:
	print(item)


t = int(input())
while t:
	n = int(input())
	ans = n * n
	if n == 1:
		print(0)
	else:
		s = 0
		for i in range(1, n // 2 + 1):
			s += 8 * i * i
		print(s)
	t = t - 1


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		middle = (n + 1) // 2
		x = n - middle
		sum1 = 0
		while x >= 1:
			sum1 = sum1 + x * (4 * n - 4)
			x = x - 1
			n = n - 2
		print(sum1)


a = int(input())
for _ in range(a):
	l1 = []
	b = int(input())
	if b == 1:
		print('0')
	else:
		for i in range(1, b // 2 + 1):
			l1.append(i * i * 8)
		print(sum(l1))


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(0)
		continue
	count = 0
	dist = 0
	for i in range(1, n + 1, 2):
		circumference = i * i - max((i - 2) * (i - 2), 0)
		count += circumference * dist
		dist += 1
	print(count)


import sys
import math
from collections import deque
input = sys.stdin.buffer.readline
for _ in range(int(input())):
	n = int(input())
	total = 0
	for i in range(n // 2 + 1):
		total += i * (2 * i * 4)
	print(total)


T = int(input())
while T > 0:
	N = int(input())
	answer = 0
	times = N // 2
	i = 1
	squares = 8
	while times > 0:
		answer += i * squares
		squares += 8
		times -= 1
		i += 1
	print(answer)
	T -= 1


ans = [0] * 500005
x = 8
for i in range(1, 500005):
	ans[i] = ans[i - 1] + x * i
	x += 8
for i in range(int(input())):
	n = int(input())
	print(ans[n // 2])


def max_moves(n):
	if n == 1:
		return 0
	answer = 0
	step = 1
	for side in range(3, n + 1, 2):
		cells = side + 2 * (side - 1) + (side - 2)
		answer += cells * step
		step += 1
	return answer

def main():
	for _ in range(int(input().strip())):
		n = int(input().strip())
		print(max_moves(n))
main()


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		ans = 0
		while n > 1:
			ans += 4 * (n - 1) * ((n - 1) // 2)
			n -= 2
		print(ans)


x = int(input())
for i in range(x):
	n = int(input())
	ans = 0
	while n > 2:
		a = n // 2 * (n ** 2 - (n - 2) ** 2)
		ans += a
		n -= 2
	print(ans)


from collections import defaultdict as dfd
for _ in range(int(input())):
	N = int(input())
	if N == 1:
		print(0)
	else:
		tot = 0
		t = 8
		p = 1
		for i in range(3, N + 1, 2):
			tot += t * p
			p += 1
			t += 8
		print(tot)


t = int(input())
for _ in range(t):
	n = int(input())
	dp = [0, 0]
	for i in range(2, n + 1):
		if i % 2 == 0:
			dp.append(0)
		else:
			dp.append((4 * i - 4) * (i // 2) + dp[-2])
	print(dp[-1])


def func(n):
	for i in range(n):
		k = int(input())
		ans = 0
		for i in range(1, k // 2 + 1):
			ans += i * i
		print(ans * 8)
n = int(input())
func(n)


t = int(input())
for qr in range(t):
	n = int(input())
	moves = 0
	while n > 1:
		a = (n - 1) * 4
		b = int(n / 2)
		moves += a * b
		n = n - 2
	print(moves)


import sys
TEST = 0
if TEST == 1:
	input_file = open('inputC.txt', 'r')
	input_from_file = input_file.readlines()

def read_int():
	if TEST:
		return int(input_from_file.pop(0))
	else:
		return int(sys.stdin.readline())

def read_ints():
	if TEST:
		return list(map(int, input_from_file.pop(0).rstrip().split()))
	else:
		return list(map(int, sys.stdin.readline().split()))
t = read_int()
for test in range(t):
	n = read_int()
	if n == 1:
		print(0)
	else:
		ans = 0
		for k in range(1, int((n - 1) / 2) + 1):
			ans += k * (4 * (2 * k - 1) + 4)
		print(ans)


for _ in range(int(input())):
	n = int(input())
	j = 3
	count = 0
	for i in range(1, n // 2 + 1):
		count += i * 4 * (j - 1)
		j += 2
	print(count)


tcs = int(input())
for tc in range(tcs):
	n = int(input())
	s = 0
	for i in range(1, n + 1, 2):
		s += i * (i // 2) * 4 - i // 2 * 4
	print(s)


t = input()
t = int(t)
while t > 0:
	x = input()
	count = 0
	x = int(x)
	y = (x - 1) / 2
	i = 8
	while i <= y * 8:
		r = i / 8
		count = count + i * r
		i = i + 8
	print(int(count))
	t = t - 1


t = int(input())
for _ in range(t):
	x = int(input()) // 2
	print(8 * x * (x + 1) * (2 * x + 1) // 6)


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(0)
		continue
	summ = 0
	n1 = n // 2
	for i in range(1, n1 + 1):
		j = i - 1
		summ += ((2 * i + 1) * (2 * i + 1) - (2 * j + 1) * (2 * j + 1)) * i
	print(summ)


def sq(n):
	return n * (n + 1) * (2 * n + 1) // 6
import sys
input = sys.stdin.buffer.readline
t = int(input())
for _ in range(t):
	n = int(input())
	print(8 * sq(n // 2))


t = int(input())
l = [0]
for i in range(1, 500000):
	l.append(l[i - 1] + i * 2 * 4 * i)
for i in range(t):
	n = int(input())
	print(l[n // 2])


t = int(input())
for i in range(t):
	n = int(input())
	a = n // 2
	ans = 8 * a
	ans1 = ans * (a + 1)
	ans2 = ans1 * (2 * a + 1)
	ans3 = ans2 // 6
	print(ans3)


from bisect import insort
for t in range(int(input())):
	n = int(input())
	(ans, k) = (0, 0)
	for i in range(1, n + 1, 2):
		ans += 2 * i * k + 2 * k * (i - 2)
		k += 1
	print(ans)


def answer(k):
	count = 1
	su = 0
	th = 3
	while th <= k:
		su += count * (th ** 2 - (th - 2) ** 2)
		count += 1
		th += 2
	return su
t = int(input())
for i in range(t):
	print(answer(int(input())))


for _ in range(int(input())):
	n = int(input())
	dp = [0] * (n // 2 + 1)
	if n == 1:
		print(0)
	elif n == 3:
		print(8)
	else:
		dp[0] = 0
		dp[1] = 8
		for i in range(2, n // 2 + 1):
			z = i * 2 + 1
			k = (z - 2) ** 2
			z = z ** 2
			dp[i] = dp[i - 1] + (z - k) * i
		print(dp[-1])


t = int(input())
for tt in range(0, t):
	n = int(input())
	if n == 1:
		print(0)
		continue
	s = 0
	j = 1
	for i in range(3, n + 1, 2):
		a = i * 2 + (i - 2) * 2
		b = a * j
		s = s + b
		j += 1
	print(s)


import math
t = int(input())
while t:
	n = int(input())
	tot = 0
	ele = 1
	tim = n // 2
	zim = n // 2
	curr = n // 2
	prev = 0
	for i in range(n // 2):
		prev += 2 * tim + zim * (n - 2 * ele)
		tim += curr - 1
		curr -= 1
		ele += 1
		zim -= 1
		prev *= 2
		tot += prev
		prev = 0
	n //= 2
	tot += n * (n + 1)
	print(tot)
	t -= 1


t = int(input())
counter = 3
count = 1
m = 3
val = mul = 0
for i in range(t):
	n = int(input())
	nl = n // 2
	for j in range(nl):
		val = 2 * m + 2 * (m - 2)
		mul = mul + val * count
		count += 1
		counter += 2
		m += 2
	print(mul)
	counter = 3
	count = 1
	m = 3
	val = mul = 0


t = int(input())
for hh in range(0, t):
	n = int(input())
	i = 1
	k = n // 2
	cnt = 0
	ans = 0
	while cnt < k:
		ans += (cnt + 1) * i
		i += 2
		cnt += 1
	finalans = ans * 4
	for i in range(0, k):
		finalans += 4 * (i + 1)
	print(finalans)


t = int(input())
while t:
	t = t - 1
	n = int(input())
	ans = sum([8 * x * x for x in range(1, int(n / 2) + 1)])
	print(ans)


t = int(input())
for test in range(t):
	a = int(input())
	n = a
	if a % 2 == 0:
		n = a - 1
	ans = 0
	for i in range(n // 2):
		ans += ((2 * i + 1) * 4 + 4) * (i + 1)
	if a == n:
		print(ans)


import math
for _ in range(int(input())):
	n = int(input())
	answer = 0
	level = 0
	for i in range(3, n + 1, 2):
		level += 1
		answer += level * level * 8
	print(answer)


t = int(input())
a = []
k = 0
for i in range(t):
	n = int(input())
	a.append(n)
	k = max(k, n)
c = [0] * (k + 2)
c[3] = 8
for i in range(5, k + 2, 2):
	c[i] = c[i - 2] + 2 * (i - 1) ** 2
for i in a:
	print(c[i])


t = int(input())
for _ in range(t):
	sum = 0
	n = int(input())
	jj = n // 2
	for i in range(jj, 0, -1):
		sum += i * (n * n - (n - 2) * (n - 2))
		n -= 2
	print(sum)


def solve():
	n = int(input())
	i = 0
	j = 0
	ans = 0
	while n > 0:
		ans += i * j
		i += 1
		j += 8
		n -= 2
	return ans
t = int(input())
while t > 0:
	ans = solve()
	print(ans)
	t -= 1


def solve():
	n = int(input())
	k = n // 2
	ans = 4 * (k * (k + 1) * n) // 3
	print(ans)
t = int(input())
for _ in range(t):
	solve()


t = int(input())
list1 = []
for i in range(t):
	n = int(input())
	a = (n - 1) / 2
	c = 0
	while a > 0:
		c = 4 * (n - 1) * a + c
		a -= 1
		n -= 2
		c = int(c)
	list1.append(c)
for i in list1:
	print(i)


N = 5 * 10 ** 5 + 1
dp = [0 for i in range(N)]
dp[1] = 0
for i in range(3, N, 2):
	dp[i] = dp[i - 2] + 8 * (i // 2) * (i // 2)
t = int(input())
for y in range(t):
	n = int(input())
	print(dp[n])


t = int(input())
for tt in range(t):
	n = int(input())
	fs = 1
	fc = 1
	moves = 0
	sides = n - 4
	while sides > 0:
		moves += 4 * (2 * fs + fc) + sides * 4 * fs
		sides -= 2
		fc = fc + fs * 2 + 1
		fs = fs + 1
	if sides == -1:
		moves += 4 * fc + 4 * fs
	print(moves)


import math
from collections import Counter, deque
L = lambda : list(map(int, input().split()))
M = lambda : map(int, input().split())
I = lambda : int(input())
IN = lambda : input()
mod = 10 ** 9 + 7

def s(a):
	print(' '.join(list(map(str, a))))
for _ in range(I()):
	n = I()
	a = 2 * (n - 1) // 4
	s = 0
	b = (pow(n, 2) - 1 - a) // 4
	x = int(math.sqrt(b))
	for i in range(1, x + 1):
		s += i * (2 * i - 1)
	s += x * (x + 1) // 2
	print(int(4 * s))


tc = int(input())
for t in range(tc):
	n = int(input())
	(a, b, cell, res) = (n, n - 2, n // 2, 0)
	while cell > 0:
		res += cell * a + cell * b
		(cell, a, b) = (cell - 1, a - 2, b - 2)
	print(res * 2)


def solve_test_case(t):
	n = int(input())
	res = 0
	for i in range(1, n // 2 + 1):
		dist = i
		side1 = dist + dist + 1
		side3 = dist + dist + 1
		side2 = dist + dist + 1 - 2
		side4 = dist + dist + 1 - 2
		res += i * (side1 + side2 + side3 + side4)
	print(res)

def parse_array(f):
	return list(map(f, input().split()))

def solve():
	T = int(input())
	for t in range(T):
		solve_test_case(t)
solve()


t = int(input())
for ti in range(t):
	n = int(input())
	thesum = 0
	for i in range(1, n + 1, 2):
		thesum += (4 * i - 4) * int(i / 2)
	print(thesum)


from sys import stdin
t = int(input())
for _ in range(0, t):
	sum = 0
	i = 0
	n = int(input()) // 2
	while i <= n:
		sum = sum + 8 * i * i
		i = i + 1
	print(sum)


from math import *
from sys import stdin, stdout
input = stdin.buffer.readline
t = int(input())
while t > 0:
	n = int(input())
	c = 1
	ans = 0
	for i in range(1, n, 2):
		ans += 8 * c * c
		c += 1
	print(ans)
	t -= 1


from collections import defaultdict, deque
import math
for _ in range(int(input())):
	n = int(input())
	n = n // 2
	print(n * (n + 1) * (2 * n + 1) * 8 // 6)


t = int(input())
for i in range(t):
	n = int(input())
	s = int()
	for i in range(n, 2, -2):
		s = s + (i ** 2 - (i - 2) ** 2) * (i // 2)
	print(s)


for _ in range(int(input())):
	n = int(input())
	k = (n - 1) // 2
	j = 1
	ans = 0
	s = 8
	for i in range(k):
		ans += s * j
		j += 1
		s += 8
	print(ans)


for _ in range(int(input())):
	a = int(input())
	n = a
	a *= a
	a -= 1
	rs = 0
	i = 0
	b = 0
	while b <= n // 2:
		rs += b * i
		b += 1
		i += 8
	print(rs)


for _ in range(int(input())):
	n = int(input())
	result = 0
	for step in range((n + 1) // 2):
		result += step * step * 8
	print(result)


import sys
t = int(sys.stdin.readline())
for _ in range(t):
	moves = int(input())
	ans = 0
	k = moves // 2
	l = 0
	for i in range(k):
		l += 1
		ans += 8 * (l * l)
	print(int(ans))


ans = []
for _ in range(int(input())):
	n = int(input())
	k = (n - 1) / 2
	sum_k = k * (k + 1) * (2 * k + 1) / 6
	a = int(8 * sum_k)
	ans.append(str(a))
print('\n'.join(ans))


for _ in range(int(input())):
	n = int(input())
	ans = 0
	i = 1
	k = 1
	c = n * n - 1
	if n == 1:
		print(0)
	elif n == 2:
		print(3)
	else:
		while c > 0:
			ans = ans + i * 8 * k
			c = c - 8 * k
			i = i + 1
			k = k + 1
		print(ans)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		jmp = 1
		j = 1
		ans = 0
		h = (n - 1) // 2
		while j <= h:
			ans += 8 * jmp * j
			j = j + 1
			jmp = jmp + 1
		print(ans)


t = int(input())
a = [0] * 250000
a[0] = 0
for i in range(1, 250000):
	x = i * 2 + 1
	a[i] = a[i - 1] + (2 * x + 2 * (x - 2)) * i
for tc in range(t):
	n = int(input())
	if n == 1:
		print(0)
	else:
		print(a[n // 2])


import sys
from math import sqrt, floor, factorial, gcd
inp = sys.stdin.readline
read = lambda : list(map(int, inp().strip().split()))

def count(n):
	s = 0
	for i in range(n // 2):
		s += ((n - 2 * (1 + i)) * 4 + 4) * (n // 2 - i)
	return s

def a():
	ans = ''
	for _ in range(int(inp())):
		(n, m) = read()
		if n == 1:
			ans += '0\n'
		elif n == 2:
			ans += str(m) + '\n'
		else:
			ans += str(2 * m) + '\n'
	print(ans)

def b():
	ans = ''
	for _ in range(int(inp())):
		(n, k) = read()
		a = sorted(read())
		b = sorted(read(), reverse=True)
		s = 0
		for i in range(k):
			s += max(a[i], b[i])
		s += sum(a[k:])
		ans += str(s) + '\n'
	print(ans)

def c():
	ans = ''
	for _ in range(int(inp())):
		n = int(inp())
		s = 0
		if n % 2:
			s = count(n)
		else:
			s = count(n - 1)
		if n % 2 == 0:
			s += (2 * n - 1) * (n // 2)
		ans += str(s) + '\n'
	print(ans)
c()


for i in range(int(input())):
	n = int(input())
	t = 0
	a = 1
	b = 0
	while a <= (n - 1) / 2:
		b += 8
		t += b * a
		a += 1
	print(t)


for i in range(int(input())):
	n = int(input())
	k = 8
	if n == 1:
		print(0)
	else:
		ii = 0
		ans = 0
		for j in range(1, (n - 1) // 2 + 1):
			ans += 8 * j * j
		print(ans)


t = int(input())
while t > 0:
	n = int(input())
	ans = 0
	if n == 1:
		ans = 0
	else:
		i = 3
		j = 1
		while i <= n:
			ans += ((i - 2) * 4 + 4) * j
			j += 1
			i += 2
	print(ans)
	t -= 1


for t in range(int(input())):
	n = int(input())
	k = (n - 1) // 2
	sum_of_k_natural_nos = (n - 1) * (n + 1) / 8
	res = 0
	count = 1
	for i in range(1, k + 1):
		res += i * count
		count += 2
	res *= 4
	res += 4 * sum_of_k_natural_nos
	print(int(res))


import sys
input = lambda : sys.stdin.readline().strip('\r\n')
for _ in range(int(input())):
	n = int(input())
	ans = 0
	for i in range(n // 2 + 1):
		ans += 8 * i * i
	print(ans)


a = int(input())
for z in range(a):
	b = int(input())
	c = 0
	for y in range(1, b // 2 + 1):
		c = c + y * 8 * y
	print(c)


t = int(input())
l = [0]
for i in range(3, 5 * 10 ** 5 + 1, 2):
	l.append(l[-1] + (i ** 2 - (i - 2) ** 2) * len(l))
for i in range(t):
	print(l[int(input()) // 2])


test_cases = int(input())
for z in range(test_cases):
	n = int(input())
	ans = 0
	for i in range(1, n + 1):
		if i % 2 != 0:
			ans += (2 * i + 2 * (i - 2)) * (i // 2)
	print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	a = n
	l = []
	while a != 1:
		l.append(2 * a + 2 * (a - 2))
		a -= 2
	s = 0
	q = n // 2
	for j in l:
		s += j * q
		q -= 1
	print(s)


t = int(input())
while t:
	n = int(input())
	n = n // 2
	a = n + 1
	b = 2 * n + 1
	print(n * a * b * 8 // 6)
	t -= 1


def main():
	for _ in range(int(input())):
		n = int(input())
		if n == 1:
			print(0)
		else:
			count = 1
			sum1 = 0
			for i in range(3, n + 1, 2):
				sum1 += 8 * count * count
				count += 1
			print(sum1)
main()


import sys
input = sys.stdin.buffer.readline
t = int(input())
for case in range(t):
	n = int(input())
	ans = 0
	for i in range(1, (n + 1) // 2):
		ans += i * ((i * 2 + 1) ** 2 - (i * 2 - 1) ** 2)
	print(ans)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		total = 0
		ar = 3
		a = 1
		for j in range(1, 1 + (n - 1) // 2):
			total += j * (ar * ar - a * a)
			ar += 2
			a += 2
		print(total)


t = int(input())
for i in range(0, t):
	n = int(input())
	a = 0
	for j in range(3, n + 1, 2):
		a += (j * j - (j - 2) * (j - 2)) * ((j - 1) / 2)
	print(int(a))


t = int(input())
for item in range(t):
	a = int(input())
	l = [2 * (item - 1) ** 2 for item in range(3, a + 1, 2)]
	print(sum(l))


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		for k in range(n // 2):
			v = n // 2
			ca = v * (v + 1) * (2 * v + 1) // 6
		print(8 * ca)


def moves_generator(number):
	if number == 1:
		return 0
	multiple = 1
	sum = 0
	eight = 8
	eight_boy = 8
	for i in range(3, number + 1, 2):
		sum = sum + eight_boy * multiple
		multiple = multiple + 1
		eight_boy = eight * multiple
	return sum
test_number = int(input())
while test_number != 0:
	test_number = test_number - 1
	number = int(input())
	print(moves_generator(number))


t = int(input())
lst = list()
for y in range(t):
	sum = 0
	i = 1
	n = int(input())
	a = (n + 1) / 2
	b = 4 * n + 4
	while i != a:
		sum += (b - 8 * i) * (a - i)
		i += 1
	lst.append(sum)
for i in lst:
	print(int(i))


p = int(input())
for z in range(p):
	n = int(input())
	ans = 0
	for i in range(n // 2):
		x = i + 1
		ans += 8 * x * x
	print(ans)


for _ in range(int(input())):
	n = int(input())
	tot = 0
	for i in range(1, n + 1, 2):
		tot += 4 * (i - 1) * (i // 2)
	print(tot)


t = int(input(''))
while t:
	t -= 1
	n = int(input(''))
	ans = 0
	odd = 1
	for i in range(1, int(n / 2) + 1):
		cells = 4 + odd * 4
		odd += 2
		ans += cells * i
	print(ans)


t = int(input())
for u in range(t):
	n = int(input())
	print(n * (n + 1) * (n - 1) // 3)


import math
for _ in range(int(input())):
	n = int(input())
	s = 0
	for i in range(math.floor(n / 2)):
		s += (i + 1) * ((i + 1) * 8)
	print(s)


t = int(input())
for _ in range(t):
	a = int(input())
	res = 0
	if a == 1:
		print(0)
	else:
		rg = (a - 1) // 2
		while a > 1:
			res = res + (a * 2 + (a - 2) * 2) * rg
			a -= 2
			rg -= 1
		print(res)


T = int(input())
for i in range(T):
	n = int(input())
	n = n // 2
	count = 8 * (n * (n + 1) * (2 * n + 1)) // 6
	print(count)


for _ in range(int(input())):
	n = int(input())
	s = 0
	if n == 1:
		print(0)
		continue
	n = (n - 1) // 2
	for i in range(1, n + 1):
		x = 2 * i + 1
		s += (x * 4 - 4) * i
	print(s)


def RA():
	return list(map(int, input().split()))

def solve():
	n = int(input())
	move = 0
	ans = 0
	for i in range(1, n + 1, 2):
		ans += move * (i - 1) * 4
		move += 1
	print(ans)
t = int(input())
for i in range(t):
	solve()


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(0)
		continue
	x = n // 2
	ans = 0
	for i in range(1, x + 1):
		ans += (i - 1) ** 2 + i * (i - 1)
	ans = 4 * (x ** 2 + sum(range(1, x + 1)) + ans)
	print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	print((n ** 3 - n) // 3)


T = int(input())
for t in range(T):
	N = int(input())
	if N == 1:
		print(0)
	else:
		somma = 1
		j = 1
		i = 1
		totale = 0
		while somma < N * N:
			somma = somma + 4 + 4 * j
			totale = totale + (4 + 4 * j) * i
			j = j + 2
			i = i + 1
		print(totale)


t = int(input())
while t:
	p = 8
	N = int(input())
	answer = 0
	mul = 1
	while N > 1:
		answer = answer + p * mul
		p = p + 8
		mul = mul + 1
		N = N - 2
	print(answer)
	t = t - 1


from math import *
from copy import *
from string import *
from random import *
from sys import stdin
from sys import maxsize
from operator import *
from itertools import *
from collections import Counter
import math
import math
import time

def bin1(l, r, k, t, b, val, ans):
	if l > r:
		return ans
	else:
		mid = (l + r) // 2
		v = k ** mid
		if v == val:
			return v
		elif v > val:
			ans = mid
			return bin1(mid + 1, r, k, t, b, val, ans)
		else:
			return bin1(l, mid - 1, k, t, b, val, ans)

def bin2(l, r, k, t, b, val, ans):
	if l > r:
		return ans
	else:
		mid = (l + r) // 2
		v = t * k ** mid + b * mid
		if v == val:
			return v
		elif v > val:
			ans = mid
			return bin2(l, mid - 1, k, t, b, val, ans)
		else:
			return bin2(mid + 1, r, k, t, b, val, ans)

def SieveOfEratosthenes(n):
	prime = [-1 for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == -1:
			for i in range(p * p, n + 1, p):
				prime[i] = p
		p += 1
	for i in range(2, n + 1):
		if prime[i] == -1:
			prime[i] = i
	return prime

def bin(l, r, ll, val):
	if l > r:
		return -1
	else:
		mid = (l + r) // 2
		if val >= ll[mid][0] and val <= ll[mid][1]:
			return mid
		elif val < ll[mid][0]:
			return bin(l, mid - 1, ll, val)
		else:
			return bin(mid + 1, r, ll, val)

def deci(n):
	s = ''
	while n != 0:
		if n % 2 == 0:
			n = n // 2
			s = '0' + s
		else:
			n = n // 2
			s = '1' + s
	return s

def diff(s1, s2):
	if len(s1) < len(s2):
		v = len(s1)
		while v != len(s2):
			s1 = '0' + s1
			v = v + 1
	else:
		v = len(s2)
		while v != len(s1):
			s2 = '0' + s2
			v = v + 1
	c = 0
	for i in range(len(s1)):
		if s1[i:i + 1] != s2[i:i + 1]:
			c = c + 1
	return c
from sys import stdin, stdout

def fac(a, b):
	v = a
	while a != b:
		v *= a - 1
		a = a - 1
	return v

def bino(l, r, n):
	if l > r:
		return -1
	else:
		mid = (l + r) // 2
		val1 = math.log(n / mid + 1, 2)
		val2 = int(val1)
		if val1 == val2:
			return val1
		elif val1 < 1.0:
			return bino(l, mid - 1, n)
		else:
			return bino(mid + 1, r, n)

def binary(l, r, val, ans):
	if l > r:
		return -1
	else:
		mid = (l + r) // 2
		v = val ** 5 - mid ** 5
		print(v)
		if v == ans:
			print('HOHOHOH')
			return mid
		elif v < ans:
			return binary(mid + 1, r, val, ans)
		else:
			return binary(l, mid - 1, val, ans)

def check(n):
	v = 1
	while n != 0:
		if n % 10 == 0 or n % 10 == 1:
			n = n // 10
		else:
			v = 0
			break
	return v

def stairs(n, m, val, c, l):
	if val > n:
		return 100000
	elif val == n:
		if l[val] != -1:
			return l[val]
		elif c % m == 0:
			l[val] = c
			return l[val]
		else:
			l[val] = 100000
			return l[val]
	else:
		l[val] = min(stairs(n, m, val + 1, c + 1, l), stairs(n, m, val + 2, c + 1, l))
		return l[val]

def fact(n):
	if n == 0 or n == 1:
		return 1
	else:
		return n * fact(n - 1)

def some(n):
	s = 0
	while n != 0:
		s += fact(n % 10)
		n //= 10
	return s

def bin(l, r, val, ll):
	if l > r:
		return -1
	else:
		mid = (l + r) // 2
		if ll[mid] == val:
			return mid
		elif ll[mid] > val:
			return bin(l, mid - 1, val, ll)
		else:
			return bin(mid + 1, r, val, ll)

def fn(n):
	c = -1
	for i in range(2, int(sqrt(n)) + 1):
		if n % 2 == 0:
			c = i
			break
	if c == -1:
		c = n
	return c
t = int(input())
for i in range(t):
	n = int(input())
	ans = 0
	while n > 0:
		ans = ans + (n - 1) * 4 * (n // 2)
		n -= 2
	print(ans)


from math import *
from copy import *
from heapq import *
from string import *
from random import *
from bisect import *
from sys import stdin
from sys import maxsize
from operator import *
from itertools import *
from collections import Counter
from collections import defaultdict

def solve(x):
	ans = 0
	zz = x // 2
	while zz > 0:
		ans += 2 * zz * x + 2 * zz * (x - 2)
		x -= 2
		zz -= 1
	return ans
T = int(input())
for _ in range(T):
	N = int(stdin.readline())
	print(solve(N))


t = input()
t = int(t)
while t != 0:
	n = input()
	n = int(n)
	k = n * 4 - 4
	sum = k
	final_sum = sum
	while k > 8:
		k = k - 8
		sum = sum + k
		final_sum = final_sum + sum
	print(final_sum)
	t += -1


for _ in range(int(input())):
	n = int(input())
	ss = 0
	k = n // 2
	ss += 4 * (k * (k + 1))
	k -= 1
	p = k * (k + 1) * (2 * k + 1) // 6
	p += k * (k + 1) // 2
	ss += 8 * p
	print(ss)


import sys
import math
data = sys.stdin.readlines()
for i in range(int(data[0])):
	n = int(data[i + 1])
	m = (n - 1) / 2
	resp = int(round(8 / 6 * m * (m + 1) * (2 * m + 1), 0))
	print(resp)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		p = n // 2
		ans = 0
		e = 8
		for i in range(1, p + 1):
			x = 8 * i
			ans = ans + x * i
			e = e
		print(ans)


def single_integer():
	return int(input())

def multi_integer():
	return map(int, input().split())

def string():
	return input()

def multi_string():
	return input().split()
n = single_integer()
for i in range(n):
	temp = (single_integer() - 1) // 2
	print(str(int(4 * (temp + 1) * temp * (2 * temp + 1) / 3)))


import math
t = int(input())
for i in range(t):
	n = int(input())
	n = n / 2 + 1
	n = int(n)
	add = 0
	ans = 0
	for j in range(n):
		if j == 0:
			pass
		else:
			add += 8
			ans += add * j
	print(ans)


import itertools
levels = [8 * n * n for n in range(250000)]
res = list(itertools.accumulate(levels))
inp = int(input())
for _ in range(inp):
	n = int(input())
	print(res[n // 2])


for _ in range(int(input())):
	n = int(input())
	k = 2
	sum = 0
	for i in range(3, n + 1, 2):
		sum += 8 * (i - k) * (i - k)
		k += 1
	print(sum)


t = int(input())
for z in range(t):
	n = int(input())
	(ans, last) = (0, 0)
	while n != 1:
		k = n * n - (n - 2) * (n - 2) + last
		ans += k
		last = k
		n -= 2
	print(ans)


t = int(input())
ans = []
for i in range(t):
	n = int(input())
	sumVar = 0
	m = 0
	for j in range(1, n + 1, 2):
		sumVar += (j * j - (j - 2) * (j - 2)) * m
		m += 1
	ans.append(sumVar)
for i in range(t):
	print(ans[i])


for _ in range(int(input())):
	x = int(input())
	count = 1
	sum = 0
	while count <= x // 2:
		sum += count * (8 * count)
		count += 1
	print(sum)


def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		dp = {1: 0}
		if n == 1:
			print(0)
			continue
		steps = 1
		for i in range(3, n + 1, 2):
			dp[i] = (i * 2 + (i - 2) * 2) * steps + dp[i - 2]
			steps += 1
		print(dp[n])
main()


for _ in range(int(input())):
	n = int(input())
	p = int(n / 2)
	su = 4 * (p * (p + 1) / 2)
	b = p ** 2
	pp = 0
	i = 1
	j = 1
	while b > 0:
		pp += i * j
		b -= i
		i += 2
		j += 1
	print(int(su) + 4 * pp)


for _ in range(int(input())):
	ans = 0
	c = 0
	for i in range(1, int(input()) // 2 + 1):
		c += 8
		ans += c * i
	print(ans)


t = int(input())
cnt = 0
for cnt in range(t):
	n = int(input())
	sum = 0
	if n == 1:
		print('0')
	else:
		for i in range(int(n / 2)):
			temp = (2 * (i + 1) + 1) * 4 - 4
			sum += (i + 1) * temp
		print(sum)


def solve(n):
	k = (n - 1) // 2
	return 8 * (k * (k + 1) * (2 * k + 1) // 6)
t = int(input())
for i in range(t):
	n = int(input())
	print(solve(n))


a = int(input())
for ufui in range(a):
	val = int(input())
	num = val // 2 + 1
	count = 0
	for i in range(num):
		count = count + i * ((2 * i + 1) ** 2 - (2 * i - 1) ** 2)
	print(count)


x = int(input())
for i in range(x):
	n = int(input())
	c = 0
	d = 3
	for i in range(1, n // 2 + 1):
		c += 8 * i * i
	print(c)


t = int(input())
for k in range(t):
	n = int(input())
	sumx = 0
	if n == 1:
		print(0)
	else:
		count = 1
		while count <= n // 2:
			sumx = sumx + 8 * count * count
			count = count + 1
		print(sumx)


for i in range(int(input())):
	n = int(input())
	k = n // 2
	print(int(8 * k * (k + 1) * (2 * k + 1) / 6))


import sys
input = lambda : sys.stdin.readline().rstrip()
MAX = 5 * 10 ** 5 + 1
out = []
f = [0 for _ in range(MAX)]
for i in range(2, MAX):
	f[i] = f[i - 1] + i * (i - 1)
t = int(input())
for _ in range(t):
	n = int(input())
	ans = f[n]
	out.append(str(ans))
print('\n'.join(out))


for _ in range(int(input())):
	n = int(input())
	total = 0
	while n > 2:
		total += 2 * (n * (n // 2) + (n - 2) * (n // 2))
		n -= 2
	print(total)


for i in range(int(input())):
	x = int(input())
	su1 = 0
	for j in range(x // 2):
		p = x * 4 - 4
		z = x // 2
		k = p * z
		su1 += k
		x -= 2
	print(su1)


t = int(input())
while t > 0:
	n = int(input())
	m = int(n / 2)
	sum1 = 0
	sum1 = m * (m + 1) * 2
	sum2 = 0
	for i in range(1, m + 1):
		sum2 = sum2 + i * (2 * i - 1)
	sum2 = sum2 * 4
	sum = sum1 + sum2
	print(sum)
	t = t - 1


def answer(n):
	x = n // 2
	return 8 * (x * (x + 1) * (2 * x + 1)) // 6
t = int(input())
for i in range(t):
	n = int(input())
	print(answer(n))


import math

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		k = (n ** 2 - 1) // 4
		i = int(math.sqrt(k))
		print(int(8 * i * (i + 1) * (2 * i + 1) / 6))
main()


def process(n):
	sum = 0
	for i in range(1, n + 1):
		if i % 2 == 1:
			sum += 2 * (i // 2) * (2 * i - 2)
	print(sum)
t = int(input())
for i in range(t):
	n = int(input())
	process(n)


for t in range(int(input())):
	n = int(input())
	maxn = 2 * n + 2 * (n - 1)
	K = int(maxn / 8)
	rs = 0
	for i in range(0, K + 1):
		rs = rs + i * i * 8
	print(rs)


t = int(input())
for _ in range(t):
	n = int(input())
	cnt = 0
	s = n // 2
	while s > 0:
		cnt += s * 8 * s
		s -= 1
	print(cnt)


for t in range(int(input())):
	n = int(input())
	cen = n // 2 + 1
	result = 0
	for i in range(1, cen):
		a = (i * 2 + 1) * 4 - 4
		result += a * i
	print(result)


t = int(input())
for i in range(t):
	n = int(input())
	cnt = 0
	j = 1
	for i in range(3, n + 1, 2):
		cnt += j * (4 * i - 4)
		j += 1
	print(cnt)


t = int(input())
while t:
	n = int(input())
	ans = 0
	n_2 = n // 2
	k = 1
	while k < n:
		ans += (n - k) * (n_2 - k + 1)
		k += 1
	print(ans * 4)
	t -= 1


import math
t = int(input())
while t:
	t -= 1
	n = int(input())
	n = n // 2
	n = n * 8 * (2 * n + 1) * (n + 1) / 6
	print(math.trunc(n))


test = int(input())
for _ in range(test):
	s = 0
	n = int(input())
	temp = n // 2
	a = 8
	b = 1
	c = 2
	for i in range(temp):
		s += a * b
		b += 1
		a = 8 * c
		c += 1
	print(s)


def a():
	n = int(input())
	n = n // 2
	n = round(n)
	print(round(8 * n * (n + 1) * (2 * n + 1) / 6))
t = int(input())
for i in range(t):
	a()


t = int(input())
while t:
	n = int(input())
	n = n // 2
	s = n * (n + 1) * (2 * n + 1) // 6
	s = s * 8
	print(s)
	t -= 1


import math
import bisect
T = int(input())
for t in range(T):
	N = int(input())
	out = 0
	for n in range(1, N + 1, 2):
		M = n // 2
		out += M * (4 * (n - 1))
	print(out)


s = {1: 0}
for i in range(3, 500000, 2):
	k = i
	s[i] = (k * 2 + (k - 2) * 2) * (k // 2) + s[i - 2]
t = int(input())
for _ in range(t):
	n = int(input())
	print(s[n])


for _ in range(int(input())):
	ans = 0
	ind = 1
	cnt = 1
	eight = 8
	lim = int(input())
	while ind < lim:
		ans += cnt * eight
		ind += 2
		cnt += 1
		eight += 8
	print(ans)


import sys

def solution():
	t = int(input())
	while t > 0:
		n = int(input())
		res = 0
		for i in range(1, n // 2 + 1):
			res += 2 * ((2 * i + 1) * i) + 2 * ((2 * i - 1) * i)
		print(res)
		t -= 1
solution()


t = int(input())
for i in range(t):
	n = int(input())
	ring = int(n / 2)
	cell = 8
	m = 1
	moves = 0
	for j in range(ring):
		moves = moves + cell * m
		cell += 8
		m += 1
	print(moves)


m = int(input())
b = []
for i in range(m):
	n = int(input())
	k = 1
	s = 0
	while k <= n // 2:
		s = s + 4 * k * (n - k)
		k = k + 1
	b.append(s)
for i in range(len(b)):
	print(b[i])


inp = input
li = list
iinp = lambda : int(inp())
ent = lambda : map(int, inp().split())
lient = lambda : [int(i) for i in inp().split()]
li0 = lambda x: [0 for i in range(x)]
livalor = lambda valor, x: [valor for i in range(x)]
stent = lambda : [i for i in inp()]
filldp = lambda valor, x, y: [[valor for i in range(y)] for i in range(x)]
t = iinp()
for _ in range(t):
	n = iinp()
	medio = n // 2
	suma = 0
	for i in range(medio):
		mul = medio - i
		suma += mul * (n * 4 - 4)
		n = n - 2
	print(suma)


nt = int(input())
for _ in range(nt):
	n = int(input())
	if n > 3:
		x = n // 2
		ans = 8 * (x * (x + 1) * (2 * x + 1) // 6)
		print(ans)
	elif n == 3:
		print(8)
	else:
		print(0)


def sum(n):
	n = int(n / 2)
	return n * (n + 1) * (2 * n + 1) / 6
t = int(input())
a = []
for i in range(t):
	n = int(input())
	a.append(int(8 * sum(n)))
for x in a:
	print(x)


x = int(input())
for i in range(x):
	n = int(input())
	n = n // 2
	ans = n * (n + 1) * (2 * n + 1) // 6 * 8
	print(ans)


t = int(input())
for test in range(t):
	n = int(input())
	m = int((n - 1) / 2)
	num = 8 * (m * (m + 1) * (2 * m + 1) / 6)
	print(int(num))


li = list()
for i in range(500000):
	if i % 2 == 0 or i == 1:
		li.append(0)
	else:
		li.append(li[i - 2] + (i - 1) // 2 * 4 * (i - 1))
for it in range(int(input())):
	print(li[int(input())])


import sys
import math
readline = sys.stdin.readline
ns = lambda : readline().rstrip()
ni = lambda : int(readline().rstrip())
nm = lambda : map(int, readline().split())
nl = lambda : list(map(int, readline().split()))

def solve():
	num = ni()
	res = 0
	for i in range(1, int((num + 1) / 2)):
		res += 8 * i * i
	print(res)
t = ni()
for _ in range(t):
	solve()


from math import ceil, sqrt, gcd, log2
from itertools import groupby, zip_longest
from functools import reduce
from collections import defaultdict, Counter
from heapq import nsmallest, nlargest
for q in range(int(input())):
	n = int(input())
	y = n // 2
	res = y * (y + 1)
	up = y * (y + 1) // 2
	left = y * (y + 1) // 2
	L = 0
	for i in range(1, y):
		L += y * (y + 1) // 2 - i * (i + 1) // 2
	L *= 2
	left += L
	left *= 2
	left += up
	left *= 2
	print(left + res)


t = int(input())
for _ in range(t):
	n = int(input())
	temp = n // 2
	ans = 0
	while n > 1:
		ans += (n * 2 + (n - 2) * 2) * temp
		temp -= 1
		n -= 2
	print(ans)


dp = dict()
dp[1] = 0
dp[3] = 8
cnt = 2
for i in range(5, 500006, 2):
	dp[i] = dp[i - 2] + cnt * cnt * 8
	cnt += 1
for _ in range(int(input())):
	n = int(input())
	print(dp[n])


def board(num):
	h = num ** 2 - 1
	n = 0
	eight = 8
	one = 1
	blanck = []
	while n < h:
		n += eight
		blanck.append(eight * one)
		one += 1
		eight = 8 * one
	return sum(blanck)
t = int(input())
for u in range(t):
	print(board(int(input())))


t = int(input())
res = []
for z in range(t):
	s = 0
	n = int(input())
	r = n // 2
	for i in range(1, r + 1):
		s += i ** 2
	s *= 8
	res.append(s)
for z in range(t):
	print(res[z])


def ri():
	return int(input())

def ria():
	return list(map(int, input().split()))

def solve(n):
	k = n // 2
	s = 0
	for i in range(1, k + 1):
		s += i * i + (k - i) * (k + i + 1) // 2
	return 4 * (s + k * (k + 1) // 2)

def main():
	for _ in range(ri()):
		n = ri()
		print(solve(n))
main()


t = int(input())
while t != 0:
	n = int(input())
	ans = 0
	while n > 0:
		dia = (n - 1) // 2
		ans += 4 * (n - 1) * dia
		n = n - 2
	print(ans)
	t -= 1


for x in range(int(input())):
	n = int(input())
	ans = 0
	times = int(n / 2)
	ans = 8 * int(times * (times + 1) * (2 * times + 1) / 6)
	print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	center = (n + 1) // 2
	ans = 0
	tmp = 1
	for i in range(1, n, 2):
		ans += (i + 1) // 2 * ((i + 2) ** 2 - tmp)
		tmp = (i + 2) ** 2
	print(ans)


import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy
ORDA = 97

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return [int(i) for i in input().split()]

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=2):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	new_number = 0
	while number > 0:
		new_number += number % base
		number //= base
	return new_number

def cdiv(n, k):
	return n // k + (n % k != 0)

def ispal(s):
	for i in range(len(s) // 2 + 1):
		if s[i] != s[-i - 1]:
			return False
	return True
for t in range(ii()):
	n = ii()
	res = 0
	val = 8
	for i in range(1, n // 2 + 1):
		res += val * i
		val = 8 * (i + 1)
	print(res)


t = int(input())
otv = []
for _ in range(t):
	s = 0
	n = int(input())
	do = n // 2
	for i in range(1, do + 1):
		s += i ** 2
	s *= 8
	otv.append(s)
for _ in range(t):
	print(otv[_])


t = int(input())
for t_ in range(t):
	n = int(input())
	s = int((n - 1) / 2)
	total = 0
	for x in range(1, s + 1):
		total += x * (8 * x)
	print(total)


t = int(input())
M = 250003
a = [0] * M
for i in range(1, M - 1):
	a[i + 1] = a[i] + 8 * i ** 2
while t:
	print(a[(int(input()) + 1) // 2])
	t -= 1


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(0)
		continue
	ans = 0
	ts = n // 2 * (n // 2 + 1) // 2
	ans += ts * 8
	for i in range(1, n // 2):
		tans = i * (i + 1) // 2
		tans += (n // 2 - i) * i
		ans += tans * 8
	print(ans)


for t in range(int(input())):
	n = int(input())
	s = 0
	m = 0
	cur = 1
	j = 1
	for i in range(3, n + 1, 2):
		y = i ** 2 - cur
		cur += y
		m += y * j
		j += 1
	print(m)


import sys

def scanint():
	return int(sys.stdin.readline().rstrip())

def scanints():
	return map(int, sys.stdin.readline().rstrip().split())

def scanarr():
	return list(map(int, sys.stdin.readline().rstrip().split()))
from queue import PriorityQueue
import heapq
import math
t = scanint()
for T in range(t):
	n = scanint()
	n = (n + 1) // 2
	print(8 * n * (n - 1) * (2 * n - 1) // 6)


from sys import stdin, stdout
t = int(stdin.readline())
while t > 0:
	n = int(stdin.readline())
	sum = 0
	for i in range(n, 1, -2):
		sum += 4 * (i - 1) * (i // 2)
	stdout.write(str(sum) + '\n')
	t -= 1


t = int(input())
for i in range(0, t, 1):
	n = int(input())
	n = n // 2
	k = 8
	j = 1
	ans = 0
	for i in range(0, n, 1):
		ans = ans + k * j
		k = k + 8
		j = j + 1
	print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(0)
		continue
	sum = 0
	step = 1
	for i in range(3, n + 2, 2):
		sum += step * (step * 8)
		step += 1
	print(sum)


t = int(input())
for _ in range(t):
	n = int(input())
	ans = 0
	if n == 1:
		print(ans)
		continue
	for i in range(1, n + 1, 2):
		ans += 2 * (i - 1) * (i - 1)
	print(ans)


for _ in range(int(input())):
	a = int(input()) // 2
	count = 0
	if a >= 1:
		for i in range(a):
			count += (a - i) * 4 * ((a - i) * 2)
	print(count)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		res = []
		res.append(0)
		res.append(8)
		for i in range(2, n // 2 + 1):
			res.append(res[i - 1] + 8 * i * i)
		print(res[-1])


t = int(input())
for i in range(t):
	n = int(input())
	answ = 0
	if n == 1:
		print(answ)
		continue
	j = 3
	tmp = 1
	while j <= n:
		answ += 2 * (2 * j - 2) * tmp
		tmp += 1
		j += 2
	print(answ)


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(0)
	else:
		n = n // 2
		print(int(4 * n * (n + 1) * (2 * n + 1) / 3))


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(0)
		continue
	temp = int((n - 1) / 2)
	new = int(temp)
	temp = int(temp * (temp + 1) / 2)
	ans = 0
	for j in range(1, new + 1):
		ans += j * (2 * j - 1)
	ans += temp
	ans *= 4
	print(ans)


from sys import stdin, stdout
import heapq
import cProfile
from collections import Counter, defaultdict, deque
from functools import reduce
from random import randint

def get_int():
	return int(stdin.readline().strip())

def get_tuple():
	return map(int, stdin.readline().split())

def get_list():
	return list(map(int, stdin.readline().split()))

def main():
	n = get_int()
	a = 1
	ans = 0
	for i in range(n // 2):
		ans += a * (a * 8)
		a += 1
	print(ans)
TestCases = True
if TestCases:
	for i in range(get_int()):
		main()
else:
	main()


t = int(input())
count = 0
while count < t:
	count += 1
	n = int(input())
	ans = 0
	while n > 0:
		ans += n // 2 * (4 * n - 4)
		n -= 2
	print(ans)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	elif n == 3:
		print(8)
	else:
		cnt = 0
		a = 1
		b = 1
		k = n // 2
		x = k
		for i in range(k):
			cnt = cnt + a * x + b * (b - 1)
			x -= 1
			a += 2
			b += 1
		cnt *= 4
		k = k * (k + 1) // 2
		cnt = cnt + k * 4
		print(cnt)


testcase = int(input())
for test in range(testcase):
	n = int(input())
	if n == 1:
		print(0)
	else:
		step = 0
		depth = n // 2
		while depth > 0:
			step += depth * (2 * n + 2 * (n - 2))
			depth -= 1
			n -= 2
		print(step)


t = int(input())
for _ in range(t):
	n = int(input())
	res = 0
	while n > 1:
		res += (n * 4 - 4) * (n // 2)
		n -= 2
	print(res)


t = int(input())
for i in range(t):
	n = int(input())
	moves = int(n * (n * n - 1) / 3)
	print(moves)


for _ in range(int(input())):
	n = int(input())
	tot = 0
	while n > 0:
		tot += (n - 1) // 2 * (n ** 2 - (n - 2) ** 2)
		n -= 2
	print(tot)


def main():
	n = int(input())
	count = 0
	while n > 1:
		count += (n - 1) * 4 * (n - 1) / 2
		n -= 2
	print(int(count))
T = int(input())
for t in range(T):
	main()


for x in range(int(input())):
	w = int(input())
	st = 3
	ret = 0
	m = 1
	while w >= st:
		t = m * (4 * st - 4)
		ret += t
		st += 2
		m += 1
	print(ret)


from math import *
from collections import *
from operator import itemgetter
import bisect
i = lambda : input()
ii = lambda : int(input())
iia = lambda : list(map(int, input().split()))
isa = lambda : list(input().split())
I = lambda : list(map(int, input().split()))
chrIdx = lambda x: ord(x) - 96
idxChr = lambda x: chr(96 + x)
t = ii()
for _ in range(t):
	n = ii()
	ans = 0
	s = 3
	for i in range(1, ceil(n / 2)):
		ans += s * i * 2 + (s - 2) * i * 2
		s += 2
	print(ans)


import math

def task(n):
	total = 0
	cells = 0
	distance = 0
	for i in range(0, (n - 1) // 2):
		cells += 8
		distance += 1
		total += cells * distance
	print(total)
t = int(input())
for i in range(0, t):
	n = int(input())
	task(n)


def boardMoves(a):
	if a == 1:
		return 0
	a = int(a / 2)
	x = int(a * (a + 1))
	x2 = int((2 * a + 1) * x)
	form = int(x2 / 6)
	return form * 8
t = int(input())
for i in range(0, t):
	a = int(input())
	print(boardMoves(a))


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def solve(n):
	print(n // 2 * n ** 2 - n // 2 * n * (n - 2) // 3)
t = inp()
for i in range(t):
	n = inp()
	solve(n)


for _ in range(int(input())):
	n = int(input())
	val = (n - 1) // 2
	ans = val * (val + 1) * n // 3
	ans = ans * 4
	print(ans)


x = int(input())
for i in range(x):
	n = int(input())
	c = (n - 1) // 2
	ans = 0
	d1 = 0
	for i in range(c):
		d = 4 * (n - 1)
		ans = ans + (c - i) * (d - d1)
		d1 = d1 + 8
	print(ans)


t = int(input())

def fn():
	n = int(input())
	x = (n - 1) // 2
	ans = 8 * x * (x + 1) * (2 * x + 1) // 6
	print(ans)
while t:
	t -= 1
	fn()


testcases = int(input())
for testcase in range(testcases):
	n = int(input())
	if n == 1:
		print(0)
		continue
	if n == 3:
		print(8)
		continue
	total = 8
	length = 3
	breath = 1
	n -= 3
	i = 2
	while n:
		length += 2
		breath += 2
		total += length * 2 * i
		total += breath * 2 * i
		i += 1
		n -= 2
	print(total)
	total = 0


ipnl = lambda n: [int(input()) for _ in range(n)]
inp = lambda : int(input())
ip = lambda : [int(w) for w in input().split()]
for _ in range(inp()):
	n = inp()
	m = n // 2
	print(8 * m * (m + 1) * (2 * m + 1) // 6)


import sys
input = sys.stdin.readline

def main():
	for _ in range(int(input())):
		n = int(input())
		if n == 1:
			print(0)
			continue
		ret = 8
		s = 2
		for c in range(5, n + 1, 2):
			ret += (c * 2 + (c - 2) * 2) * s
			s += 1
		print(ret)
main()


t = eval(input())
for _t in range(t):
	n = eval(input())
	L = int((n - 1) / 2)
	L_sum = 0
	for x in range(1, L + 1):
		L_sum += x * (x * 2 - 1)
	Z_sum = 0
	for x in range(1, L + 1):
		Z_sum += x
	print((Z_sum + L_sum) * 4)


t = int(input())
for _ in range(t):
	n = int(input())
	ans = 0
	while n > 0:
		one = (n - 1) * 4 * (n // 2)
		ans += one
		n -= 2
	print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	d = int(n / 2)
	n = d
	s = 0
	s = (8 * n ** 3 + 12 * n ** 2 + 4 * n) // 3
	print(s)


dp = []
for i in range(1, 500000, 2):
	dp.append(i * 4 + 4)
ans = [0]
for i in range(1, 500000 // 2):
	ans.append(ans[-1] + i * dp[i - 1])
for _ in range(int(input())):
	n = int(input())
	print(ans[n // 2])


t = int(input())
for _ in range(t):
	n = int(input())
	tmp = n
	cnt = 0
	for i in range(n // 2, 0, -1):
		cnt += (2 * tmp + 2 * (tmp - 2)) * i
		tmp -= 2
	print(cnt)


import sys
input = sys.stdin.readline
for t in range(int(input())):
	n = int(input())
	k = n // 2
	print(8 * k * (k + 1) * (2 * k + 1) // 6)


t = int(input())
while t:
	t -= 1
	n = int(input())
	if n == 1:
		print(0)
	else:
		x = n // 2
		sum = 0
		temp = 8
		for i in range(1, x + 1):
			sum += temp * i
			temp += 8
		print(sum)


def main1():
	for _ in range(int(input())):
		n = int(input())
		ans = 0
		k = 1
		for i in range(3, n + 1, 2):
			ans += 4 * (i - 1) * k
			k += 1
		print(ans)
main1()


t = int(input())
while t:
	t = t - 1
	n = int(input())
	cnt = 0
	out = 0
	for i in range(3, n + 1, 2):
		cnt += 1
		out += cnt * (4 * (i - 1))
	print(out)


from sys import stdin
input = stdin.readline
for Ti in range(int(input().strip())):
	n = int(input().strip())
	ans = 0
	for i in range(1, n + 1, 2):
		ans += 8 * (i // 2) * (i // 2)
	print(ans)


from math import ceil
t = int(input())
for _ in range(t):
	n = int(input())
	res = 0
	for i in range(1, n // 2 + 1):
		res += i * (2 * i + 1)
	res *= 4
	n2 = ceil(n // 2)
	res -= 4 * n2 * (n2 + 1) // 2
	print(res)


t = int(input())
for _ in range(t):
	n = int(input())
	k = 3
	ans = 0
	minus = 1
	for i in range(n // 2):
		ans = ans + (k ** 2 - minus) * (i + 1)
		minus = k ** 2
		k += 2
	print(ans)


N = 5 * 10 ** 5 + 5
dp = [0 for i in range(N)]
dp[1] = 0
fact = 8
pro = 1
for i in range(3, N, 2):
	dp[i] = dp[i - 2]
	dp[i] += fact * pro
	pro += 1
	fact = 8 * pro
for _ in range(int(input())):
	n = int(input())
	print(dp[n])


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(0)
	else:
		output = 0
		for i in range(n // 2, 0, -1):
			output += (n * 4 - 4) * i
			n -= 2
		print(output)


t = int(input())
l1 = []
for j in range(1, 500000):
	if j % 2 == 1:
		l1.append(j)
for i in range(t):
	a = int(input())
	b = l1.index(a)
	c = 0
	for k in range(b + 1):
		c = c + k * 8 * k
	print(c)


def solution(m):
	n = m // 2
	return 8 * int(n * (n + 1) * (2 * n + 1) / 6)
t = int(input())
for _ in range(t):
	n = int(input())
	print(solution(n))


import sys

def inp():
	return sys.stdin.readline().strip()
for _ in range(int(inp())):
	n = int(inp())
	print(n * (n ** 2 - 1) // 3)


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	if n == 1:
		print('0')
		continue
	itr = 3
	m = 1
	d = 1
	sums = 0
	while itr <= n:
		sums += m * 8 * d
		itr += 2
		m += 1
		d += 1
	print(sums)


def main():
	N = int(input())
	for _ in range(N):
		n = int(input()) // 2
		print(n * (n + 1) * (2 * n + 1) // 3 * 4)
main()


from collections import defaultdict as dd
import math
import sys

def nn():
	return int(input())

def li():
	return list(input())

def mi():
	return map(int, input().split())

def lm():
	return list(map(int, input().split()))
q = nn()
for _ in range(q):
	n = nn()
	s = 0
	for i in range(n // 2):
		s += (i + 1) * (8 * (i + 1))
	print(s)


t = int(input())
while t > 0:
	n = int(input())
	t -= 1
	if n == 1:
		print(0)
		continue
	n = n / 2
	i = 1
	total = 0
	while i <= n:
		total += i * i
		i += 1
	print(total * 8)


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(0)
		continue
	w = 0
	z = 1
	for x in range(1, n // 2 + 1):
		w += 8 * x * z
		z += 1
	print(w)


t = int(input())
for x in range(t):
	n = int(input())
	ans = 0
	a = b = 1
	for i in range(3, n + 1):
		if i % 2 != 0:
			ans += (i * i - a) * b
			a = i * i
			b += 1
	print(ans)


for _ in range(int(input())):
	n = int(input())
	ans = 0
	while n >= 3:
		ans += (n * n - (n - 2) * (n - 2)) * (n - 1) // 2
		n -= 2
	print(ans)


for _ in range(int(input())):
	n = int(input())
	mid = n // 2
	sum = 0
	for i in range(1, n - mid):
		sum += ((2 * i + 1) * 4 - 4) * i
	print(sum)


import sys
import math
import statistics
import datetime
import collections

def F(n):
	if n == 1:
		return 0
	return 2 * n * n - 4 * n + 2 + F(n - 2)

def main():
	ans = [0, 0, 0]
	for i in range(3, 500001):
		if i % 2 == 0:
			ans.append(0)
		else:
			ans.append(2 * i * i - 4 * i + 2 + ans[i - 2])
	t = int(input())
	for _ in range(t):
		n = int(input())
		print(ans[n])
main()


def solve(n):
	sum = 0
	count = 0
	for i in range(1, n + 1, 2):
		sum += count * (i ** 2 - (i - 2) ** 2)
		count += 1
	return sum
test_cases = int(input())
for _ in range(test_cases):
	print(solve(int(input())))


from sys import stdin

def func(n):
	if n == 1:
		return 0
	x = n // 2
	m = 0
	while x > 0:
		m += 4 * (n - 1) * x
		x -= 1
		n -= 2
	return m
for _ in range(int(input())):
	n = int(input())
	print(func(n))


t = int(input())
l = []
for i in range(t):
	dim = int(input())
	mid = (1 + dim) / 2
	n = dim - mid
	s = n * (n + 1) * (2 * n + 1)
	s = s / 6
	s = 8 * s
	l.append(s)
for i in range(t):
	print(int(l[i]))


import math
from collections import defaultdict
t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(0)
		continue
	(total, fig) = (0, 0)
	for x in range(n // 2):
		fig += 4 * n - 4
		total += fig
		n -= 2
	print(total)


for _ in range(int(input())):
	atual = 1
	n = int(input())
	soma = 0
	elemento = 1
	while atual < n:
		prox = atual + 2
		soma = soma + (prox ** 2 - atual ** 2) * elemento
		atual += 2
		elemento += 1
	print(soma)


t = int(input())
for i in range(t):
	n = int(input())
	half = n // 2
	s = 0
	while half >= 1:
		s += half * (n * 4 - 4)
		n -= 2
		half -= 1
	print(s)


def s(n):
	return (n * 2 + (n - 2) * 2) * ((n - 1) / 2)

def solution(t):
	for _ in range(t):
		n = int(input())
		if n == 1:
			print(0)
		else:
			summ = 0
			while n >= 3:
				summ += s(n)
				n -= 2
			print(int(summ))
solution(int(input()))


answer = []
for i in range(int(input())):
	count = 0
	n = int(input())
	x = int(n // 2 + 1)
	for j in range(1, x):
		count += 8 * j * j
	answer.append(count)
for i in range(len(answer)):
	if answer[i] == -1:
		print(-1)
	else:
		print(answer[i])


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		x = 3
		ans = 0
		for i in range(1, n // 2 + 1):
			ans += 4 * (x - 1) * i
			x += 2
		print(ans)


ans = []
for t in range(int(input())):
	n = int(input())
	s = 0
	for i in range(1, n + 1, 2):
		q = 4 * i - 4
		s += q * (i // 2)
	ans += [s]
for i in ans:
	print(i)


t = int(input())
dp = [0] * 500001
dp[1] = 0
for i in range(3, 500001, 2):
	dp[i] = dp[i - 2] + (i ** 2 - (i - 2) ** 2) * (i // 2)
for _ in range(t):
	n = input()
	n = int(n)
	print(dp[n])


t = int(input())
while t > 0:
	n = int(input())
	k = n
	sum1 = 0
	while k > 1:
		k = k // 2
		sum1 += k * n * 4 - k * 4
		n -= 2
		k = n
	print(sum1)
	t -= 1


def ProcessInputs():
	N = int(input())
	d = int(N / 2)
	i = N
	S = 0
	while i > 0:
		S += (i * 4 - 4) * d
		i = i - 2
		d -= 1
	print(S)
t = int(input())
for _ in range(t):
	ProcessInputs()


from pprint import pprint
import sys
input = sys.stdin.readline
q = int(input())
for _ in range(q):
	n = int(input())
	if n == 1:
		print(0)
	else:
		res = 0
		for i in range(0, (n - 1) // 2):
			c = i + 1
			res += c * ((2 * c - 1) * 4 + 4)
		print(res)


import sys
from math import floor
input = sys.stdin.readline
t = int(input())
for test in range(t):
	n = int(input())
	n = floor(n / 2)
	su = 0
	for i in range(1, n + 1):
		su += i * (4 * (2 * i - 1) + 4)
	print(su)


tests = int(input())
for test in range(tests):
	n = int(input())
	count = 0
	for i in range(3, n + 1, 2):
		count += i // 2 * (4 * i - 4)
	print(count)


t = int(input())
for _ in range(t):
	n = int(input())
	b = n // 2
	ans = b * (4 * n - 4)
	d = -12
	b -= 1
	for i in range(1, n // 2):
		ans += b * (4 * n + d)
		d -= 8
		b -= 1
	print(ans)


t = int(input())
for j in range(t):
	n = int(input())
	mid = n // 2
	res = 0
	if n < 3:
		print(res)
	else:
		for i in range(n, 0, -2):
			res = res + 4 * (i - 1) * mid
			mid = mid - 1
		print(res)


Max = 0
Query = []
for i in range(int(input())):
	N = int(input())
	Max = max(N, Max)
	Query.append(N)
DP = [0]
for i in range(1, Max + 1, 2):
	DP.append(DP[-1] + (i * 2 + (i - 2) * 2) * (i // 2))
Ans = []
for i in Query:
	Ans.append(str(DP[i // 2 + 1]))
print('\n'.join(Ans))


for i in range(int(input())):
	m = int(input())
	print(int(m ** 3 / 3 - m / 3))


T = int(input())
I = 0
while I < T:
	n = int(input())
	print((n ** 3 - n) // 3)
	I += 1


import io
import os
from collections import Counter, defaultdict, deque

def solve(N):
	total = 0
	for i in range(1, N // 2 + 1):
		S = 2 * i + 1
		temp = (S - 1) * 4
		total += temp * i
	return total
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
T = int(input())
for t in range(T):
	(N,) = [int(x) for x in input().split()]
	ans = solve(N)
	print(ans)


for i in range(int(input())):
	n = int(input())
	cnt = 1
	sum1 = 0
	if n == 1:
		print(0)
	else:
		for i in range(3, n + 1, 2):
			edge_count = i ** 2 - (i - 2) ** 2
			sum1 += edge_count * cnt
			cnt += 1
		print(sum1)


t = int(input())
for i in range(t):
	n = int(input())
	k = 1
	sumi = 0
	temp = (n - 1) * 4
	while n - k > 0:
		sumi += temp
		k += 2
		temp += (n - k) * 4
	print(sumi)


t = int(input())
while t != 0:
	t -= 1
	a = int(input())
	a = (a - 1) / 2
	s = a * (a + 1) * (2 * a + 1) / 6 * 8
	print(int(s))


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(0)
	else:
		total = n // 2
		s = 0
		inc = 8
		for i in range(1, total + 1):
			s += 8 * i * i
		print(s)


import sys
input = sys.stdin.readline
t = int(input())
for r in range(t):
	n = int(input())
	if n == 1:
		print(0)
	else:
		ans = 0
		start = 8
		counter = 1
		for k in range(n // 2):
			ans += start * counter
			start += 8
			counter += 1
		print(ans)


test = eval(input())
for _ in range(test):
	num = eval(input())
	val = 0
	value = num // 2
	for i in range(1, value + 1):
		val += i * i * 8
	if num == 1:
		val = 0
	print(val)


n = int(input())
result = [0]
for i in range(n):
	a = int(input())
	if a <= len(result):
		print(result[a - 1])
	else:
		for j in range(len(result) + 1, a + 1):
			if j % 2 == 1:
				k = j // 2
				score = k * (8 * k) + result[j - 3]
			else:
				score = result[j - 2] + 2 * j - 1
			result.append(score)
		print(result[a - 1])


arr = [0] * 2 * (5 * 10 ** 5)
(arr[1], arr[3], arr[5]) = (0, 8, 40)
count = 3
for i in range(7, 2 * (5 * 10 ** 5)):
	if i % 2 != 0:
		arr[i] = arr[i - 2] + 8 * (count * count)
		count += 1
for i in range(int(input())):
	n = int(input())
	print(arr[n])


t = int(input())
for _ in range(t):
	n = int(input())
	j = n // 2
	moves = 0
	for i in range(j, 0, -1):
		curr_moves = 4 * (i * (n - 1))
		n -= 2
		moves += curr_moves
	print(moves)


test_case = int(input())
for _ in range(test_case):
	n = int(input())
	steps = 0
	while n != 1:
		mid = 1 + n // 2
		steps += (n * 4 - 4) * (mid - 1)
		n -= 2
	print(steps)


def modinv(n, p):
	return pow(n, p - 2, p)

def main():
	for case in range(int(input())):
		n = int(input())
		ans = 0
		while n > 0:
			l = n // 2
			ans += (n * 2 + (n - 2) * 2) * l
			n -= 2
		print(ans)
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


for s in [*open(0)][1:]:
	n = int(s) + 1
	r = 0
	for i in range(3, n, 2):
		r += 2 * (i - 1) * (i - 1)
	print(r)


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(1000000)
	threading.stack_size(1024000)
	thread = threading.Thread(target=main)
	thread.start()
import sys
input = sys.stdin.readline
scanner = lambda : int(input())
string = lambda : input().rstrip()
get_list = lambda : list(read())
read = lambda : map(int, input().split())
get_float = lambda : map(float, input().split())

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def factorial(x, m):
	val = 1
	while x > 0:
		val = val * x % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // math.gcd(a, b)

def is_integer(n):
	return math.ceil(n) == math.floor(n)

def nCr(n, k):
	if k > n:
		return 0
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	(prime[0], prime[1]) = (False, False)
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def phi(n):
	result = n
	p = 2
	while p * p <= n:
		if n % p == 0:
			while n % p == 0:
				n = n // p
			result = result * (1.0 - 1.0 / float(p))
		p = p + 1
	if n > 1:
		result = result * (1.0 - 1.0 / float(n))
	return int(result)

def is_prime(n):
	if n == 0:
		return False
	if n == 1:
		return True
	for i in range(2, int(n ** (1 / 2)) + 1):
		if not n % i:
			return False
	return True

def next_prime(n, primes):
	while primes[n] != True:
		n += 1
	return n
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]

def factoriazation(x):
	res = []
	for i in range(2, int(x ** 0.5) + 1):
		while x % i == 0:
			res.append(i)
			x //= i
	if x != 1:
		res.append(x)
	return res

def factors(n):
	res = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			res.append(i)
			res.append(n // i)
	return list(set(res))

def int_array():
	return list(map(int, input().strip().split()))

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()

def binary_search(low, high, w, h, n):
	while low < high:
		mid = low + (high - low) // 2
		if check(mid, w, h, n):
			low = mid + 1
		else:
			high = mid
	return low

def check(beauty, s, n, count):
	pass
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
alphs = 'abcdefghijklmnopqrstuvwxyz'
from itertools import permutations
import math
import bisect as bis
import random
import sys
import collections as collect

def solve():
	n = scanner()
	s = 0
	for i in range(1, n + 1, 2):
		s += (2 * i + 2 * (i - 2)) * (i // 2)
	print(s)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for i in range(scanner()):
	solve()


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		su = 0
		x = 1
		for i in range(3, n + 1, 2):
			box = 2 * i + 2 * (i - 2)
			box = box * x
			x += 1
			su += box
		print(su)


def solve():
	n = int(input())
	ans = 0
	for i in range(3, n + 1, 2):
		d = (i - 1) // 2
		num = 4 * i - 4
		ans += d * num
	return ans
for _ in range(int(input())):
	print(solve())


t = int(input())
for i in range(t):
	n = int(input())
	print(int(8 * n * (n - 1) * (n + 1) / 24))


t = int(input())
for i in range(t):
	n = int(input())
	mx_moves = n // 2
	ans = 0
	for j in range(n, 1, -2):
		x = j ** 2 - (j - 2) ** 2
		ans += x * mx_moves
		mx_moves -= 1
	print(ans)


from sys import stdin as lector
input = lector.readlines()
for i in range(1, int(input[0]) + 1):
	n = int(int(input[i]) / 2)
	print(int(8 * (n * (n + 1) * (n - 1) / 3 + n * (n + 1) / 2)))


from sys import stdin, stdout
import collections
import heapq
import itertools
import functools

def read_line():
	return stdin.readline().strip()

def read_int():
	return int(read_line())

def read_arr():
	return read_line().split(' ')

def read_int_arr():
	return [int(x) for x in read_arr()]

def main():
	T = read_int()
	for _ in range(T):
		n = read_int()
		n = n ** 2 - 1
		c = 8
		d = 1
		res = 0
		while n > 0:
			res += c * d
			n -= c
			c += 8
			d += 1
		print(res)
main()


for tc in range(int(input())):
	n = int(input())
	state = n
	mul = n // 2
	summ = 0
	while state > 0:
		summ += mul * (4 * (state - 1))
		state -= 2
		mul -= 1
	print(summ)


class Moves:
	tot = []

	def __init__(self):
		self.max_n = 500000
		self.compute_moves()

	def compute_moves(self):
		self.tot.append(0)
		for i in range(1, self.max_n):
			self.tot.append(self.tot[i - 1] + i * i * 8)

	def min_moves(self, n):
		b = n // 2
		return self.tot[b]
T = int(input())
move = Moves()
for t in range(T):
	N = int(input())
	print(move.min_moves(N))


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(0)
		continue
	h = n // 2
	print(4 * h * (h + 1) * (2 * h + 1) // 3)


for _ in range(int(input())):
	n = int(input())
	v = n * 2 + (n - 2) * 2
	m = n // 2
	c = 0
	while m != 0:
		c += v * m
		m -= 1
		v -= 8
	print(c)


t = int(input())
for _ in range(0, t):
	n = int(input())
	c = 0
	rr = n // 2
	i = 1
	one = 1
	two = 2
	res = 0
	while c < rr:
		res += (c + 1) * i
		c += one
		i += two
	ans = res * 4
	for j in range(0, rr):
		ans += 4 * (j + 1)
	print(ans)


for T in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		sol = 0
		step = 1
		for i in range(1, n // 2 + 1):
			sol += i * (step * 4) + 4 * i
			step += 2
		print(sol)


import sys
sys.setrecursionlimit(10 ** 6)
nofkase = int(input())
for kase in range(nofkase):
	n = int(input())
	n = n // 2
	print(n * (n + 1) * (n + n + 1) * 8 // 6)


testCases = int(input())
max_size = 500000 + 10
res = [0 for i in range(max_size)]
res[1] = 0
res[3] = 8
for i in range(5, max_size, 2):
	res[i] = res[i - 2] + 4 * (i - 1) * (i // 2)
for _ in range(testCases):
	n = int(input())
	print(res[n])


def squaresum(n):
	y = n * (n + 1) * (2 * n + 1) // 6
	y = y * 8
	return y
for o in range(int(input())):
	n = int(input())
	t = n // 2
	y = squaresum(t)
	print(y)


t = int(input())
for _ in range(t):
	n = int(input())
	print(sum([i // 2 * (4 * i - 4) for i in range(1, n + 1, 2)]))


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
inin = lambda : int(input())
inar = lambda : list(map(int, input().split()))
inst = lambda : input().decode().rstrip('\n\r')
INF = float('inf')
_T_ = inin()
for _t_ in range(_T_):
	n = inin()
	hogaya = 0
	num = 1
	dist = 0
	su = 0
	for i in range((n + 1) // 2):
		su += (num ** 2 - hogaya) * dist
		dist += 1
		hogaya = num ** 2
		num += 2
	print(su)


import sys
input = sys.stdin.buffer.readline

def print(val):
	sys.stdout.write(str(val) + '\n')
for _ in range(int(input().strip())):
	n = int(input().strip())
	if n == 1:
		print(0)
	else:
		m = n // 2
		total = 0
		for i in range(1, m + 1):
			total += i * (4 * (2 * i))
		print(total)


from sys import stdin, stdout

def st():
	return list(stdin.readline().strip())

def inp():
	return int(stdin.readline())

def inlt():
	return list(map(int, stdin.readline().split()))

def invr():
	return map(int, stdin.readline().split())
max_iterations = 100000000
for i in range(inp()):
	k = int(input())
	n = k // 2
	ans = 4 * (n * (n + 1) * (2 * n + 1)) // 3
	print(ans)


def func(n):
	tot = 0
	while n > 0:
		tot += (n - 1) // 2 * (n ** 2 - (n - 2) ** 2)
		n -= 2
	return tot
for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		print(func(n))


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		res = 0
		j = 3
		k = 1
		t = 1
		for i in range(1, n - 1, 2):
			res += (j * j - k * k) * t
			j += 2
			k += 2
			t += 1
		print(res)


nb_cases = int(input())
for c in range(nb_cases):
	size = int(input())
	s = int(size / 2)
	print(int(8 * s * (s + 1) * (2 * s + 1) / 6))


import sys
t = int(input())
dp = []
dp.append(1)
for i in range(2, 5 * 10 ** 5):
	if i % 2 == 0:
		dp.append(0)
	else:
		dp.append(i ** 2 - (i - 2) ** 2)
result = ''
for i in range(0, t):
	n = int(input())
	sum = 0
	w = 0
	k = 0
	while w <= n:
		sum += dp[w] * k
		w += 2
		k += 1
	result += str(sum) + '\n'
print(result)


N = int(input())
answers = []
for i in range(N):
	n = int(input())
	result = 0
	for i in range(n // 2):
		result += (i + 1) * (8 + 8 * i)
	answers.append(result)
for i in answers:
	print(i)


def codeForces():
	t = int(input())
	s = 0
	while t > 0:
		s = 0
		n = int(input())
		for i in range(1, int(n / 2) + 1, 1):
			s += i ** 2
		print(str(s * 8))
		t = t - 1
codeForces()


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print('0')
	else:
		z = n // 2
		s = 0
		for i in range(1, z + 1):
			s = s + i * (8 * i)
		print(s)


t = int(input())
for _ in range(t):
	n = int(input())
	m = [x for x in range(1, n + 1, 2)]
	f = range(1, len(m) + 1)
	s = 0
	for i in range(len(m) - 1):
		k = (m[i + 1] ** 2 - m[i] ** 2) * f[i]
		s += k
	print(s)


import math as m
t = int(input())
for _ in range(t):
	n = int(input())
	ans = 0
	z = int(m.floor(n / 2))
	for i in range(1, z + 1):
		mul = 8 * i
		ans += i * mul
	print(ans)


def solve():
	n = int(input())
	k = n // 2
	result = k * (k + 1) * (2 * k + 1)
	result = result / 6
	result = result * 8
	print(int(result))
t = int(input())
for loop in range(t):
	solve()


t = int(input())
while t:
	t -= 1
	n = int(input())
	if n == 1:
		print(0, end='\n')
		continue
	k = 3
	c = 1
	ans = 0
	while k <= n:
		ans += c * 8 + (c - 1) * 8 * c
		k += 2
		c += 1
	print(ans, end='\n')


t = int(input())
for i in range(t):
	n = int(input())
	sum = 0
	b = n // 2
	for i in range(b, 0, -1):
		a = 4 * (n - 1)
		sum += a * i
		n -= 2
	print(sum)


t = int(input())
for _ in range(t):
	n = int(input())
	ans = 0
	k = 3
	th = 1
	for j in range(3, n + 1, 2):
		ans += (j ** 2 - (j - 2) ** 2) * th
		th += 1
	print(ans)


import math
t = int(input())
for _ in range(t):
	n = int(input())
	n = n // 2
	ans = 8 * n * (n + 1) * (2 * n + 1) / 6
	print(math.floor(ans))


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
		continue
	else:
		nu = n ** 2 - 1
		i = 1
		s = 0
		while nu != 0:
			s += 8 * i ** 2
			nu -= 8 * i
			i += 1
		print(s)


for _ in range(int(input())):
	n = int(input())
	ans = 0
	for i in range(1, n // 2 + 1):
		val = (1 + 2 * i) * 2 + (1 + 2 * (i - 1)) * 2
		ans += val * i
	print(ans)


tc = int(input())
while tc:
	tc = tc - 1
	n = int(input())
	n = int(n / 2)
	print(int(8 * n * (n + 1) * (2 * n + 1) / 6))


def solve():
	n = int(input())
	sm = 0
	idx = 1
	while idx < n:
		sm += ((idx + 2) ** 2 - idx ** 2) * (idx + 1) // 2
		idx += 2
	print(sm)
T = int(input())
for i in range(T):
	solve()


from collections import defaultdict, deque
from itertools import permutations
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
from copy import deepcopy
import heapq
int_input = lambda : int(stdin.readline())
string_input = lambda : stdin.readline().split()
multi_int_input = lambda : map(int, stdin.readline().split())
multi_input = lambda : stdin.readline().split()
list_input = lambda : list(map(int, stdin.readline().split()))
string_list_input = lambda : list(string_input())
MOD = pow(10, 18)
test = int_input()
for _ in range(test):
	n = int_input()
	starting = 8
	x = 3
	mul = 1
	ans = 0
	while x <= n:
		ans += starting * mul
		mul += 1
		x += 2
		starting = starting + 8
	print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(0)
	else:
		l = 1
		m = 1
		res = 0
		while l < n:
			res += (l + 1) * 4 * m
			l += 2
			m += 1
		print(res)


t = int(input())
for i in range(t):
	s = int(input())
	sum = 0
	a = s // 2
	sum = sum + a * (a + 1) // 2 * 8
	c = 2
	for i in range(a - 1):
		sum = sum + c * 8 * (i + 1)
		c = c + 1
	print(sum)


import math
t = int(input())
for i in range(t):
	n = int(input())
	aux = math.floor(n / 2)
	print(int((2 * aux + 1) * (aux + 1) * aux / 6 * 8))


from sys import stdin
for _ in range(int(stdin.readline())):
	n = int(input())
	if n == 0:
		print(0)
	else:
		s = 0
		for i in range(n // 2):
			s += (i + 1) * (8 * (i + 1))
		print(s)


t = int(input())
for i in range(0, t):
	n = int(input())
	if n == 1:
		print('0')
	else:
		mid = (n + 1) / 2
		steps = 0
		for i in range(1, int(mid)):
			steps += 8 * i * i
		print(steps)


for _ in range(int(input())):
	n = int(input())
	tot = 0
	while n >= 3:
		steps = n // 2
		elements = n * 4 - 4
		tot += elements * steps
		n -= 2
	print(tot)


T = int(input())
for t in range(T):
	n = int(input())
	if n == 1:
		print(0)
	else:
		tot = 0
		interior = 1
		exterior = 3
		for i in range(n // 2):
			tot += (i + 1) * (exterior * exterior - interior * interior)
			interior = exterior
			exterior += 2
		print(tot)


for i in range(int(input())):
	print(sum((4 * (k // 2) * (k - 1) for k in range(int(input()), 0, -2))))


rr = lambda : input().strip()
rri = lambda : int(rr())
rrm = lambda : [int(x) for x in rr().split()]
from math import gcd
from sys import stdin, stdout
lis = [0 for i in range(500001)]
a = 1
for i in range(3, 500001, 2):
	lis[i] = lis[i - 2] + 8 * a * a
	a += 1

def sol():
	n = rri()
	print(lis[n])
	return
T = rri()
for _ in range(T):
	sol()


import sys
input = sys.stdin.readline
a = int(input())
for i in range(a):
	n = int(input())
	ans = [1]
	for i in range(1, n // 2 + 1):
		if i == 1:
			ans.append(8)
		else:
			ans.append(ans[-1] + 8)
	total = 0
	for i in range(len(ans)):
		total += ans[i] * i
	print(total)


nb_cases = int(input())
for c in range(nb_cases):
	size = int(input())
	number_of_moves = 0
	for s in range(int(size / 2) + 1):
		number_of_moves += s * s * 8
	print(number_of_moves)


test = int(input())
for _ in range(test):
	n = int(input())
	ans = 0
	for x in range(n, 1, -2):
		ans += pow(x - 1, 2) * 2
	print(ans)


for _ in range(int(input())):
	n = int(input())
	eight = 8
	one = 1
	moves = 0
	for i in range(n // 2):
		moves = moves + eight * one
		eight += 8
		one += 1
	print(moves)


T = int(input())
while T:
	n = int(input())
	k = n // 2
	S = 8 * (k * (k + 1) * (2 * k + 1)) // 6
	print(S)
	T = T - 1


def cal(n):
	if n == 1:
		return 0
	ans = 0
	for i in range(1, n + 1, 2):
		ans += i // 2 * 4 * (i - 1)
	return ans

def web():
	T = int(input())
	for t in range(1, T + 1):
		arr = [int(s) for s in input().split(' ')]
		ans = cal(arr[0])
		print(str(ans))

def file():
	x = open('p3_in.txt')
	T = int(x.readline())
	for t in range(1, T + 1):
		arr = [int(s) for s in x.readline().split(' ')]
		ans = cal(arr[0])
		print(str(ans))
web()


for i in range(int(input())):
	n = int(input())
	g = 8
	h = 1
	total = 0
	if n == 1:
		print(0)
	else:
		for j in range(n // 2):
			total = total + g * h
			h = h + 1
			g = g + 8
		print(total)


def r(t=int):
	return list(map(t, input().split()))

def ri(t=int):
	return t(input())

def cd(it):
	ret_val = dict()
	for v in it:
		ret_val[v] = ret_val.get(v, 0) + 1
	return ret_val
for _ in range(ri()):
	n = ri()
	c = 0
	f = 0
	ans = 0
	for i in range(n // 2):
		c += 2
		ans += (i + 1) * c * 4
	print(ans)


import math

def ChessMove(n):
	m = math.ceil(n / 2)
	TotalSum = 0
	for i in range(m):
		TotalSum += i * 2 * 4 * i
	return TotalSum
t = int(input())
Result = list()
for i in range(t):
	n = int(input())
	Result.append(ChessMove(n))
for r in Result:
	print(r)


import sys
t = int(input())
for _ in range(t):
	n = int(input())
	middle = n // 2
	sum = 0
	for i in range(1, middle + 1):
		sum += 8 * i * i
	print(sum)


t = int(input())
for i in range(t):
	number = int(input())
	cnt = 0
	for j in range(0, number // 2 + 1):
		cnt += 8 * j ** 2
	print(cnt)


import atexit
import io
import sys
_INPUT_LINES = sys.stdin.read().splitlines()
input = iter(_INPUT_LINES).__next__
_OUTPUT_BUFFER = io.StringIO()
sys.stdout = _OUTPUT_BUFFER

@atexit.register
def write():
	sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
tc = int(input())
for zzz in range(tc):
	n = int(input())
	s = 0
	p = 1
	for i in range(3, n + 1, 2):
		s += (i ** 2 - (i - 2) ** 2) * p
		p += 1
	print(s)


def findsum(str1, str2):
	if len(str1) > len(str2):
		t = str1
		str1 = str2
		str2 = t
	ans = ''
	str1 = str1[::-1]
	str2 = str2[::-1]
	n1 = len(str1)
	n2 = len(str2)
	carry = 0
	for i in range(n1):
		res = ord(str1[i]) - 48 + (ord(str2[i]) - 48) + carry
		ans += chr(res % 10 + 48)
		carry = res // 10
	for i in range(n1, n2):
		res = ord(str2[i]) - 48 + carry
		ans += chr(res % 10 + 48)
		carry = res // 10
	if carry:
		ans += chr(carry + 48)
	return ans[::-1]
t = int(input())
for i in range(t):
	n = int(input())
	s = ''
	m = 8
	k = 1
	for j in range(n // 2):
		s = findsum(s, str(m * k))
		k += 1
		m = 8 * k
	if s == '':
		print(0)
	else:
		print(s)


from sys import stdout, stdin
import io
import os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
for t in range(int(input())):
	n = int(input())
	if n == 1:
		stdout.write('0\n')
	else:
		c = n
		a = 2 * c - 3
		b = n // 2
		su = 0
		while a >= 3:
			su += a * b
			c = c - 2
			b = b - 1
			a = 2 * c - 3
		su = su * 2
		stdout.write(str(su + n // 2 * (n // 2 + 1)) + '\n')


import math
t = int(input())
while t > 0:
	t = t - 1
	n = int(input())
	x = math.floor(n / 2)
	sum = x * (x + 1) * (2 * x + 1) / 6
	print(int(sum * 8))


for i in range(int(input())):
	n = int(input())
	e = n // 2
	sum = 8
	if n == 1:
		print('0')
	else:
		for i in range(2, e + 1):
			sum += 8 * i * i
		print(sum)


import math
from collections import deque
import sys
sys.setrecursionlimit(10 ** 4)

def Divisors(n):
	l = []
	i = 2
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
		i = i + 1
	return l

def SieveOfEratosthenes(n):
	l = []
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	for p in range(2, n + 1):
		if prime[p]:
			l.append(p)
	return l

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(i)
			n = n / i
	if n > 2:
		l.append(n)
	return l

def Factors(n):
	result = []
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			if i == n / i:
				result.append(i)
			else:
				result.append(i)
				result.append(n // i)
	result.append(1)
	result.append(n)
	return result

def maxSubArraySum(a):
	max_so_far = 0
	max_ending_here = 0
	size = len(a)
	for i in range(0, size):
		max_ending_here = max_ending_here + a[i]
		if max_so_far < abs(max_ending_here):
			max_so_far = max_ending_here
	return max_so_far

def longestsubarray(arr, n, k):
	current_count = 0
	max_count = 0
	for i in range(0, n, 1):
		if arr[i] % k != 0:
			current_count += 1
		else:
			current_count = 0
		max_count = max(current_count, max_count)
	return max_count

def main():
	n = int(input())
	if n == 1:
		print(0)
	else:
		s = 8
		for j in range(1, n // 2):
			p = 0
			s += (j + 1) * (8 * (j + 1) + p)
		print(s)
t = int(input())
for i in range(0, t):
	main()


t = int(input())
dp = [0, 0, 0]
for i in range(3, 5 * 10 ** 5, 2):
	dp.append(dp[i - 2] + 4 * (i - 2) * (i // 2) + 4 * (i // 2))
	dp.append(0)
while t > 0:
	t -= 1
	n = int(input())
	print(dp[n])


t = int(input())
for _ in range(t):
	n = int(input())
	end = n // 2
	sumOfSquares = end * (end + 1) * (2 * end + 1) // 6
	print(int(sumOfSquares * 8))


for i in range(int(input())):
	n = int(input())
	num = n // 2
	s = 0
	for i in range(1, num + 1):
		s += 8 * pow(i, 2)
	print(s)


from sys import stdin
input = stdin.readline

def list_input():
	return list(map(int, input().split()))

def sep_input():
	return map(int, input().split())
for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	elif n == 3:
		print(8)
	else:
		k = n // 2
		ans1 = 4 * k * (k + 1)
		k = k - 1
		ans2 = k * (k + 1) * (k + 2) // 3
		ans2 = ans2 * 8
		ans = ans1 + ans2
		print(ans)


t = int(input())
while t != 0:
	t -= 1
	n = int(input())
	k = n // 2
	l = 0
	for i in range(1, k + 1):
		l += i * (2 * i + 1)
	l *= 2
	p = 0
	for i in range(1, k + 1):
		p += i * (2 * i - 1)
	p *= 2
	l += p
	print(l)


for _ in range(int(input())):
	n = int(input())
	c = 1
	r = 8
	ans = 0
	for t in range(n // 2):
		ans += r * c
		c += 1
		r += 8
	print(ans)


for _ in range(0, int(input())):
	n = int(input())
	print(round((n * n * n - n) / 3))


t = int(input())
for tc in range(t):
	ans = 0
	n = int(input())
	for x in range(1, n + 1, 2):
		ans = ans + 4 * (x - 1) * (x // 2)
	print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	s = 0
	k = 1
	if n == 1:
		print(0)
	else:
		for i in range(1, n - 1, 2):
			s = s + ((i + 2) * (i + 2) - i * i) * k
			k = k + 1
		print(s)


n = int(input())
d = []
for k in range(n):
	x = int(input())
	d.append(x)
for a in d:
	c = (a - 1) / 2
	print(int(8 * c * (c + 1) * (2 * c + 1) / 6))


def Gen(a, k):
	while 1:
		yield (a * k)
		a += 2
		k += 1
num = int(input())
for _ in range(num):
	n = int(input())
	ans = 0
	if n == 1:
		print(0)
	else:
		gen = Gen(2, 1)
		for i in range(n // 2):
			ans += next(gen) * 4
		print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	j = 1
	k = n // 2
	c = 0
	ans = 0
	while c < k:
		ans += (c + 1) * j
		j += 2
		c += 1
	fans = ans * 4
	for i in range(k):
		fans += 4 * (i + 1)
	print(fans)


import sys
input = lambda : sys.stdin.readline().strip()
t = int(input())
while t:
	t -= 1
	n = int(input())
	ans = 2 * (n - 1)
	temp = 0
	te = (n - 1) // 2
	for i in range((n - 1) // 2 - 1):
		temp += te * (te + 1) - i * (i + 1) - (i + 1)
	temp += te * (te + 1) // 2
	ans += temp * 4
	print(ans)


tc = int(input())
for _ in range(tc):
	n = int(input())
	if n == 1:
		print(0)
	else:
		ans = 0
		now = 0
		i = 1
		while now < n * n - 1:
			now += 8 * i
			ans += 8 * i * i
			i += 1
		print(ans)


t = int(input())
while t:
	n = int(input())
	if n == 1:
		print(0)
		t -= 1
		continue
	a = 3
	b = 1
	s = 0
	n1 = n // 2
	for i in range(n, 0, -2):
		s += (i - 1) * 4 * n1
		n1 -= 1
	print(s)
	t -= 1


import sys
inp = [int(x) for x in sys.stdin.buffer.read().split()]
ii = 0
qqq = inp[ii]
ii += 1
for _ in range(qqq):
	n = inp[ii]
	ii += 1
	m = n // 2
	print(m * (m + 1) * (2 * m + 1) * 4 // 3)


from sys import stdin
input = stdin.buffer.readline
for _ in range(int(input())):
	n = int(input())
	ans = 0
	for i in range(n // 2):
		ans += (n - 1 - 2 * i) * (n // 2 - i)
	print(4 * ans)


n = int(input())
for i in range(n):
	n = int(input())
	final = 0
	z = (n - 1) / 2
	while z != 0:
		final += (n * 4 - 4) * z
		z -= 1
		n -= 2
	print(int(final))


T = int(input())
for t in range(T):
	n = int(input())
	a = (n - 1) // 2
	ans = a * (a + 1) * (2 * a + 1) // 6
	print(8 * ans)


def call():
	n = int(input())
	if n == 0 or n == 1:
		print(0)
		return
	coN = 0
	for i in range(1, n // 2 + 1):
		coN += i ** 2
	print(coN * 8)
t = int(input())
for i in range(t):
	call()


t = int(input())
while t:
	n = int(input())
	l = (n - 1) // 2
	res = 0
	if n == 1:
		print(0)
	else:
		while l > 0:
			res += (n + n - 2) * l * 2
			n -= 2
			l -= 1
		print(res)
	t -= 1


t = int(input())
for i in range(0, t):
	n = int(input())
	rs = int()
	if n == 1:
		print(0)
	else:
		for e in range(n - n // 2):
			rs += 8 * e * e
		print(rs)


t = int(input())
for test in range(t):
	n = int(input())
	i = 1
	j = 8
	tot = j
	grid = n * n
	ans = 0
	while tot < grid:
		ans += i * j
		i += 1
		tot += j
		j += 8
	print(ans)


import math
t = int(input())
for u in range(t):
	n = int(input())
	res = 0
	t = 0
	s1 = n // 2 * n
	s2 = n - 2
	sm = (s2 + 1) * (n // 2) // 2
	c = s1 - sm
	res = int(c)
	for i in range(n // 2):
		res += 2 * (c + 2 * i + 1 + t)
		t += 2 * i + 1
	print(res)


for i in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		b = 3
		a = 1
		m = 1
		ans = 0
		i = (n - 1) // 2
		while i:
			ans += (b ** 2 - a ** 2) * m
			b += 2
			a += 2
			i -= 1
			m += 1
		print(ans)


l = [0]
c = 1
for i in range(3, 500001, 2):
	l.append(((i - 2) * 4 + 4) * c + l[-1])
	c += 1
for _ in range(int(input())):
	n = int(input())
	print(l[n // 2])


for _ in range(int(input())):
	n = int(input())
	steps = 0
	a = 8
	for k in range(1, n // 2 + 1):
		steps += a * k
		a += 8
	print(steps)


import math
from collections import defaultdict
t = int(input())

def findStep():
	n = int(input())
	mid = (n - 1) // 2
	total_sum = 0
	for i in range(1, mid + 1):
		total_sum += i * (i * 8)
	print(total_sum)
for test_case in range(t):
	findStep()


import sys, math
from collections import defaultdict as dd
input = sys.stdin.readline
for i in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		s = 0
		for i in range(n // 2 + 1):
			s += i * i
		print(s * 8)


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(0)
	elif n == 2:
		print(4)
	else:
		s = 0
		c = 1
		i = 1
		while i <= n // 2:
			s = s + 2 * i * 4 * c
			i += 1
			c += 1
		print(s)


def main():
	t = int(input())
	for i in range(t):
		n = int(input())
		k = n // 2
		val = 8 * k * (k + 1) * (2 * k + 1) / 6
		print(int(val))
main()


import sys
input = sys.stdin.readline

def int_array():
	return list(map(int, input().strip().split()))

def str_array():
	return input().strip().split()

def lower_letters():
	lowercase = [chr(i) for i in range(97, 97 + 26)]
	return lowercase

def upper_letters():
	uppercase = [chr(i) for i in range(65, 65 + 26)]
	return uppercase

def brute():
	for _ in range(int(input())):
		n = int(input())
		total_layers = n // 2
		moves = 0
		for i in range(1, total_layers + 1):
			moves += 8 * i * i
		print(moves)
brute()


import sys
import os
import time
import collections
from collections import Counter, deque
import itertools
import math
import timeit
import random
import string

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	divisors = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				divisors.append(i)
			else:
				divisors.extend([i, n // i])
	return divisors

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def flin(d, x, default=-1):
	left = right = -1
	for i in range(len(d)):
		if d[i] == x:
			if left == -1:
				left = i
			right = i
	if left == -1:
		return (default, default)
	else:
		return (left, right)

def ceil(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def prr(a, sep=' ', end='\n'):
	print(sep.join(map(str, a)), end=end)

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)
for _ in range(ii()):
	n = ii()
	res = 0
	cs = 8
	for i in range(1, n // 2 + 1):
		res += cs * i
		cs += 8
	print(res)


t = int(input())
for i in range(t):
	n = int(input())
	total = 0
	if n == 1:
		print(0)
	else:
		while n > 1:
			layers = n // 2
			outer = n * 2 + (n - 2) * 2
			total += layers * outer
			n -= 2
		print(total)


def numberOfMoves(n):
	alreadyMoved = 1
	multiplier = 1
	moves = 0
	while alreadyMoved < n * n:
		moves += multiplier ** 2 * 8
		alreadyMoved += multiplier * 8
		multiplier += 1
	return moves
for _ in range(int(input())):
	print(numberOfMoves(int(input())))


n = int(input())
for j in range(n):
	s = int(input())
	c = int((s + 1) // 2)
	k = 0
	for i in range(c):
		k += i ** 2
	print(8 * k)


from sys import stdin, stdout

def solve(n):
	mid = n // 2
	moves = 0
	mult = 8
	for depth in range(1, mid + 1):
		moves += depth * mult
		mult += 8
	stdout.write(f'{moves}\n')
	return
t = int(stdin.readline())
for _ in range(t):
	solve(int(stdin.readline()))


from sys import stdin, stdout
m = 10 ** 9 + 7
t = int(stdin.readline())
while t:
	t -= 1
	n = int(stdin.readline())
	ans = 0
	for i in range(1, n + 1, 2):
		ans += 2 * (i - 1) ** 2
	print(ans)


test = int(input())
while test > 0:
	n = int(input())
	s = 0
	while n >= 1:
		s += (n * 4 - 4) * (n // 2)
		n -= 2
	print(s)
	test -= 1


T = int(input())
while T > 0:
	n = int(input())
	res = 0
	side = 3
	for i in range(n // 2):
		ph = 4 * (side - 1)
		res += ph * (i + 1)
		side += 2
	print(res)
	T -= 1


for i in range(int(input())):
	n = int(input())
	k = 1
	p = 8
	s = 0
	if n == 1:
		print(0)
	else:
		for j in range(int(n / 2)):
			s = s + p * k
			p = p + 8
			k += 1
		print(s)


import random
import math
import sys
LI = lambda : list(map(int, input().split()))
MI = lambda : map(int, input().split())
yes = lambda : print('Yes')
no = lambda : print('No')
I = lambda : list(input())
J = lambda x: ''.join(x)
II = lambda : int(input())
SI = lambda : input()
t = II()
l = [0, 8]
for i in range(5, 5 * 10 ** 5, 2):
	l.append(l[-1] + i // 2 * (i * 4 - 4))
for q in range(t):
	n = II()
	print(l[n // 2])


t = int(input())
answers = []
for _ in range(t):
	n = int(input())
	answers.append(int(n * (n ** 2 - 1) / 3))
print(*answers, sep='\n')


z = input
from math import *
n1 = int(z())
for _ in range(n1):
	n = int(z())
	s = 0
	k = 0
	for i in range(1, n + 1, 2):
		s += k * ((i - 2) * 2 + i * 2)
		k += 1
	print(s)


def calc(n):
	return sum([8 * i * i for i in range((n + 1) // 2)])
cases = int(input().strip())
for _ in range(cases):
	n = int(input().strip())
	print(calc(n))


ans = [0] * 500042
for i in range(3, len(ans), 2):
	ans[i] = ans[i - 2] + (i * 4 - 4) * (i // 2)
for i in range(2, len(ans), 2):
	ans[i] = ans[i - 1] + i ** 2 - i // 2
T = int(input())
for _ in range(T):
	n = int(input())
	print(ans[n])


def solv(a):
	arr = [0] * (a + 1)
	for i in range(3, a + 1, 2):
		arr[i] = (4 * i - 4) * (i // 2) + arr[i - 2]
	return arr
arr = []
for _ in range(int(input())):
	arr.append(int(input()))
a = max(arr)
ans = solv(a)
for i in arr:
	print(ans[i])


def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def inmap():
	return map(int, input().split())
for t in range(inp()):
	n = inp()
	ans = 0
	for i in range(int((n - 1) / 2) + 1):
		ans += i * (8 * i)
	print(ans)


from sys import *
from collections import *
from math import *
input = stdin.readline
tc = int(input())
for tcase in range(tc):
	n = int(input())
	if n == 1:
		print(0)
		continue
	n *= n
	lo = 0
	hi = n
	id = -1
	while lo <= hi:
		mid = (lo + hi) // 2
		sum = mid * (mid + 1) // 2
		sum *= 8
		if sum == n - 1:
			id = mid
			break
		elif sum > n - 1:
			hi = mid - 1
		else:
			lo = mid + 1
	assert id != -1
	ans = id * (id + 1) * (2 * id + 1) // 6
	ans *= 8
	print(ans)


import sys, math, bisect
from collections import Counter, defaultdict as dd

def data():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(str(var))

def l():
	return list(sp())

def strl():
	return list(strsp())

def sp():
	return map(int, data().split())

def strsp():
	return map(str, data().split())
for _ in range(int(data())):
	n = int(data())
	if n == 1:
		print(0)
	else:
		a = []
		(b, c, i) = (8, 0, 1)
		d = n * n
		while 1:
			a.append((i, b))
			c += b
			i += 1
			b += 8
			if c == d - 1:
				break
		c = 0
		for i in range(len(a)):
			c += a[i][0] * a[i][1]
		print(c)


import math
for _ in range(int(input())):
	n = int(input())
	print((n ** 3 - n) // 3)


def solve(n):
	amount = 0
	cnt = 1
	for i in range(1, n - 1, 2):
		amount += i * cnt
		cnt += 1
	return amount * 4 + n // 2 * (n // 2 + 1) * 2
for j in range(int(input())):
	print(solve(int(input())))


t = int(input())
while t > 0:
	n = int(input())
	if n == 1:
		print(0)
	else:
		tot = 0
		for (i, j) in enumerate(range(3, n + 1, 2)):
			r = i + 1
			tot += (j + j + (j - 2) + (j - 2)) * r
		print(tot)
	t -= 1


import sys
from math import ceil, sqrt
read = sys.stdin.buffer.readline
mi = lambda : map(int, read().split())
li = lambda : list(mi())
cin = lambda : int(read())

def isp(n):
	i = 2
	while i * i <= n:
		if n % i == 0:
			return False
		i += 1
	return True
primes = []
for _ in range(cin()):
	n = cin()
	if n == 1:
		print(0)
	else:
		ans = 0
		d = n // 2
		for i in range(d):
			ans += (i + 1) * (2 * i + 1)
		ans *= 4
		tmp = 0
		for i in range(d):
			tmp += abs(i - d)
		print(ans + 4 * tmp)


from sys import stdin as lector
input = lector.readlines()
numeroLineasPorTest = 1
for i in range(1, numeroLineasPorTest * int(input[0]) + 1, numeroLineasPorTest):
	n = int(int(input[i]) / 2)
	suma = 0
	suman = 0
	for i in range(n + 1):
		suma += i * (i - 1) + i
	print(8 * suma)


t = int(input())
for i in range(t):
	n = int(input())
	a = int(n / 2) + 1
	b = 0
	b += a * (a - 1) / 2 * 8
	x = 2
	y = 8
	for j in range(a - 2):
		b += y * x
		x += 1
		y += 8
	print(int(b))


from math import ceil
from math import floor
from math import sqrt
from math import log
prime = pow(10, 9) + 7

def mod_expo(n, p, m):
	result = 1
	while p != 0:
		if p % 2 == 1:
			result = result * n % m
		p //= 2
		n = n * n % m
	return result

def find_sequences(n):
	result = []
	if n <= 3:
		return result
	while n > 5:
		result.append('24 * 1 = 24')
		result.append(str(n) + ' - ' + str(n - 1) + ' = 1')
		n -= 2
	result.reverse()
	if n == 4:
		result.insert(0, '1 + 2 = 3')
		result.insert(1, '3 + 3 = 6')
		result.insert(2, '4 * 6 = 24')
	elif n == 5:
		result.insert(0, '1 + 4 = 5')
		result.insert(1, '5 * 5 = 25')
		result.insert(2, '25 - 3 = 22')
		result.insert(3, '22 + 2 = 24')
	return result

def check(n, k):
	v = 0
	left = n
	while left > 0:
		current = min(left, k)
		v += current
		left -= current
		left -= left // 10
	return 2 * v >= n

def get_pair_count(n, arr):
	count = 0
	mp = {}
	for i in range(n):
		if arr[i] not in mp:
			mp[arr[i]] = 0
		mp[arr[i]] += 1
	for i in range(n):
		for deg in range(1, 31):
			val = pow(2, deg) - arr[i]
			if val in mp:
				count += mp[val]
				if val == arr[i]:
					count -= 1
		mp[arr[i]] -= 1
	return count

def find_bsearch(n):
	left = 1
	right = n
	middle = 0
	if n <= 2:
		return 1
	while left < right:
		middle = left + (right - left) // 2
		if check(n, middle):
			if middle == left or not check(n, middle - 1):
				return middle
			right = middle - 1
		else:
			left = middle + 1
	return left

def count_resistors(a, b):
	level = -1
	while b:
		(cont, a) = divmod(a, b)
		level += cont
		(a, b) = (b, a)
	if a == 1:
		return level + 1
	return -1

def get_moves_count(n):
	s = 0
	j = 1
	for i in range(3, n + 1, 2):
		s += 4 * (i - 1) * j
		j += 1
	return s

def find_min(N, d):
	N = str(N)
	d = str(d)
	for i in range(len(N) - 1, -1):
		print(N[i])
		if int(N[i]) > int(d):
			N = ''.join([N[j] for j in range(len(N)) and j != i])
			N += d
	return N
t = 1
t = int(input())
while t:
	t = t - 1
	count = 0
	n = int(input())
	print(get_moves_count(n))


def read_int():
	return int(input().strip())

def read_ints():
	return list(map(int, input().strip().split(' ')))

def solve():
	n = read_int()
	return (4 * 1 - 4 + 4 * n - 4) // 2 * (n - 1) // 2
A = [0]
for l in range(3, 500000, 2):
	A.append(A[-1] + (l ** 2 - (l - 2) ** 2) * (l - 1) // 2)
T = read_int()
for _ in range(T):
	n = read_int()
	print(A[(n - 1) // 2])


for _ in range(int(input())):
	n = int(input())
	a = [[0] * n] * n
	ans = 0
	up = 3
	side = 1
	for i in range(1, (n + 1) // 2):
		ans += i * up * 2 + i * side * 2
		up += 2
		side += 2
	print(ans)


for s in [*open(0)][1:]:
	n = int(s)
	print(n // 2 * (n // 2 + 1) * n // 3 * 4)


for i in range(int(input())):
	n = int(input())
	if n == 1:
		print('0')
	else:
		n = n // 2
		tot = 8 * n * (n + 1) * (2 * n + 1) // 6
		print(tot)


l = [0, 0, 0, 8, 0]
for i in range(5, 500000 + 1):
	if i % 2 != 0:
		tmp = l[i - 2]
		tmp += int((2 * i + 2 * (i - 2)) * ((i - 1) // 2))
		l.append(tmp)
	else:
		l.append(0)
for i in range(int(input())):
	n = int(input())
	print(l[n])


n = int(input())
a = []
for i in range(0, n):
	k = int(input())
	t = 0
	for j in range(1, k // 2 + 1):
		t += j * j * 8
	a.insert(i, t)
for i in range(0, n):
	print(a[i])


from sys import stdin

def iinput():
	return int(stdin.readline())

def sinput():
	return input()

def minput():
	return map(int, stdin.readline().split())

def linput():
	return list(map(int, stdin.readline().split()))
t = iinput()
while t:
	t -= 1
	n = iinput()
	ans = 0
	for i in range(1, n // 2 + 1):
		ans += 8 * i * i
	print(ans)


for s in [*open(0)][1::1]:
	x = int(s) // 2
	print(int(8 * x * (x + 1) * (2 * x + 1) / 6))


testcases = int(input())
for case in range(testcases):
	n = int(input())
	nd2 = int(n / 2)
	sumA = int(nd2 / 2 * (1 + nd2))
	x = 1
	y = 1
	for i in range(nd2):
		sumA += x * y
		x += 2
		y += 1
	print(4 * sumA)


from math import gcd, ceil
from collections import defaultdict as dd

def lcm(a, b):
	return a * b // gcd(a, b)

def inin():
	return int(input())

def inar():
	return list(map(int, input().split()))

def ar(element, size):
	return [element for i in range(size)]

def digitsum(num):
	su = 0
	while num:
		su += num % 10
		num //= 10
	return su

def pred(n, k, pointer):
	return pointer - k >= n

def yes():
	print('YES')

def no():
	print('NO')
Testcase = inin()
for _ in range(Testcase):
	n = inin()
	hogaya = 0
	num = 1
	dist = 0
	su = 0
	for i in range((n + 1) // 2):
		su += (num ** 2 - hogaya) * dist
		dist += 1
		hogaya = num ** 2
		num += 2
	print(su)


t = int(input())
for t1 in range(t):
	n = int(input())
	sum1 = 0
	while n >= 1:
		sum1 = sum1 + int(n / 2) * (2 * n + 2 * (n - 2))
		n = n - 2
	print(sum1)


import sys
sys.setrecursionlimit(10 ** 8)
try:
	FILE_POINTER = open('input.inpt')
	input = FILE_POINTER.readline
except:
	FILE_POINTER = None
	input = sys.stdin.readline
t = int(input())
nums = 8
step = 1
for _ in range(t):
	n = int(input())
	prev = 0
	nums = 8
	step = 1
	for i in range(2, n + 1):
		if i % 2:
			prev += nums * step
			step += 1
			nums = 8 * step
	print(prev)
if FILE_POINTER:
	FILE_POINTER.close()


c = int(input())
for z in range(c):
	l = int(input())
	ans = 0
	while l >= 1:
		x = l * 4 - 4
		a = x / 8
		ans = ans + x * a
		l -= 2
	print(int(ans))


inp = lambda : map(int, input().split())
t = int(input())
for _ in range(t):
	n = int(input())
	count = 0
	remain = 0
	(i, j) = (1, 1)
	while i < n:
		if i == 1:
			count += pow(2, i + 2) * j
			j += 1
			i += 2
		if i < n:
			remain = pow(i + 2, 2) - pow(i, 2)
			count += remain * j
			j += 1
			if i == n - 2:
				break
			remain = pow(i + 4, 2) - pow(i + 2, 2)
			count += remain * j
			j += 1
			if i == n - 4:
				break
			remain = pow(i + 6, 2) - pow(i + 4, 2)
			count += remain * j
			j += 1
			if i == n - 6:
				break
			remain = pow(i + 8, 2) - pow(i + 6, 2)
			count += remain * j
			j += 1
			if i == n - 8:
				break
			remain = pow(i + 10, 2) - pow(i + 8, 2)
			count += remain * j
			j += 1
			i += 10
	print(count)


T = int(input())
for t in range(T):
	n = int(input())
	sol = 0
	for i in range(3, n + 1, 2):
		sol += (i - 1) ** 2 * 2
	print(sol)


from sys import stdin, stdout
from itertools import combinations
from collections import defaultdict, Counter
import math

def listIn():
	return list(map(int, stdin.readline().strip().split()))

def stringListIn():
	return [x for x in stdin.readline().split()]

def intIn():
	return int(stdin.readline())

def stringIn():
	return stdin.readline().strip()
Max = 5 * 10 ** 5 + 1
f = [0] * Max
f[1] = 0
for i in range(3, Max, 2):
	curr = i * 2 + (i - 2) * 2
	moves = i // 2
	curr *= moves
	f[i] = f[i - 2] + curr
t = intIn()
while t > 0:
	t -= 1
	n = intIn()
	print(f[n])


_IS_DEBUG_MODE = False

def Problem():
	if _IS_DEBUG_MODE == True:
		testcaseList = []
		testcaseList.append(1)
		testcaseList.append(3)
		testcaseList.append(5)
		testcaseList.append(7)
		testcaseList.append(499993)
	else:
		t = int(input())
		testcaseList = []
		for testcaseIndex in range(t):
			n = int(input())
			testcaseList.append(n)
	return testcaseList

def Solver(testcaseList):
	for n in testcaseList:
		if _IS_DEBUG_MODE == True:
			print('testcase', n)
		moveNum = 0
		totalMoveNum = 0
		boardNum = 0
		totalBoardNum = 0
		for i in range(1, n + 1, 2):
			boardNum = i ** 2 - totalBoardNum
			totalMoveNum += boardNum * moveNum
			totalBoardNum += boardNum
			moveNum += 1
		print(totalMoveNum)
if _IS_DEBUG_MODE == True:
	import time
	startTime = time.time()
testcaseList = Problem()
Solver(testcaseList)
if _IS_DEBUG_MODE == True:
	endTime = time.time()
	print('time', endTime - startTime)


def su(m):
	s = 0
	for i in range(1, (m + 1) // 2):
		s += i ** 2 * 8
	return s
t = int(input())
while t > 0:
	t -= 1
	m = int(input())
	print(su(m))


cases = int(input())
for t in range(cases):
	n = int(input())
	s = 0
	k = n
	v = n // 2
	for i in range(n // 2):
		s += v * (k - 1) * 4
		k -= 2
		v -= 1
	print(s)


t = int(input())
for ts in range(t):
	n = int(input())
	summ = 0
	m = n
	for i in range(1, n + 1, 2):
		summ = summ + i * (2 * (m + m - 2))
		m = m - 2
	print(summ)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		s = 0
		c = n // 2
		while c > 0 and n > 0:
			count = 2 * n + 2 * (n - 2)
			n -= 2
			s += count * c
			c -= 1
		print(s)


for t in range(int(input())):
	n = int(input())
	m = 0
	for d in range(n // 2):
		m += (d + 1) ** 2 * 8
	print(m)


t = int(input())
for z in range(t):
	n = int(int(input()) / 2)
	steps = int(8 * (n * (n + 1) * (2 * n + 1) / 6))
	print(steps)


t = int(input())
for i in range(t):
	result = 0
	board_size = 0
	n = int(input())
	for j in range(1, n + 1, 2):
		result += (j * 4 - 4) * board_size
		board_size += 1
	print(result)


t = int(input())
for _ in range(t):
	n = int(input())
	c = 0
	k = 1
	for i in range(3, n + 1, 2):
		c = c + 8 * k * k
		k = k + 1
	if n == 1:
		print(0)
	else:
		print(c)


import sys
import bisect
import heapq
from math import *
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
mod = pow(10, 9) + 7

def inp():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def graph(vertex):
	return [[] for i in range(0, vertex + 1)]

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def lcm(a, b):
	return a * b // gcd(a, b)

def solve():
	n = int(inp())
	s = 0
	k = 3
	for i in range(1, n):
		s += i * (2 * k + 2 * (k - 2))
		k += 2
		if k > n:
			break
	out(s)
	nextline()
testcase(int(inp()))


def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		so_far = total = 0
		for i in range(n // 2 + 1):
			square = (2 * i + 1) ** 2
			perim = square - so_far
			total += perim * i
			so_far = square
		print(total)
main()


i = int(input())
lista = []
for x in range(0, i):
	num = int(input())
	p = int((num - 1) / 2)
	aux = 1
	res = 0
	for y in range(0, p + 1):
		res += (4 * aux - 4) * y
		aux += 2
	lista.append(res)
for x in lista:
	print(x)


for _ in range(int(input())):
	n = int(input())
	m = n // 2
	ans = 0
	count = 1
	while m > 0:
		ans += count * 8 * count
		count += 1
		m -= 1
	print(ans)


T = int(input())
for _ in range(T):
	n = int(input())
	total = 0
	if n == 1:
		print('0')
	else:
		for i in range(1, int(n / 2) + 1):
			total += i * ((2 * i + 1) ** 2 - (2 * i - 1) ** 2)
		print(total)


from sys import stdin, setrecursionlimit, stdout
from collections import deque
from math import sqrt, floor, ceil, log, log2, log10, pi, gcd, sin, cos, asin

def ii():
	return int(stdin.readline())

def fi():
	return float(stdin.readline())

def mi():
	return map(int, stdin.readline().split())

def fmi():
	return map(float, stdin.readline().split())

def li():
	return list(mi())

def lsi():
	x = list(stdin.readline())
	x.pop()
	return x

def si():
	return stdin.readline().rstrip()
res = ['YES', 'NO']
a = [0]
x = 8
j = 1
cur = 0
for _ in range(250002):
	cur += x * j
	a.append(cur)
	x += 8
	j += 1
test_case = ii()
while test_case:
	test_case -= 1
	n = ii()
	print(a[n // 2])


import math
for _ in range(int(input())):
	n = int(input())
	k = math.floor(n / 2)
	p = k
	sum = 0
	f = 0
	while n >= 1:
		number_cells = 2 * n + 2 * (n - 2)
		sum += number_cells * p
		n = n - 2
		p = p - 1
	print(sum)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		s = 0
		row = 0
		for i in range(1, n + 1, 2):
			x = 4 * (i - 1)
			s += row * x
			row += 1
		print(s)


from sys import stdin, stdout
ans = [8]
for i in range(5, 500000):
	if i % 2 == 1:
		ans.append(ans[-1] + (12 * (i // 2) + 4 * ((i - 4) * (i // 2))))
for test in range(int(stdin.readline())):
	n = int(stdin.readline())
	if n == 1:
		print(0)
	else:
		stdout.write(str(ans[n // 2 - 1]) + '\n')


def scacchiera(n):
	v = []
	somma_mosse = 0
	for i in range(n):
		if i % 2 != 0:
			v.append(i)
	v.append(n)
	for i in range(1, len(v), 1):
		somma_mosse = somma_mosse + i * (v[i] * v[i] - v[i - 1] * v[i - 1])
	print(somma_mosse)
T = int(input())
for k in range(T):
	n = int(input())
	scacchiera(n)


import sys
t = int(sys.stdin.readline())
for _ in range(t):
	n = int(sys.stdin.readline())
	S = 0
	for i in range(3, n + 1, 2):
		S += (i - 1) * 4 * (i // 2)
	print(S)


for s in [*open(0)][1:]:
	n = int(s)
	print(sum((2 * i * i for i in range(0, n, 2))))


import sys
import math
from collections import defaultdict
mod = 1000000007
T = 1
T = int(sys.stdin.readline())
for _ in range(T):
	n = int(input())
	a = 0
	nn = n >> 1
	for i in range(1, nn + 1):
		a += i * (8 * i)
	print(a)


import math
t = int(input())
for x in range(t):
	ans = 0
	n = int(input())
	if n == 1:
		print(0)
	else:
		n = math.ceil(n / 2)
		for i in range(1, n):
			ans = ans + 8 * i * i
		print(ans)


n1 = int(input(''))
no = 0
while no < n1:
	n = int(input(''))
	c = n / 2
	c = int(c)
	s1 = 0
	s2 = 0
	for i in range(c):
		s1 = s1 + 4 * (c - i)
	s1 = s1 * 2
	for i in range(c - 1):
		s2 = s2 + 8 * (c - 1 - i) * (c - i)
	s1 = s1 + s2
	print(s1)
	no += 1


test = int(input())
while test > 0:
	inn = int(input())
	n = int(inn / 2)
	ans = 4 * n * (n + 1) * (2 * n + 1)
	ans = ans / 3
	print(int(ans))
	test = test - 1


z = int(input())
for i in range(z):
	n = int(input())

	def board(n):
		if n <= 1:
			return 0
		sums = 0
		for i in range(1, n // 2 + 1):
			sums += 8 * i * i
		return sums
	print(board(n))


I = lambda : list(map(int, input().split()))
t = I()[0]
while t:
	t -= 1
	n = I()[0]
	n **= 2
	n -= 1
	i = 1
	ans = 0
	while n > 0:
		a = min(8 * i, n)
		ans += a * i
		n -= a
		i += 1
	print(ans)


from collections import deque
from collections import OrderedDict
import math
import sys
import os
from io import BytesIO
import threading
import bisect
import heapq
input = sys.stdin.readline
for t in range(int(input())):
	n = int(input())
	answer = 0
	s = 1
	for i in range(3, n + 1, 2):
		answer += (i * 2 + (i - 2) * 2) * s
		s += 1
	print(answer)


lis = [0, 0]
for i in range(2, 5 * 10 ** 5):
	if i % 2 == 0:
		lis.append(lis[-1])
	else:
		lis.append(2 * (i - 1) ** 2 + lis[i - 2])
t = int(input())
for tt in range(t):
	n = int(input())
	print(lis[n])


import math

def ri():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def inp():
	return int(input())

def si():
	return input()

def pYes():
	print('YES')

def pNo():
	print('NO')

def plist(l):
	print(''.join(l))
t = int(input())
for i in range(t):
	n = int(input())
	ans = 0
	t = 1
	for k in range(3, n + 1, 2):
		ans += (2 * k + (k - 2) * 2) * t
		t = t + 1
	print(ans)


for _ in range(int(input())):
	n = int(input())
	n = n ** 2
	i = 1
	steps = 0
	x = 0
	while x < n - 1:
		b = i * 8
		steps += b * i
		x += b
		i += 1
	print(steps)


def boardmoves(n):
	start = n // 2
	count = 0
	while n != 1:
		count += (n - 1) * 4 * start
		start -= 1
		n -= 2
	return count
test = int(input())
for i in range(test):
	n = int(input())
	print(boardmoves(n))


z = input
from math import *
n1 = int(z())
for _ in range(n1):
	n = int(z())
	n = n // 2
	s = int(n * (n + 1) * (2 * n + 1) // 6)
	print(s * 8)


t = int(input())
for _ in range(t):
	n = int(input())
	mid = n // 2
	x = n
	ans = 0
	for i in range(mid):
		ans += (mid - i) * (x + 2 * (x - 1) + x - 2)
		x -= 2
	print(ans)


t = int(input())
for val in range(t):
	n = int(input())
	sum1 = sum2 = 0
	while n != 1:
		sum1 += 4 * n - 4
		sum2 += sum1
		n -= 2
	print(sum2)


for _ in range(int(input())):
	n = int(input())
	ans = 0
	if n == 1:
		print(0)
		continue
	for i in range(3, n + 1, 2):
		j = i // 2
		ans += j * (2 * i + 2 * (i - 2))
	print(ans)


import math
for ttt in range(int(input())):
	n = int(input())
	if n % 2 == 1:
		z = n // 2 + 1
		s = 0
		jj = n - z
		i = n
		while jj > 0:
			s += (2 * i + 2 * (i - 2)) * jj
			jj -= 1
			i -= 2
		print(s)


from sys import stdin, stdout
for query in range(int(stdin.readline())):
	n = int(stdin.readline())
	total = 0
	for x in range(1, (n - 1) // 2 + 1):
		total += 8 * x ** 2
	stdout.write(str(total) + '\n')


import unittest
from functools import lru_cache
s = None

def board_moves(n):
	global s
	if not s:
		s = {1: 0}
		for i in range(3, 6 * 10 ** 5, 2):
			s[i] = s[i - 2] + len(range(i - 2, 0, -2)) * (i ** 2 - (i - 2) ** 2)
	return s[n]

class BoardMovesTest(unittest.TestCase):

	def test_GivenTests(self):
		self.assertEqual(board_moves(1), 0)
		self.assertEqual(board_moves(5), 40)
		self.assertEqual(board_moves(499993), 41664916690999888)

	def test_SmallNumbers(self):
		self.assertEqual(board_moves(3), 8)
		self.assertEqual(board_moves(7), 40 + 24 * 3)

	def test_BigNumberJustToTestBigCase(self):
		self.assertTrue(board_moves(500001) > 41664916690999888)
t = int(input())
for _ in range(t):
	print(board_moves(int(input())))


x = int(input())
while x:
	n = int(input())
	sum = 8
	if n == 1:
		print(0)
	else:
		while n > 3:
			sum += (n * 4 - 4) * (n // 2)
			n -= 2
		print(sum)
	x -= 1


from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush, heappop
import math
from collections import *
from functools import reduce, cmp_to_key, lru_cache
import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
M = mod = 10 ** 9 + 7

def factors(n):
	return sorted(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def inv_mod(n):
	return pow(n, mod - 2, mod)

def li():
	return [int(i) for i in input().rstrip().split()]

def st():
	return str(input().rstrip())[2:-1]

def val():
	return int(input().rstrip())

def li2():
	return [str(i)[2:-1] for i in input().rstrip().split()]

def li3():
	return [int(str(i)[2:-1]) for i in input().rstrip()]
for _ in range(val()):
	n = val()
	ans = 0
	start = 1
	time = 1
	for i in range(n // 2):
		start = 2 * i + 1
		ans += (start * 4 + 4) * time
		time += 1
	print(ans)


def solve(n):
	s = 0
	k = n // 2
	v = 1
	for i in range(k, 0, -1):
		s += 4 * (n - v) * i
		v += 2
	return s
t = int(input())
for _ in range(t):
	n = int(input())
	res = solve(n)
	print(res)


from sys import stdin, stdout
import math
n = int(stdin.readline())
for i in range(n):
	x = int(stdin.readline())
	levels = int(x / 2)
	ans = 0
	for i in range(1, levels + 1):
		ans += ((2 * i + 1) * 2 + 2 * (2 * i - 1)) * i
	stdout.write(str(ans) + '\n')


from sys import stdin, stdout

def find(N):
	K = N // 2
	r = 0
	for i in range(1, K + 1):
		r += i * (2 * (i - 1) + 1) + i
	return r * 4

def main():
	for _ in range(int(stdin.readline())):
		N = int(stdin.readline())
		print(find(N))
main()


from collections import *
from bisect import *
from math import *
import sys
input = sys.stdin.readline
t = int(input())
while t:
	t -= 1
	n = int(input())
	if n == 1:
		print(0)
	else:
		s = 0
		for i in range(n, 0, -2):
			q = i // 2
			s1 = 2 * i + 2 * (i - 2)
			s += q * s1
		print(s)


t = int(input())
for _ in range(t):
	n = int(input())
	res = 0
	mid = n // 2
	for i in range(n - 1, 0, -2):
		res += i * 4 * mid
		mid -= 1
	print(res)


try:
	t = int(input())
	for i in range(t):
		n = int(input())
		if n == 1:
			print(0)
		else:
			x = n // 2
			ans = 0
			for i in range(x):
				ans = ans + 8 * (i + 1) * (i + 1)
			print(ans)
except EOFError:
	pass


dp = [0] * 500001
ans = [0] * 500001
dp[3] = 8
ans[3] = 8
c = 4
k = 2
for i in range(5, 500000, 2):
	dp[i] = dp[i - 2] + 8
	ans[i] = ans[i - 2] + dp[i] * k
	k += 1
for _ in range(int(input())):
	n = int(input())
	print(ans[n])


import sys
input = lambda : sys.stdin.readline().rstrip()
arr = [0]
for i in range(1, 10 ** 6):
	arr.append(8 * i * i + arr[i - 1])
for _ in range(int(input())):
	n = int(input())
	print(arr[n // 2])


K = 500001
arr = [0] * K
arr[3] = 8
j = 2
for i in range(5, K, 2):
	arr[i] = 2 * (2 * i - 2) * j + arr[i - 2]
	j += 1
for _ in range(int(input())):
	n = int(input())
	print(arr[n])


t = int(input())
for i in range(t):
	n = int(input())
	ans = 0
	ch = 8
	x = (n - 1) // 2
	for j in range(x):
		ans += (j + 1) * ch
		ch += 8
	print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	E = 0
	for j in range((n + 1) // 2):
		E += j * 2 * (2 * j - 1 + (2 * j + 1))
	print(E)


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(0)
	else:
		count = 0
		start = 1
		for i in range(3, n + 1, 2):
			if i == 3:
				count += 8
			else:
				temp = (i + i - 2) * (i - (i - 2))
				count += temp * start
			start += 1
		print(count)


t = int(input())
for x in range(t):
	n = int(input())
	req = n * n - 1
	i = 1
	ans = 0
	if req <= 8:
		print(req)
	else:
		while req > 0:
			ans += i * i * 8
			req -= i * 8
			i += 1
		print(ans)


d = input()
for j in range(int(d)):
	ans = 0
	tag = 1
	c = input()
	q = int(c) - (int(c) + 1) // 2
	for i in range(q + 1):
		ans += (tag * tag - (tag - 2) * (tag - 2)) * i
		tag += 2
	print(ans)


import sys
input = sys.stdin.readline

def readstr():
	return input().strip()

def readint():
	return int(input())

def readnums():
	return map(int, input().split())

def readstrs():
	return input().split()

def main():
	t = readint()
	nl = [readint() for _ in range(t)]
	for n in nl:
		n = (n - 1) // 2
		print(4 * n * (n + 1) * (2 * n + 1) // 3)
main()


for t in range(int(input())):
	n = int(input())
	ans = 0
	for x in range(1, (n + 1) // 2):
		ans += x ** 2
	print(ans * 8)


for x in range(int(input())):
	i = int(input())
	print((i ** 3 - i) // 3)


for _ in range(int(input())):
	n = int(input())
	ans = 0
	n1 = n // 2
	ans += 4 * (n1 * (n1 + 1))
	ans1 = 0
	while n1 > 0:
		ans1 += (n1 - 1) * n1
		n1 -= 1
	print(ans + ans1 * 8)


def solve(k):
	res = 0
	for i in range((k + 1) // 2):
		res += 4 * 2 * i ** 2
	return res
strr = input()
for _ in range(int(strr)):
	k = int(input())
	print(solve(k))


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def intArr():
	return map(int, input().split())

def In():
	return int(input())

def main():
	for _ in range(In()):
		n = In()
		k = n // 2
		print(k * (k + 1) * (2 * k + 1) // 6 << 3)
	return
main()


import math
r1 = lambda : int(input())
rm = lambda : map(int, input().split())
rls = lambda : list(rm())
test = r1()
while test:
	test -= 1
	n = r1()
	ans = 0
	x = 0
	for i in range(n // 2):
		x += 8
		ans += (i + 1) * x
	print(ans)


tests = int(input())
for _ in range(tests):
	n = int(input())
	result = 0
	while n >= 3:
		result += (n ** 2 - (n - 2) ** 2) * ((n - 1) // 2)
		n -= 2
	print(result)


from sys import stdin
inp = stdin.readline
t = int(inp().strip())
while t:
	t -= 1
	n = int(inp().strip())
	if n == 1:
		print(0)
		continue
	moves = 8
	i = 2
	for j in range(5, n + 1, 2):
		moves += i * (4 * j - 4)
		i += 1
	print(moves)


import math
for i in range(int(input())):
	n = int(input())
	l = (n + 1) // 2
	m = 0
	x = 3
	for i in range(1, l + 1):
		x = 2 * i - 1
		if i == 1:
			m += x + x + x - 2 + x - 2
		else:
			m += (x + x + x - 2 + x - 2) * (i - 1)
		x += 1
	print(m)


t = int(input())
arr = [0] * 250001
idx = 1
for i in range(1, 500000, 2):
	arr[idx] = pow(idx, 2) * 8 + arr[idx - 1]
	idx += 1
for _ in range(t):
	n = int(input())
	print(arr[n // 2])


t = int(input())
ans = []
for i in range(t):
	n = int(input())
	k = n // 2
	ans.append(4 * k * (k + 1) * (2 * k + 1) // 3)
for i in range(t):
	print(ans[i])


s = [0 for i in range(1000000)]
for i in range(1, 1000000):
	s[i] = s[i - 1] + i
t = int(input())
for i in range(t):
	n = int(input())
	m = n // 2
	su = 4 * s[m]
	for j in range(1, m):
		su += 8 * (s[j] + s[m - j])
	su += 4 * s[m]
	print(su)


for _ in range(int(input())):
	n = int(input())
	sum = n * (n + 1) * (n - 1) / 3
	print(int(sum))


t = int(input())
ans = [0, 0]
for i in range(3, int(600000.0), 2):
	ans.append(0)
	ans.append(ans[i - 2] + (i ** 2 - (i - 2) ** 2) * (i // 2))
for test in range(t):
	n = int(input())
	print(ans[n])


def main():
	T = int(input())
	for _ in range(1, T + 1):
		n = int(input())
		it_nb = n // 2
		a = 8
		result = 0
		for j in range(1, it_nb + 1):
			result += a * j
			a += 8
		print(result)
main()


a = int(input())
for i in range(0, a):
	b = int(input())
	if b == 1:
		print(0)
	else:
		k = (b - 1) // 2
		ans = (b + 1) // 2 * b ** 2 - (k + 1) * (2 * k + 1) * (2 * k + 3) // 3
		print(ans)


from sys import stdin
input = lambda : stdin.readline().strip()
from math import ceil, sqrt, factorial, gcd
from collections import deque
for _ in range(int(input())):
	n = int(input())
	ans = 0
	f = 1
	t = 0
	level = 0
	for i in range(1, n + 1, 2):
		f = i * i
		f -= t
		ans += level * f
		t += f
		level += 1
	print(ans)


t = int(input())
i = 0
while i < t:
	i += 1
	n = int(input())
	j = 0
	total = 0
	while 2 * j + 1 <= n:
		total += ((2 * j + 1) ** 2 - (2 * j - 1) ** 2) * j
		j += 1
	print(total)


t = int(input())
for k in range(t):
	n = int(input())
	s = 0
	i = n
	j = n // 2
	while i > 0:
		s = s + (4 * i - 4) * j
		i = i - 2
		j = j - 1
	print(s)


import collections
import operator
for _ in range(int(input())):
	n = int(input())
	sm = 0
	n = (n - 1) // 2
	sm = 8 * (n * (n + 1) * (2 * n + 1)) // 6
	print(sm)


t = int(input())
for i in range(t):
	n = int(input())
	count = 0
	if n == 1:
		count = 0
	else:
		layer = n // 2
		for j in range(1, layer + 1):
			count += 8 * j * j
	print(count)


for j in range(int(input())):
	a = int(input())
	s = 0
	cont = 0
	for i in range(1, a + 1, 2):
		s += (i * i - (i - 2) * (i - 2)) * cont
		cont += 1
	print(s)


t = int(input())
while t:
	n = int(input())
	d = n // 2
	sum = 0
	for j in range(1, d + 1):
		sum = sum + 8 * j * j
	print(sum)
	t -= 1


for _ in range(int(input())):
	n = int(input())
	ss = n * (n + 1) * (2 * n + 1) // 6
	s = n * (n + 1) // 2
	print(ss - s)


for _ in range(int(input())):
	n = int(input())
	ans = 0
	pos = n // 2 + 1
	j = n
	for i in range(n, n // 2 + 1, -1):
		ans += (4 * j - 4) * (i - pos)
		j -= 2
	print(ans)


for t in range(int(input())):
	k = int(input())
	s = 0
	for i in range(3, k + 1, 2):
		s = s + i // 2 * (i // 2) * 8
	print(s)


def BoardMoves(n):
	moves = 0
	tablero = 8
	for i in range(1, int(n / 2) + 1):
		moves += tablero * i
		tablero += 8
	return moves
Lista = []
total = int(input())
for i in range(total):
	Lista.append(int(input()))
for j in Lista:
	print(BoardMoves(j))


def solve():
	n = int(input())
	if n == 1:
		return 0
	else:
		ans = 0
		p = n // 2
		ans = 8 * p * (2 * p + 1) * (p + 1) // 6
		return ans
for _ in range(int(input())):
	ans = solve()
	print(ans)


import sys
t = int(sys.stdin.readline())
for _ in range(t):
	n = int(sys.stdin.readline())
	m = [0]
	for i in range(n // 2):
		m.append(8 * (i + 1))
	s = 0
	for i in range(n // 2 + 1):
		s += m[i] * i
	print(s)


def main():
	for _ in range(int(input())):
		n = int(input())
		c = 0
		sm = 0
		for j in range(1, n + 1, 2):
			sm += (j - 1) * 4 * c
			c += 1
		print(sm)
main()


t = int(input())
sum = []
for i in range(t):
	n = int(input())
	SUM = 0
	for i in range(0, n - 3, 2):
		SUM += 8 * ((n - i) // 2) ** 2
	if n >= 3:
		SUM += 3 ** 2 - 1
	sum.append(SUM)
for i in range(t):
	print(sum[i])


t = int(input())
ans = ''
for j in range(t):
	n = int(input())
	k = (n - 1) // 2
	t = 4 * k * (k + 1) * (2 * k + 1) // 3
	ans += str(t) + '\n'
print(ans)


for _ in range(int(input())):
	n = int(input())
	s = 0
	t = 0
	if n < 3:
		print(0)
	else:
		x = 1
		for i in range(3, n + 1, 2):
			s += 8
			t += s * x
			x += 1
		print(t)


from math import *
from collections import *
from itertools import *
from bisect import *
from operator import *
import sys

def io():
	return map(int, input().split())

def op():
	return list(map(int, input().split()))

def o():
	return int(input())

def kl(con, x=0):
	if x == 0:
		print('Yes') if con else print('No')
	elif x == 1:
		print('yes') if con else print('no')
	elif x == 2:
		print('YES') if con else print('NO')
p = input
for _ in range(o()):
	ans = 0
	n = o()
	c = 3
	z = 1
	for i in range(n // 2):
		ans += (c * 4 - 4) * z
		c += 2
		z += 1
	print(ans)


t = int(input())
while t > 0:
	n = int(input())
	tem = 0
	sum1 = 0
	i = 1
	while i <= n:
		sum1 += (i + 2 * (i - 1) + (i - 2)) * tem
		tem += 1
		i += 2
	print(sum1)
	t -= 1


for case in range(int(input())):
	count = 0
	value = 0
	n = int(input())
	for i in range(n // 2 + 1):
		count += 1
		value += ((i * 2 + 1) * 4 - 4) * (count - 1)
	print(value)


import math
from collections import Counter
from math import factorial as fact

def inpint():
	return int(input())

def inpstr():
	return str(input())

def inparr():
	return list(map(int, input().strip().split()))

def inptup():
	return map(int, input().strip().split())
for _ in range(int(input())):
	n = inpint()
	ans = 0
	for i in range((n - 1) // 2):
		ans += ((2 * i + 1) * 4 + 4) * (i + 1)
	print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	result = 0
	n_c = 3
	for j in range(1, int(n / 2) + 1):
		result += (2 * n_c + 2 * (n_c - 2)) * j
		n_c += 2
	print(result)


def f(n):
	k = n - 1
	return int(k * (k + 1) * (2 * k + 1) / 3 + (k * k + k) / 2)

def solve():
	n = int(input())
	k = int((n + 1) / 2)
	print(4 * f(k) - 2 * (k - 1) * k)
t = int(input())
for tt in range(0, t):
	solve()


def main():
	t = int(input())
	while t:
		t -= 1
		n = int(input())
		res = 0
		for i in range(1, n + 1, 2):
			res += (i - 1) * (i - 1) * 2
		print(res)
main()


T = int(input())
n = [0] * T
m = [0] * T
a = [0] * T
b = [0] * T
for t in range(T):
	n = int(input())
	c = 8
	a = 0
	for i in range(int(n / 2)):
		a += c * (i + 1)
		c += 8
	print(a)


t = int(input())
while t:
	n = int(input())
	i = 1
	ans = 0
	while i <= n:
		ans = ans + 2 * (i - 1) * (i - 1)
		i = i + 2
	print(ans)
	t = t - 1


for _ in range(int(input(''))):
	n = int(input(''))
	ans = 0
	cell = n // 2
	inc = 0
	for i in range(cell):
		ans += (-i + cell) * n * 2
		ans += 2 * inc
		inc = (i + 1) * (i + 2)
	ans += cell * (cell + 1)
	print(ans)


for t in range(int(input())):
	n = int(input())
	if n == 3:
		print(8)
	elif n == 1:
		print(0)
	else:
		f = (n - 3) // 2
		g = 3
		y = 1
		s = 0
		for i in range(f, 0, -1):
			d = g * 4 + y * (2 * i - 1) * 4
			s = s + d
			h = g
			p = y
			g = g + 2 * y + 3
			y = y + 1
		a = h * 4 + p * 4
		s = s + a + 8
		print(s)


test_cases = int(input())
while test_cases > 0:
	num = int(input())
	toPrint = 0
	multiplier = 8
	increase = 1
	while num > 1:
		toPrint += multiplier * increase
		multiplier += 8
		increase += 1
		num -= 2
	print(toPrint)
	test_cases -= 1


from sys import stdin
input = stdin.readline

def main():
	test = int(input())
	for t in range(test):
		n = int(input())
		s = 1 + (n - 3) // 2
		val = 0
		for i in range(s + 1):
			val += 8 * i * i
		print(val)
main()


t = int(input())
for _ in range(t):
	n = int(input())
	total = 0
	i = 1
	if n == 1:
		print(0)
	else:
		while i < n:
			total += i ** 2
			i += 2
		print(n // 2 * n ** 2 - total)


def solve(n):
	ans = 0
	tem = n
	for i in range(n // 2):
		k = tem // 2
		l = 4 * tem - 4
		ans += k * l
		tem -= 2
	print(ans)
t = int(input())
for _ in range(t):
	n = int(input())
	solve(n)


arr = [0]
for i in range(1, 10 ** 6):
	arr.append(8 * i * i + arr[i - 1])
for _ in range(int(input())):
	print(arr[int(input()) // 2])


def main():

	def f(m):
		m = 2 * m + 1
		return 4 * m - 4
	n = int(input())
	ans = 0
	for i in range(1, n // 2 + 1):
		ans += i * f(i)
	return ans
t = int(input())
while t > 0:
	t -= 1
	print(main())


def gt(n):
	s = 0
	while n > 1:
		x = n // 2
		s += (2 * n - 2) * 2 * x
		n -= 2
	return s
for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	elif n == 3:
		print(8)
	else:
		print(gt(n))


T = int(input())
for i in range(T):
	n = int(input())
	count = 0
	mid = (n + 1) // 2
	for i in range(1, mid):
		count += i * i * 8
	print(count)


def solution(n):
	m = (n - 1) // 2
	res = 4 * (m * (2 * m + 1) * (m + 1)) / 3
	return int(res)
for _ in range(int(input())):
	n = int(input())
	print(solution(n))


test = int(input())
for _ in range(test):
	n = int(input())
	n = int((n + 2) / 2)
	ans = 0
	for i in range(n):
		ans += 8 * i * i
	print(ans)


t = int(input())
arr = [0]
for i in range(3, 500000, 2):
	arr.append(arr[i // 2 - 1] + i // 2 * (i // 2) * 8)
for _ in range(0, t):
	n = int(input())
	print(arr[n // 2])


def main():
	arr = [0] * 500006
	for i in range(1, 500010 // 2):
		arr[i] = arr[i - 1] + 8 * i * i
	for _ in range(int(input())):
		N = int(input())
		print(arr[N // 2])
main()


import math
for _ in range(int(input())):
	n = int(input())
	a = math.ceil(n / 2)
	if n == 1:
		print(0)
		continue
	dp = [0 for i in range(n)]
	dp[0] = 0
	d = 1
	p = 2
	s = 1
	for i in range(1, int(a)):
		dp[i] = (2 * (i + p) + 2 * s) * d + dp[i - 1]
		d += 1
		p += 1
		s += 2
	print(dp[int(a) - 1])


t = int(input())
for i in range(t):
	n = int(input())
	sum = 0
	end = int((n + 1) / 2)
	for j in range(1, end):
		sum += (n * 4 - 4) * (end - j)
		n -= 2
	print(sum)


t = int(input().strip())
for i in range(t):
	n = int(input().strip())
	sumi = 0
	for j in range(n - 2, 0, -2):
		k = (j + 1) / 2
		sumi += j * k * 4 + k * 4
	print(int(sumi))


t = int(input())
for i in range(t):
	n = int(input())
	solve_pos = int(n / 2)
	moves = 0
	cost = 1
	for i in range(1, solve_pos + 1):
		moves += 8 * i * cost
		cost += 1
	print(moves)


import sys, bisect
from math import gcd
input = sys.stdin.readline

def inp():
	return int(input().rstrip())

def inlt():
	return list(map(int, input().rstrip().split()))

def insr():
	s = input().rstrip()
	return s[:len(s) - 1]

def invr():
	return map(int, input().rstrip().split())
t = inp()
dp = [0 for i in range(5 * 10 ** 5 + 1)]
s = 8
mul = 1
for i in range(3, 5 * 10 ** 5 + 1, 2):
	dp[i] = dp[i - 2] + mul * s
	s += 8
	mul += 1
for _ in range(t):
	n = inp()
	print(dp[n])


from sys import *
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	sn = 0
	i = 1
	while i <= n // 2:
		sn += i * (2 * i)
		i += 1
	ans = 4 * sn
	stdout.write(str(ans) + '\n')


import sys
from collections import defaultdict, deque
from math import sqrt, gcd, factorial

def input():
	return sys.stdin.readline()[:-1]

def solve():
	n = int(input()) + 1
	side = 1
	ans = 0
	for i in range(n // 2):
		x = i
		ans += (side - 1) * x * 4
		side += 2
	print(ans)
t = 1
t = int(input())
for case in range(1, t + 1):
	ans = solve()


for _ in range(int(input())):
	n = int(input())
	b = n // 2 * (n // 2 + 1) // 2 * 2
	d = b
	if n == 1:
		print(0)
	elif n == 3:
		print(8)
	else:
		n -= 1
		c = 1
		for i in range(1, n // 2 + 1):
			d += (b + c) * 2
			b += c
			c += 2
		print(d)


def solve():
	n = int(input())
	x = n // 2
	i = 1
	ans = 0
	while i <= x:
		ans += 8 * i * i
		i += 1
	print(ans)
try:
	for _ in range(int(input())):
		solve()
except:
	pass


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(0)
	else:
		k = 1
		y = (k + 2) * (k + 2) - k * k
		s = 0
		for j in range(1, int(n / 2) + 1):
			s += y * j
			k += 2
			y = (k + 2) * (k + 2) - k * k
		print(s)


import sys, heapq
input = sys.stdin.buffer.readline
T = int(input())
for _ in range(T):
	n = int(input())
	res = 0
	hen = 1
	task = 0
	while n >= hen:
		res += task * (hen - 1) * 4
		hen += 2
		task += 1
	print(res)


import sys
for _ in range(int(input())):
	n = int(input())
	print(n * (n - 1) * (n + 1) // 3)


import math
import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input()) // 2
	sum = n * (n + 1) * (2 * n + 1) // 6
	print(8 * sum)


def solve():
	n = int(input())
	n //= 2
	print(8 * n * (n + 1) * (2 * n + 1) // 6)
t = int(input())
for x in range(t):
	solve()


t = int(input())
for q in range(t):
	n = int(input())
	answ = 0
	if n != 1:
		for x in range(2, (n + 1) // 2 + 1):
			i = x * 2 - 1
			answ += (i ** 2 - (i - 2) ** 2) * (x - 1)
	print(answ)


a = int(input())
nn = list()
cnt = 0
p = 3
ss = list()
for _ in range(a):
	n = int(input())
	nn.append(n)
for i in range(a):
	if nn[i] == 1:
		ss.append(0)
		continue
	else:
		for j in range(3, nn[i] + 1, 2):
			if j == 3:
				cnt += 8
			else:
				cnt += (j - p) * (2 * j + 2 * (j - 2))
				p += 1
	ss.append(cnt)
	cnt = 0
	p = 3
print(*ss, sep='\n')


for i in range(int(input())):
	a = int(input())
	b = a // 2
	c = 0
	while b != 0:
		c += 2 * (b * a + b * (a - 2))
		a -= 2
		b -= 1
	print(c)


for _ in range(int(input())):
	N = int(input())
	pointx = (N + 1) // 2
	if N == 1:
		print(0)
	else:
		count = 8
		x = 1
		for i in range(2, pointx):
			x = 8 * i
			count += x * i
		print(count)


t = int(input())
while t:
	n = int(input())
	k = 0
	m = 0
	for i in range(n, 2, -2):
		k += i * 4 - 4
		m += k
	print(m)
	t = t - 1


t = int(input())
for i in range(t):
	n = int(input())
	i = 1
	sum1 = 1
	arr = []
	while sum1 < pow(n, 2):
		sum1 += 8 * i
		arr.append(8 * i)
		i += 1
	sum2 = 0
	for i in range(len(arr)):
		sum2 += arr[i] * (i + 1)
	print(sum2)


t = int(input())

def total_moves(n):
	total = 0
	if n == 1:
		return 0
	else:
		for i in range(1, n // 2 + 1):
			total += i * (4 * (2 * i + 1) - 4)
	return total
for i in range(t):
	n = int(input())
	print(total_moves(n))


for _ in range(int(input())):
	n = int(input())
	(mr, mc) = (n // 2, n // 2)
	ans = 0
	ls = 0
	prev = 0
	for i in range(n // 2):
		val = abs(i - mr)
		prev += val
		ans += val * (mc - i - 1) + prev
	ans *= 4
	for v in range(n):
		ans += abs(v - mr) * 2
	print(ans)


from math import floor
t = int(input())
for _ in range(t):
	n = int(input())
	lim = floor(n / 2)
	s = lim * (lim + 1) * (2 * lim + 1) // 3 * 4
	print(s)


results = []
t = int(input())
for _ in range(t):
	res = 0
	n = int(input())
	curr_moved = 0
	total_moved = 0
	num_layers = int((n - 1) / 2) + 1
	for i in range(num_layers):
		curr_moved = (2 * i + 1) ** 2 - total_moved
		total_moved += curr_moved
		res += i * curr_moved
	results.append(res)
for item in results:
	print(item)


t = int(input())
while t:
	n = int(input())
	res = 0
	while n > 1:
		res += 4 * (n - 1) * (n // 2)
		n -= 2
	print(res)
	t -= 1


def solve(n):
	i = 1
	s = 0
	while i <= n:
		s += (4 * i - 4) * (i // 2)
		i += 2
	return s
t = int(input())
for _ in range(t):
	n = int(input())
	print(solve(n))


from sys import stdin
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	if n == 1:
		answer = 0
	else:
		n = n - 1
		n = n // 2
		answer = 8 * (n * (n + 1) * (2 * n + 1) // 6)
	print(answer)


s = []
for iii in range(int(input())):
	n = int(input())
	g = 0
	for i in range(n, 0, -2):
		m = (i - 1) // 2
		g += m * (4 * i - 4)
	s.append(g)
for i in s:
	print(i)


t = int(input())
for i in range(t):
	n = int(input())
	x = int(n / 2)
	ans = 0
	cnt = x
	for i in range(x):
		ans += (4 * n - 4) * cnt
		n -= 2
		cnt -= 1
	print(ans)


import math
import sys
t = int(sys.stdin.readline())
for _ in range(t):
	n = int(sys.stdin.readline())
	ans = 0
	a = [0, 0]
	ans = 0
	c = n
	for i in range(n // 2, -1, -1):
		ans += i * (c * 4 - 4)
		c -= 2
	print(ans)


movements = [(n - 1) * (2 * n - 1) for n in range(250005)]
movements[0] = 0
for i in range(1, len(movements)):
	movements[i] += movements[i - 1]
tc = int(input())
while tc > 0:
	n = int(input())
	mid = (n + 1) // 2
	print(movements[mid] * 4 - 2 * mid * (mid - 1))
	tc -= 1


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		ans = 0
		value = 8
		multiplier = 1
		cells = 0
		while cells < n * n - 1:
			ans += value * multiplier
			cells += 8 * multiplier
			value += 8
			multiplier += 1
		print(ans)


t = int(input())

def moves(x):
	if x == 1:
		return 0
	else:
		num = x // 2
		lis = [8 * i for i in range(1, num + 1)]
		sum = 0
		for i in range(len(lis)):
			sum += lis[i] * (i + 1)
		return sum
for i in range(t):
	n = int(input())
	print(moves(n))


for i in range(int(input())):
	size = int(input())
	sum1 = 0
	s1 = 1
	if size == 1:
		print(0)
	else:
		for j in range(int(size / 2) + 1):
			sum1 += (pow(s1 + 2, 2) - pow(s1, 2)) * (j + 1)
			s1 += 2
			if s1 == size:
				break
		print(sum1)


T = int(input())
for _ in range(T):
	n = int(input())
	m = n // 2
	ans = 0
	for i in range(m):
		ans += 2 * (n * (m - i) + 2 * i * (i + 1) // 2)
	for j in range(m):
		ans += 2 * (m - j)
	print(ans)


t = int(input())
tests = []
for i in range(t):
	tests.append(int(input()))
mas = []
for i in tests:
	s = 0
	for j in range(1, i // 2 + 1):
		s += pow(j, 2) * 8
	print(s)


tests = int(input())
for i in range(tests):
	n = int(input())
	layer = n // 2
	operations = 0
	for j in range(layer):
		operations += 8 * (j + 1) * (j + 1)
	print(operations)


def parse_input(inp):
	inp = inp.split()
	return [int(x) for x in inp]

def solve(n):
	sum_total = 0
	for i in range(1, n // 2 + 1):
		sum_total += i * (8 * i)
	print(sum_total)

def main():
	t = int(input())
	for i in range(t):
		n = parse_input(input())[0]
		solve(n)
main()


import math
import functools

def s():
	n = int(input())
	if n == 1:
		print(0)
	else:
		sm = 0
		for i in range(3, n + 1, 2):
			sm += 4 * (i - 1) * (i // 2)
		print(sm)
t = int(input())
for i in range(t):
	s()


def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		s = 0
		i = n // 2
		while n - 2 > 0:
			s += (n * 2 + (n - 2) * 2) * i
			i -= 1
			n -= 2
		print(s)
main()


for _ in range(int(input())):
	n = int(input())
	count = 0
	i = n // 2
	while i != 0:
		k = n * 4 - 4
		count += k * i
		n -= 2
		i -= 1
	print(count)


import math
T = int(input())
while T != 0:
	T -= 1
	n = int(input())
	if n == 1:
		print('0')
	else:
		ans = int((n - 1) / 2)
		init = 3
		ans = 0
		count = 1
		while init <= n:
			t = 2 * init + 2 * (init - 2)
			ans += t * count
			count += 1
			init += 2
		print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	sum = 0
	m = n // 2
	i = 1
	for i in range(m + 1):
		sum = sum + 8 * i
	a = 0
	J = 1
	for j in range(m):
		a = a + (j + 1) * j
	b = 8 * a
	print(b + sum)


import sys
import math
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input().rstrip())
	if n == 1:
		print(0)
		continue
	n = n // 2
	dp = [0] * (n + 1)
	dp[0] = 0
	dp[1] = 8
	for i in range(2, n + 1):
		dp[i] = dp[i - 1] + 8 * i * i
	print(dp[n])


import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')
Read = lambda : list(map(int, input().split()))
Num = lambda : int(input())
exec("try:sys.stdin=open('in.txt','r');sys.stdout=open('out.txt','w')\nexcept:pass")

def solve():
	n = Num()
	x = n
	ans = 0
	for i in range((n - 1) // 2 + 1):
		ans += 8 * i * i
	print(ans)
for _ in range(Num()):
	solve()


T = int(input())
for t in range(T):
	n = int(input())
	if n % 2 == 1:
		k = n // 2
		s = 8 * k * (k + 1) * (2 * k + 1) // 6
	else:
		k = n // 2 - 1
		s = 8 * k * (k + 1) * (2 * k + 1) // 6 + (k + 1) * (2 * n - 1)
	print(s)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		moves = 0
		j = 3
		i = 1
		while j <= n:
			moves += 8 * (i * i)
			i += 1
			j += 2
		print(moves)


t = int(input())
for i in range(t):
	a = int(input())
	result = 0
	for j in range(int((a - 1) / 2)):
		result += (a - (2 * j + 1)) * 4 * ((a - 1) / 2 - j)
	print(int(result))


import sys
agGK = int(input())
for _ in range(agGK):
	m = int(input())
	if m == 1:
		print(0)
		continue
	n = m * m
	x = n - (m + 2 * ((m - 1) // 2))
	x = x / 4
	x = (x - x ** 0.5) / 2
	k = 0
	r = 1
	j = 1
	while x != 0 and r != m // 2 + 1:
		x -= j
		k += j * (r + 1)
		j += 1
		r += 1
	k = k * 8
	for i in range(1, m // 2 + 1):
		k += (i + i) * 4
	print(k)


def stepCounter(n):
	step_sum = 0
	for i in range(3, n + 1, 2):
		ele_num = i + (i - 1) + (i - 1) + (i - 2)
		step_sum += ele_num * int(i / 2)
	return step_sum
t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(0)
	elif n > 1:
		print(stepCounter(n))


t = int(input())
for i in range(t):
	n = int(input())
	ans = 0
	qnt = 1
	for j in range(1, n + 1, 2):
		if j < n:
			ans += qnt * j * 2
		if j > 1:
			ans += (qnt - 1) * j * 2
		qnt += 1
	print(int(ans))


t = int(input())
for w in range(t):
	n = int(input())
	q = 1
	ans = 0
	while q <= n:
		ans += 4 * (q - 1) * (q - 1) // 2
		q += 2
	print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(0)
	else:
		r = 0
		p = 8
		for j in range(1, n // 2 + 1):
			r += p * j
			p += 8
		print(r)


test = int(input())
for _ in range(0, test):
	n = int(input())
	k = (n - 1) // 2
	ans = 8 * (k * (k + 1) * (2 * k + 1) // 6)
	print(ans)


for i in range(int(input())):
	n = int(input())
	a = n ** 2
	b = 0
	c = 0
	e = 0
	i = 1
	while c < a - 1:
		b += 8
		c += b
		d = b * i
		e += d
		i += 1
	print(e)


t = int(input())
for i in range(t):
	n = int(input())
	summ = 0
	last_square = 0
	for j in range(n // 2 + 1):
		new_square = (2 * j + 1) ** 2
		summ += (new_square - last_square) * j
		last_square = new_square
	print(summ)


def gather(n):
	return sum(((4 * i - 4) * (i // 2) for i in range(1, n + 1, 2)))

def solve():
	n = int(input())
	print(gather(n))
for _ in range(int(input())):
	solve()


for _ in [0] * int(input()):
	n = int(input()) // 2
	print(n * (n + 1) * (2 * n + 1) // 6 * 8)


def count():
	n = int(input())
	k = n // 2
	sum = 0
	while n != 1:
		square = n ** 2
		sum += 4 * (n - 1) * k
		k -= 1
		n -= 2
	return sum
for i in range(int(input())):
	print(count())


cases = int(input())
for i in range(cases):
	n = int(input())
	moves = 0
	arr = []
	for j in range(n, 1, -2):
		sq = j ** 2 - (j - 2) ** 2
		arr.append(sq)
	arr.sort()
	for k in range(len(arr)):
		num = arr[k]
		times = k + 1
		moves += num * times
	print(moves)


t = int(input())
dp = [0 for i in range(500000 + 5)]
dp[1] = 0
cnt = 0
j = 1
for i in range(3, 500003, 2):
	dp[i] = 2 * (2 * i - 2) * j
	dp[i] += cnt
	cnt += 2 * (2 * i - 2) * j
	j += 1
for _ in range(t):
	n = int(input())
	print(dp[n])


number = int(input())
for i in range(number):
	n = int(input())
	if n == 1:
		print(0)
	elif n == 3:
		print(8)
	else:
		sum = 8
		for i in range(2, int((n + 1) / 2)):
			sum += 8 * i * i
		print(sum)


for _ in range(int(input())):
	fans = 0
	n = int(input())
	d = 1
	mul = 1
	pp = n // 2
	for i in range(pp):
		dd = d * 4 + 4
		if n % 2 == 0 and i == pp - 1:
			fans += mul * (dd - (2 * n + 1))
		else:
			fans += mul * dd
		d += 2
		mul += 1
	print(fans)


maxn = 5 * 10 ** 5 + 1
arr = [0 for i in range(maxn)]
prev_res = 0
for i in range(3, maxn, 2):
	number = i // 2
	side_length = i
	addendum = 2 * side_length * number + 2 * (side_length - 2) * number
	prev_res += addendum
	arr[i] = prev_res
T = int(input())
for t in range(T):
	n = int(input())
	res = arr[n]
	print(res)


t = int(input())
MAX = 1000000
arr = [8 * i for i in range(MAX)]
for _ in range(t):
	n = int(input())
	s = 0
	for x in range(1, (n + 1) // 2):
		s += x * arr[x]
	print(s)


for _ in range(int(input())):
	n = int(input())
	a = pow(n, 2) - 1
	(s, x) = (0, 1)
	while a:
		s += x * (8 * x)
		a -= 8 * x
		x += 1
	print(s)


items = []
for i in range(500001):
	items.append(8 * i ** 2)
t = int(input())
for _ in range(t):
	n = int(input())
	print(sum(items[:(n + 1) // 2]))


T = int(input())
for i in range(T):
	n = int(input())
	s = 0
	for k in range(1, int((n + 1) / 2)):
		s += k * k
	s *= 8
	print(s)


for _ in range(int(input())):
	n = int(input())
	k = (n - 1) // 2
	jd = 1
	answer = 0
	st = 8
	for i in range(k):
		answer += st * jd
		jd += 1
		st += 8
	print(answer)


T = int(input())
dp = [0]
i = 3
while i < 5 * 10 ** 5:
	dp.append(dp[len(dp) - 1] + (i * i - (i - 2) ** 2) * (i // 2))
	i += 2
for test in range(T):
	n = int(input())
	print(dp[n // 2])


a = []
t = int(input())
answer = []
for _ in range(t):
	n = int(input())
	n = (n - 1) // 2
	count = 0
	for i in range(1, n + 1):
		count += i * i
	answer.append(count * 8)
for i in answer:
	print(i)


import math
n1 = int(input())
for x in range(n1):
	n2 = int(input())
	if n2 == 1:
		print(0)
	else:
		n2 = n2 - 1
		n2 = n2 / 2
		a = n2 + 1
		b = 2 * n2 + 1
		c = 2 * n2
		f = a * b * c
		final = f / 3
		print(int(final * 2))


for _ in range(int(input())):
	N = int(input())
	k = (N - 1) // 2
	ans = 4 * k * (k + 1) * (2 * k + 1) // 3
	print(ans)


import math
t = int(input())
for i in range(t):
	n = int(input())
	s = 0
	for i in range(n, 1, -2):
		d = i // 2
		s += 8 * (d - 1) * d + (d + d) * 4
	print(s)


from collections import deque
from collections import Counter
for i in range(int(input())):
	n = int(input())
	x = 8
	moves = 0
	for i in range(1, n // 2 + 1):
		moves += x * i
		x = x + 8
	print(moves)


was = [0] * 250001
for i in range(3, 500000, 2):
	was[i // 2] = was[i // 2 - 1] + 8 * (i // 2) ** 2
for _ in range(int(input())):
	print(was[int(input()) // 2])


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(0)
	else:
		k = (n - 1) // 2
		sm = k * (k + 1) * (2 * k + 1)
		sm = sm // 6
		print(sm * 8)


t = int(input())

def solve(n):
	x = 0
	while n > 1:
		x += 2 * ((2 * n - 2) * (n // 2))
		n -= 2
	return x
while t > 0:
	n = int(input())
	print(solve(n))
	t -= 1


import math

def inp_n():
	return int(input())

def inp_list():
	return list(map(int, input().split()))

def inp_mul_num():
	return map(int, input().split())

def is_odd(n):
	if n & 1:
		return True
	return False
for _ in range(inp_n()):
	n = inp_n()
	v = n // 2
	s = 0
	t = n
	k = t * 4 - 4
	while k > 0:
		s += v * k
		v -= 1
		t -= 2
		k = t * 4 - 4
	print(s)


import sys
input = sys.stdin.readline
cases = int(input())
for case in range(cases):
	n = int(input())
	cnt = 8
	if n == 1:
		print(0)
		continue
	ans = 0
	for i in range(n // 2):
		ans += cnt * (i + 1)
		cnt += 8
	print(ans)


def call(n):
	return n * (n + 1) * (2 * n + 1) // 6
t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(0)
	elif n == 3:
		print(8)
	else:
		n = (n - 3) // 2 + 1
		print(8 * call(n))


MOD = 1000000007

def solve(n):
	ans = 0
	for i in range((n - 1) // 2 + 1):
		ans = ans + 8 * i * i
	print(ans)
for i in range(int(input())):
	n = int(input())
	solve(n)


t = int(input())
for i in range(t):
	n = int(input())
	q = n * (n * n - 1) // 3
	print(q)


t = int(input())
s = [0] * 500005
tmp = 0
for j in range(1, 500005, 2):
	tmp += j // 2 * ((j - 1) * 4)
	s[j] = tmp
for i in range(t):
	n = int(input())
	print(s[n])


t = int(input())
for r in range(t):
	n = int(input())
	x = 0
	y = 0

	def f(k):
		x = 4 * (k - 1) * (k // 2)
		return x
	for i in range(n // 2):
		y += f(n)
		n = n - 2
	print(y)


t = int(input())
rings = list()
answers = [0]
for i in range(t):
	rings.append(int(input()))
for i in range(3, max(rings) + 2, 2):
	border_size = (i - 1) * 4
	path_size = (i - 1) / 2
	border_path = border_size * path_size
	last_total_paths = answers[-1]
	answers.append(int(border_path) + last_total_paths)
for i in rings:
	print(answers[int((i - 1) / 2)])


from collections import Counter
from collections import defaultdict
from collections import deque
import math
import sys
input = sys.stdin.readline
import bisect
rs = lambda : input().strip()
ri = lambda : int(input())
rl = lambda : list(map(int, input().split()))
rls = lambda : list(map(str, input().split()))
t = int(input())
for _ in range(0, t):
	n = int(input())
	if n == 1:
		print(0)
		continue
	s = 0
	if n >= 3:
		n = (n - 1) // 2
		s = n * (n + 1) * (2 * n + 1) / 6
		s = s * 8
	print(int(s))


from math import floor
for _ in range(int(input())):
	n = int(input())
	res = 0
	for i in range(floor(n / 2)):
		res += 8 * (i + 1) ** 2
	print(res)


temp = [0] * 500000
i = 1
temp[1] = 0
while i < 500000:
	temp[i] = temp[i - 2] + 2 * (i - 1) * (i - 1)
	i += 2
t = int(input())
for z in range(t):
	print(temp[int(input())])


import math
t = int(input())
cases = []
for i in range(t):
	cases.append(int(input()))
for n in cases:
	center = n // 2
	mult = n - 1
	ans = 0
	for i in range(0, mult + 1, 2):
		ans += math.pow(i, 2) * 2
	print(int(ans))


a = int(input())
for _ in range(a):
	b = int(input())
	count = b // 2
	temp = b
	sum = 0
	c = count
	if b == 1:
		print(sum)
	else:
		for i in range(count):
			s = temp + temp + temp - 2 + temp - 2
			sum += s * c
			c -= 1
			temp -= 2
		print(sum)


def fun():
	n = int(input())
	x = 0
	i = 3
	while i <= n:
		x = int((i * i - (i - 2) * (i - 2)) * (i - 1) / 2 + x)
		i = i + 2
	print(x)
t = int(input())
i = 0
for i in range(t):
	fun()


l = []
su = 0
l.append(0)
for i in range(1, 500001):
	su += i ** 2
	l.append(su)
t = int(input())
while t:
	t -= 1
	n = int(input())
	x = n // 2
	ans = 8 * l[x]
	print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	ans = 0
	mid = n // 2
	cur = 1
	cursum = 0
	for i in range(n // 2 + 1):
		ans += (cur * cur - cursum) * i
		cursum = cur * cur
		cur += 2
	print(ans)


import sys
ints = (int(x) for x in sys.stdin.read().split())
sys.setrecursionlimit(3000)

def presolve(n):
	p = [0] * n
	p[1] = 0
	p[2] = 3
	for i in range(3, n):
		border = 4 * (i - 1)
		p[i] = border * (i // 2) + p[i - 2]
	return p

def main():
	ans = presolve(5 * 10 ** 5 + 5)
	ntc = next(ints)
	for tc in range(1, ntc + 1):
		n = next(ints)
		print(ans[n])
	return
main()


n = int(input())
for i in range(n):
	a = int(input())
	ans = 0
	mult = (a - 1) / 2
	mult *= 8
	some = 0
	befans = 0
	while mult != 0:
		befans += mult
		mult -= 8
		ans += befans
	print(int(ans))


a = int(input())
for x in range(a):
	b = int(input())
	n = 0
	for y in range(1, b // 2 + 1):
		n += 8 * y * y
	print(n)


t = int(input())
while t > 0:
	n = int(input())
	steps = n // 2
	min_steps = 0
	while n > 1:
		blocks = n * 4 - 4
		min_steps += blocks * steps
		n -= 2
		steps -= 1
	print(min_steps)
	t -= 1


def ninja(n):
	if n == 1:
		return 0
	z = n // 2
	sum = 0
	i = n
	while i > 0 and z > 0:
		sum += (i * 4 - 4) * z
		z -= 1
		i -= 2
	return sum
t = int(input())
for _ in range(t):
	n = int(input())
	print(ninja(n))


import math
import os
import random
import re
import sys

def algo(n):
	if n == 1:
		return 0
	result = 0
	for i in range(1, (n + 1) // 2):
		result += i * 2 * 4 * i
	return result
for _ in range(int(input())):
	n = int(input())
	print(algo(n))


for _ in range(0, int(input())):
	flag = 0
	n = int(input())
	if n % 2 == 0:
		n = n - 1
		flag = 1
	f = int((n - 1) / 2)
	tot = 0
	for i in range(1, f + 1):
		tot = tot + 8 * i * i
	if flag == 1:
		n = n + 1
	if n % 2 != 0:
		print(tot)
	else:
		j = 2 * n - 1
		tot = tot + j * (f + 1)
		print(tot)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print('0')
	else:
		out = n * 2
		out += (n - 2) * 2
		k = n // 2
		ans = 0
		while k > 0:
			ans += out * k
			out -= 8
			k -= 1
		print(ans)


t = int(input())
for _ in range(0, t):
	n = int(input())
	if n == 1:
		print(0)
		continue
	s = 0
	if n >= 3:
		n = (n - 1) // 2
		s = n * (n + 1) * (2 * n + 1) / 6
		s = s * 8
	print(int(s))


for test_case in range(int(input())):
	n = int(input())
	s = 0
	if n == 1:
		print(0)
	else:
		while n >= 3:
			s += (2 * n + 2 * (n - 2)) * (n // 2)
			n = n - 2
		print(s)


import math
t = int(input())
for _ in range(t):
	n = int(input())
	m = 0
	for i in range(n, 1, -2):
		x = 4 * i - 4
		m += x * (i // 2)
	print(m)


t = int(input())
for _ in range(t):
	n = int(input())
	x = n // 2
	s = n * x
	i = n - 2
	while i >= 1:
		s = s + i * i
		i -= 2
	print(s * 2)


t = int(input())
ans = []
for _ in range(t):
	n = int(input())
	l = [0]
	su = 0
	for i in range(n // 2 + 1):
		su += i * i
	ans.append(str(8 * su))
print('\n'.join(ans))


import sys

def solve():
	n = int(input())
	ans = 0
	for x in range(1, n + 1, 2):
		ans = ans + int(x / 2) * (x * x - (x - 2) * (x - 2))
	print(ans)
t = int(input())
while t:
	solve()
	t = t - 1


import math
T = int(input())
for _ in range(T):
	n = int(input())
	ans = 0
	n = math.ceil(n / 2)
	for i in range(n):
		ans += i * (i * 8)
	print(ans)


from sys import stdin, stdout
import math
from itertools import permutations, combinations
from collections import defaultdict
from bisect import bisect_left
from bisect import bisect_right

def L():
	return list(map(int, stdin.readline().split()))

def In():
	return map(int, stdin.readline().split())

def I():
	return int(stdin.readline())
P = 1000000007

def main():
	for t in range(I()):
		n = I()
		val = 0
		j = 1
		for i in range(1, n // 2 + 1):
			val += 8 * i * j
			j += 1
		print(val)
main()


t = int(input())
for i in range(t):
	n = int(input())
	print(2 * sum([x ** 2 for x in range(2, n, 2)]))


import sys
sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.readline())

def MI():
	return map(int, sys.stdin.readline().split())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def SI():
	return sys.stdin.readline()[:-1]

def main():
	for _ in range(II()):
		n = II()
		n //= 2
		print(4 * n * (n + 1) * (2 * n + 1) // 3)
main()


t = int(input())
for i in range(t):
	n = int(input())
	ans = 0
	num = n // 2
	if num > 0:
		mult = 8
		for i in range(1, num + 1):
			ans += i * mult
			mult += 8
	print(ans)


t = int(input())
list_ans = []
for i in range(t):
	s = int(input())
	list_ans.append(s * (s - 1) * (s + 1) // 3)
for item in list_ans:
	print(item)


for test in range(int(input())):
	n = int(input())
	sum = 0
	j = 4
	a = 0
	for i in range(n // 2):
		sum += 4 * (n // 2 - i)
		a += 8 * i
		sum += j * (n // 2 - i) + a
		j += 8
	print(sum)


def board(n):
	count = 0
	for i in range(n, 0, -2):
		count += i // 2 * (i * 2) + i // 2 * ((i - 2) * 2)
	return count
t = int(input())
for _ in range(t):
	n = int(input())
	result = board(n)
	print(result)


numcases = int(input())
for i in range(numcases):
	n = int(input())
	sum = 0
	last = 0
	count = 1
	for j in range(n // 2 + 1):
		sum = sum + (count ** 2 - last ** 2) * j
		last = count
		count += 2
	print(sum)


t = int(input())

def ans(a):
	sum = 0
	if a == 1:
		return 0
	else:
		for i in range(1, a // 2 + 1):
			sum += i * i * 8
		return sum
for _ in range(t):
	a = int(input())
	print(ans(a))


def get_ints():
	return map(int, input().split())

def get_list():
	return list(map(int, input().split()))
t = int(input())
for i in range(t):
	n = int(input())
	sumhalf = (n - 1) // 2
	sumsquares = sumhalf * (sumhalf + 1) * (2 * sumhalf + 1) // 6
	print(sumsquares * 8)


import sys
import heapq
from collections import Counter, deque
inp = sys.stdin.readline
read = lambda : list(map(int, inp().strip().split()))

def count(n):
	s = 0
	for i in range(n // 2):
		s += ((n - 2 * (1 + i)) * 4 + 4) * (n // 2 - i)
	return s

def a():
	ans = ''
	for _ in range(int(inp())):
		(n, m) = read()
		if n == 1:
			ans += '0\n'
		elif n == 2:
			ans += str(m) + '\n'
		else:
			ans += str(2 * m) + '\n'
	print(ans)

def b():
	ans = ''
	for _ in range(int(inp())):
		(n, k) = read()
		a = sorted(read())
		b = sorted(read(), reverse=True)
		s = 0
		for i in range(k):
			s += max(a[i], b[i])
		s += sum(a[k:])
		ans += str(s) + '\n'
	print(ans)

def c():
	ans = ''
	for _ in range(int(inp())):
		n = int(inp())
		s = 0
		for i in range(n // 2):
			s += ((n - 2 * (1 + i)) * 4 + 4) * (n // 2 - i)
		ans += str(s) + '\n'
	print(ans)

def d():
	ans = ''
	for _ in range(int(inp())):
		n = int(inp())
		arr = [(-n, 1, n)]
		heapq.heapify(arr)
		dic = [0 for i in range(n + 1)]
		num = 1
		while arr and num <= n:
			elem = heapq.heappop(arr)
			(l, a, b) = elem
			ind = (a + b) // 2
			dic[ind] = str(num)
			num += 1
			if a != b:
				heapq.heappush(arr, (-(ind - a + 1), a, ind - 1))
				heapq.heappush(arr, (-(b - ind + 1), ind + 1, b))
		ans += ' '.join(dic[1:]) + '\n'
	print(ans)

def e():
	ans = ''
	for _ in range(int(inp())):
		(n, k) = read()
		s = inp().strip()
		dp = []
		x = 0
		for i in s:
			x += int(i)
			dp.append(x)
c()


for _ in range(int(input())):
	n = int(input())
	if n % 3 == 0:
		m = n // 3
		ans = int(m * (n - 1) * (n + 1))
	elif n % 3 == 1:
		m = int(n - 1) // 3
		ans = int(m * n * (n + 1))
	else:
		m = int(n + 1) // 3
		ans = int(m * n * (n - 1))
	print(ans)


a = []
multiplier = 1
for i in range(500000):
	if i == 0 or i == 1:
		a.append(0)
	else:
		n = 2 * i - 1
		a.append(a[-1] + (2 * n + 2 * (n - 2)) * multiplier)
		multiplier += 1
for t in range(int(input())):
	n = int(input())
	print(a[(n + 1) // 2])


t = int(input())
for x in range(t):
	num = int(input())
	solution = 0
	for y in range(int((num - 1) / 2) + 1):
		solution += y ** 2
	print(solution * 8)


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(100000000)
	threading.stack_size(40960000)
	thread = threading.Thread(target=main)
	thread.start()
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[1]

def sort2(l):
	return sorted(l, key=getKey, reverse=True)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def ceil(x, y):
	if x % y == 0:
		return x // y
	else:
		return x // y + 1

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def main():
	for _ in range(ii()):
		n = ii()
		ans = 0
		x = 0
		f = 1
		for i in range(n // 2):
			x += (i + 1) * f
			f = f + 2
		x *= 4
		ans = x
		x = n // 2
		ans += 2 * x * (x + 1)
		print(ans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import sys
first = 1
f = [0]
for i in range(1, 250004):
	n = 2 * i + 1
	n = f[-1] + 4 * (n - 1) * i
	f.append(n)
for line in sys.stdin:
	values = list(map(int, line.split()))
	if first == 1:
		first = 0
		continue
	n = (values[0] - 1) // 2
	print(f[n])


t = int(input())
i = 0
while i < t:
	n = int(input())
	sum = 0
	dis = n // 2
	num = n + n + (n - 2) + (n - 2)
	for j in range(n // 2):
		sum += (dis - j) * num
		num = num - 8
	print(sum)
	i += 1


def f(n):
	if n % 2 == 1:
		return (n - 1) * n * (n + 1) // 3
	else:
		return n ** 3 // 3 + n // 6
for i in range(int(input())):
	n = int(input())
	print(f(n))


a = int(input())
for i in range(0, a):
	b = int(input())
	c = b // 2
	d = 4 * b - 4
	ans = 0
	for i in range(0, c):
		ans += c * d
		c -= 1
		d -= 8
	print(ans)


t = int(input())
while t:
	n = int(input())
	l = []
	s = 0
	k = n // 2
	for i in range(k):
		l.append(8 * (i + 1))
	for (i, j) in zip(range(k), range(1, k + 1)):
		s += l[i] * j
	print(s)
	t -= 1


dp = [0]
for i in range(1, 5 * 10 ** 5 + 5):
	if i % 2 == 1:
		dp.append(dp[i - 1] + (i * 4 - 4) * int(i / 2))
	else:
		dp.append(dp[i - 1])
t = int(input())
for x in range(t):
	n = int(input())
	print(dp[n])


t = int(input())
for i in range(t):
	a = int(input())
	n = int((a - 1) / 2)
	r = n * (n + 1) * (2 * n + 1)
	p = int(r / 6)
	print(p * 8)


t = int(input())
for i in range(t):
	n = int(input())
	ans = 0
	count = 0
	prev = 0
	for i in range(1, n + 1, 2):
		current = i ** 2
		if i == 1:
			prev = current
			count += 1
			continue
		else:
			ans += count * (current - prev)
		count += 1
		prev = current
	print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(0)
	elif n == 2:
		print(3)
	elif n % 2 == 0:
		final = 3
		summ = 0
		mn = 1
		for i in range(3, n + 1, 2):
			p = 2 * (i + i - 2)
			summ += mn * p
			mn += 1
			final = i
		summ += mn * (final + final + 1)
		print(summ)
	else:
		summ = 0
		mn = 1
		for i in range(3, n + 1, 2):
			p = 2 * (i + i - 2)
			summ += mn * p
			mn += 1
		print(summ)


rr = lambda : input().strip()

def solve(n):
	if n == 1:
		return 0
	else:
		k = (n - 1) / 2
		su = 4 * k * (k + 1) * (2 * k + 1) / 3
		return int(su)
T = int(rr())
for _ in range(T):
	n = int(rr())
	ans = solve(n)
	print(ans)


def f(n):
	return sum([2 * x * x for x in range(n // 2 + 1)]) * 4
for x in range(int(input())):
	n = int(input())
	print(f(n))


a = [0] * 600000
a[3] = 8
c = 2
for i in range(5, 600000, 2):
	a[i] = a[i - 2] + (i * 4 - 4) * c
	c += 1
t = int(input())
for _ in range(t):
	n = int(input())
	print(a[n])


import math
dp = {}
dp[0] = 0
dp[1] = 0
dp[3] = 8
cc = 0
for i in range(5, 500005, 2):
	temp = i // 2 * (4 * i - 4) + dp[i - 2]
	dp[i] = temp
t = int(input())
for tt in range(t):
	n = int(input())
	print(dp[n])


from sys import *
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	count = 0
	i = n // 2 + 1
	while n > 1:
		count = count + (4 * n - 4) * (n - i)
		n = n - 2
		i = i - 1
	print(count)


from itertools import accumulate
ncases = int(input())
NMOVES = list(accumulate([8 * n * n for n in range(1, 500000)]))
NMOVES = [0] + NMOVES
for _ in range(ncases):
	print(NMOVES[int(input()) // 2])


x = int(input())
for j in range(x):
	s = 0
	y = int(input())
	for i in range(1, (y - 1) // 2 + 1):
		s += i * i
	print(s * 8)


def solve():
	m = int(input())
	n = (m - 1) // 2
	s = n * (n + 1) * (2 * n + 1)
	s //= 6
	s *= 8
	print(s)
t = 1
T = int(input())
while t <= T:
	solve()
	t = t + 1


tc = int(input())
for _ in [0] * tc:
	n = int(input())
	print(n * (n + 1) * (n - 1) // 3)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
for _ in range(int(data())):
	n = int(data())
	i = 1
	t = 3
	answer = 0
	n *= n
	n -= 1
	while n:
		answer += i * min(n, (t - 1) * 4)
		n -= min(n, (t - 1) * 4)
		t += 2
		i += 1
	out(answer)


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	res = 0
	m = 8
	for i in range(1, n // 2 + 1):
		res += i * m
		m += 8
	print(res)


from sys import stdin, stdout
int_in = lambda : int(stdin.readline())
arr_in = lambda : [int(x) for x in stdin.readline().split()]
mat_in = lambda rows: [arr_in() for y in range(rows)]
str_in = lambda : stdin.readline().strip()
out = lambda o: stdout.write('{}\n'.format(o))
arr_out = lambda o: out(' '.join(map(str, o)))
bool_out = lambda o: out('YES' if o else 'NO')

def solve(n):
	x = (n - 1) // 2
	result = 0
	for i in range(x):
		result += pow(i + 1, 2)
	return result * 8
for i in range(int_in()):
	n = int_in()
	out(solve(n))


import sys
for _ in range(int(sys.stdin.readline())):
	n = int(sys.stdin.readline())
	n //= 2
	print(4 * (n * (2 * n + 1) * (n + 1)) // 3)


in_cas = input()
cas = eval(in_cas)
while cas > 0:
	cas -= 1
	in_n = input()
	n = eval(in_n)
	tmp = n // 2
	ans = 0
	tt = 0
	tmp += 1
	for i in range(1, tmp):
		tt = i * i * 8
		ans += tt
	print(ans)


l = []
j = 1
for i in range(3, 500000, 2):
	l.append(j * (4 * i - 4))
	j += 1
for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		print(sum(l[:(n - 1) // 2]))


T = int(input())
from collections import defaultdict
dAns = defaultdict(lambda : -1)
dA = defaultdict(lambda : -1)

def point(n):
	if n == 1:
		return 0
	return (n - 1) // 2 * (n * 4 - 4)

def fA(n):
	if n < 5:
		return 0
	if n == 5:
		return 32
	if dA[n] == -1:
		dA[n] = fA(n - 2) + fB(n)
	return dA[n]

def fB(n):
	if n < 7:
		return 0
	if n == 7:
		return 40
	k = (n - 1) // 2
	return 40 + (k - 3) * 16
dAns[1] = 0
dAns[3] = 8
for n in range(5, 500000, 2):
	dAns[n] = dAns[n - 2] + fA(n)
for t in range(T):
	n = int(input())
	print(dAns[n])


t = int(input())
while t > 0:
	n = int(input())
	s = 0
	tot = 0
	if n == 1:
		print(0)
	else:
		n -= 2
		while n > 0:
			tot += 4 * (n + 1)
			s += tot
			n -= 2
		print(s)
	t -= 1


t = int(input())
for _ in range(t):
	n = int(input())
	middle = int(n / 2)
	moves = 0
	for x in range(middle):
		moves += (n - x * 2 - 1) * 4 * (middle - x)
	print(moves)


t = int(input())
for i in range(t):
	s = 0
	n = int(input())
	a = n // 2 + 1
	for i in range(1, a + 1):
		s += (2 * i - 1) * (i - 1)
	s -= a * (a - 1) // 2
	s *= 4
	print(s)


for _ in [0] * int(input()):
	n = int(input())
	if n == 1:
		num = 0
	else:
		m = (n - 3) // 2
		k = (n - 1) // 2
		num = k * (k + 1) * (2 * k + 1) / 6 + (k + k * k) / 2 + (m * m + m) / 2 + m * (m + 1) * (2 * m + 1) / 6
	print(int(num) * 4)


t = int(input())
for _ in range(t):
	n = int(input())
	x = 8
	s = 0
	y = n // 2
	for j in range(1, y + 1):
		s = s + x * j
		x += 8
	print(s)


a = int(input())
for _ in range(a):
	n = int(input())
	s = 0
	if n == 1:
		print(0)
	else:
		k = int(n / 2)
		print(int(8 * k * (k + 1) * (2 * k + 1) / 6))


t = int(input())
for i in range(t):
	n = int(input())
	a = 1
	k = 8
	dviz = 0
	for i in range(1, n // 2 + 1):
		dviz += i * (i * k)
	print(dviz)


a = int(input())
for i in range(0, a):
	b = int(input())
	k = (b + 1) // 2
	c = 0
	for j in range(1, k):
		c += ((j * 2 + 1) * (j * 2 + 1) - (j * 2 - 1) ** 2) * j
	print(c)


t = int(input())
for z in range(t):
	n = int(input())
	x = n ** 2
	i = 1
	j = 8
	sj = 0
	s = 0
	while sj < x - 1:
		s += i * j
		sj += j
		i += 1
		j += 8
	print(s)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		p = n // 2
		ans = p * (p + 1) * (2 * p + 1) // 3
		print(4 * ans)


from math import *
t = int(input())
for _ in range(t):
	n = int(input())
	a = (n + 1) // 2
	s = 0
	for i in range(1, a):
		k = i ** 2
		k = 8 * k
		s = s + k
	print(s)


dp = [0] * 500001
for i in range(3, len(dp), 2):
	dp[i] += dp[i - 2] + 8 * (i - 1) // 2 * (i - 1) // 2
for _ in range(int(input())):
	p = int(input())
	print(dp[p])


from math import sqrt, ceil
for i in range(int(input())):
	a = int(input())
	if a == 1:
		print(0)
	else:
		a = (pow(a, 2) - 1) // 4
		for i in range(ceil(sqrt(a)), 0, -1):
			if a % i == 0:
				n = min(i, int(a / i))
				break
		print(int(8 * (n * (n + 1) * (2 * n + 1) / 6)))


a = int(input())
for _ in range(a):
	n = int(input())
	sum = 0
	for x in range(1, n + 2, 2):
		sum = sum + 4 * (x - 1) * (x // 2)
	print(sum)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		j = 1
		su = 0
		for i in range(3, n + 1, 2):
			su += j * (i * 4 - 4)
			j += 1
		print(su)


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
mod = 1000000007
import math
import bisect
abc = 'abcdefghijklmnopqrstuvwxyz'

def main():
	for _ in range(ii()):
		n = ii()
		a = 1
		b = 8
		ans = 0
		n //= 2
		while n:
			ans += b * a * a
			a += 1
			n -= 1
		print(ans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


for t in range(int(input())):
	n = int(input())
	x = n // 2
	y = n - 1
	k = 0
	while x > 0:
		k = k + y * 4 * x
		y = y - 2
		x = x - 1
	print(k)


T = int(input())
for t in range(T):
	N = int(input())
	answer = 0
	i = 0
	moves = 0
	nb = 0
	while i < N // 2:
		i += 1
		nb += 8
		answer += nb * i
	print(answer)


from sys import stdin
import math
a = int(stdin.readline())
for b in range(0, a):
	c = int(stdin.readline())
	D = int((c - 1) * c * (c + 1) / 3)
	print(D)


def main(n):
	if n == 1:
		return 0
	count = 0
	for i in range(1, n // 2 + 1):
		count += i ** 2 * 8
	return count
for _ in range(int(input())):
	n = int(input())
	print(main(n))


import sys
from collections import defaultdict
import random
import math
t = int(input())
for _ in range(t):
	n = int(input())
	c = 8
	x = n // 2
	res = 0
	for i in range(1, x + 1):
		res += i * c
		c += 8
	print(res)


import math
for tt in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
		continue
	else:
		k = math.ceil(n / 2)
		j = 8
		ans = 0
		for i in range(1, k):
			ans = ans + j * i
			j = j + 8
		print(ans)


import sys
t = int(input())
for _ in range(t):
	n = int(input())
	c = 1
	m = 0
	for _ in range((n - 1) // 2, 0, -1):
		m += (4 * n - 4) * c
		c += 1
		n -= 1
	print(m)


def new(n):
	k = int((n - 1) / 2)
	sum = 0
	while k > 0:
		s = k * (n * 4 - 4)
		k = k - 1
		n = n - 2
		sum = sum + s
	return sum
a = int(input())
n = 0
b = list()
while n < a:
	c = int(input())
	b.append(c)
	n += 1
n = 0
while n < a:
	print(new(b[n]))
	n += 1


from math import sqrt
t = int(input())
for i in range(t):
	n = int(input())
	ans = 0
	l = n // 2
	while n >= 3:
		ans += l * (2 * n + 2 * (n - 2))
		l -= 1
		n -= 2
	print(ans)


for _ in range(int(input())):
	n = int(input())
	cnt = n // 2
	total = 0
	for i in range(cnt + 1):
		total += i * i * 8
	print(total)


from sys import *
input = stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(0)
		continue
	n //= 2
	ans = 8 * n * (n + 1) * (2 * n + 1) // 6
	print(ans)


for x in range(int(input())):
	lst = [0]
	k = 1
	for i in range(3, int(input()) + 1):
		if i % 2:
			lst.append(k * (2 * (i + i - 2)))
		else:
			k += 1
	print(sum(lst))


for _ in range(int(input())):
	n = int(input())
	k = n // 2
	sol = k * (k + 1) * (2 * k + 1) * 8 // 6
	print(sol)


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	moves = 0
	i = 3
	j = 1
	while i <= n:
		moves += (i * 4 - 4) * j
		i += 2
		j += 1
	print(moves)


x = int(input())
for i in range(x):
	n = int(input())
	s = 0
	t = 3
	for i in range(1, n // 2 + 1):
		s += (4 * t - 4) * i
		t += 2
	print(s)


for t in range(int(input())):
	N = int(input())
	t = 8
	s = 0
	for i in range(1, N // 2 + 1):
		s += t * i
		t += 8
	print(s)


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	if n == 1:
		print(0)
	elif n == 3:
		print(8)
	else:
		moves = 8
		x = (n - 3) // 2
		i = 5
		j = 1
		while j <= x:
			y = 4 * (i - 1)
			moves += y * (j + 1)
			i += 2
			j += 1
		print(moves)


t = int(input())
while t:
	t -= 1
	n = int(input())
	p = n // 2
	sum = 0
	while p:
		sum += (n * 2 + (n - 2) * 2) * p
		n -= 2
		p -= 1
	print(sum)


for _ in range(0, int(input())):
	n = int(int(input()) / 2)
	print(int(8 * (n * (n + 1) * (n - 1) / 3 + n * (n + 1) / 2)))


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(0)
	else:
		l = []
		temp = n // 2 * n
		l.append(temp)
		for i in range(n // 2 - 1):
			temp = temp - (n - 2 * (i + 1))
			l.append(temp)
		print(2 * sum(l) + temp - 1)


t = int(input())
while t:
	n = int(input())
	w = n + 1
	c = w // 2
	q = 0
	while c:
		w = w - 2
		c = c - 1
		q = q + w * 4 * c
	print(q)
	t -= 1


import sys, os

def f():
	return list(map(int, input().split()))
if 'local' in os.environ:
	sys.stdin = open('./input.txt', 'r')

def solve():
	t = f()[0]
	for _ in range(t):
		n = f()[0]
		hav = n // 2
		ans = 0
		for i in range(1, hav + 1):
			ans += 4 * 2 * i * i
		print(ans)
solve()


from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	sm = 0
	op = 1
	for i in range(3, n + 1, 2):
		fig = 4 * i - 4
		sm += op * fig
		op += 1
	print(sm)


t = int(input())
while t:
	t -= 1
	n = int(input())
	temp = 3
	moves = 0
	temp2 = 1
	for i in range(int(n / 2) + 1):
		moves += i * i
		temp2 += 1
		temp += 1
	print(moves * 8)


num = int(input())
for _ in range(num):
	n = int(input())
	ans = 0
	if n == 1:
		print(0)
	else:
		k = n // 2
		ans = 4 * (k * (k + 1) * (2 * k + 1)) // 3
		print(ans)


n = int(input())
import math
for xy in range(n):
	k = int(input())
	sums = 0
	for yz in range(k // 2):
		sums += 8 * (yz + 1) ** 2
	print(sums)


t = int(input())
for l in range(0, t):
	n = int(input())
	c = 0
	ic = int(n / 2)
	while n > 0:
		c = c + 2 * n * ic + 2 * (n - 2) * ic
		n = n - 2
		ic = ic - 1
	print(c)


t = int(input())
while t:
	n = int(input())
	ans = 0
	for i in range(1, int((n + 3) / 2)):
		ans += 8 * (i - 1) * (i - 1)
	print(ans)
	t -= 1


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	elif n % 2 == 1:
		su = 0
		while n > 1:
			su += (2 * n + 2 * (n - 2)) * (n // 2)
			n -= 2
		print(su)
	else:
		su = 0
		while n > 0:
			su += ((2 * n + 2 * (n - 2)) // 2 + 1) * (n // 2) + ((2 * n + 2 * (n - 2)) // 2 - 1) * (n // 2 - 1)
			n -= 2
		print(su)


a = int(input())
b = [int(input()) for i in range(0, a)]

def brd(x):
	b = range(0, int((x + 1) / 2))
	return sum([p * p * 8 for p in b])
for i in b:
	print(brd(i))


from sys import stdin, stdout
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	need = n // 2
	res = 0
	for i in range(1, need + 1):
		res += 2 * i ** 2 - i
	res = res * 4 + (1 + need) * need * 2
	print(res)


a = int(input())
for j in range(a):
	n = int(input())
	x = n // 2
	m = 0
	for i in range(x, 1, -1):
		m += i * (i - 1)
	sum1 = x * (x + 1) // 2 * 8
	sum2 = m * 8
	sum = sum1 + sum2
	print(sum)


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(0)
	else:
		total = int(n * (n - 1) * (n + 1) / 3)
		print(total)


from collections import defaultdict as dc
from collections import Counter
from heapq import *
import math
from bisect import bisect_left, bisect
import sys
from collections import deque as dq
from heapq import heapify, heappush, heappop
mod = 10 ** 9 + 7

def sinp():
	p = str(input())
	return p

def seive(n):
	p = [0] * (n + 1)
	for i in range(2, n):
		if p[i] == 0:
			for j in range(2 * i, n + 1, i):
				p[i] = 1
	return p

def inp():
	p = int(input())
	return p

def line():
	p = list(map(int, input().split()))
	return p

def read_mat():
	n = inp()
	a = []
	for i in range(n):
		a.append(line())
	return a

def digit(n):
	s = str(n)
	p = 0
	for i in s:
		p += int(i) ** 2
	return p

def solve(n):
	if n == 1:
		return 0
	z = n // 2
	s = 0
	p = 8
	for i in range(1, z + 1):
		s = s + i * p
		p = 8 * (i + 1)
	return s
for test in range(inp()):
	n = inp()
	l = solve(n)
	print(l)


def f(x):
	y = (x - 1) // 2
	cnt = 0
	for i in range(1, y + 1):
		cnt = cnt + i * i
	return cnt * 8
t = int(input())
for i in range(0, t):
	x = int(input())
	print(f(x))


from collections import *
import sys

def ri():
	return int(input())

def rl():
	return list(map(int, input().split()))
t = ri()
for _ in range(t):
	n = ri()
	k = n // 2
	print(int(8 * k * (k + 1) * (2 * k + 1) / 6))


lst = [1]
for i in range(3, 500005, 2):
	lst.append((i - 1) * 4)
anslst = [0]
for i in range(1, 250002):
	anslst.append(anslst[i - 1] + lst[i] * i)
for _ in range(int(input())):
	inp = int(input())
	print(anslst[inp // 2])


test = int(input())
for _ in range(test):
	n = int(input())
	moves = 0
	if n == 1:
		moves = 0
	else:
		d = n // 2
		x = 1
		dum = 1
		if n % 2 != 0:
			for i in range(d):
				moves += x * 8 * x
				x += 1
		else:
			for i in range(d - 1):
				moves += x * 8 * x
				x += 1
			moves += n * 2 - 1
	print(moves)


arr = [0 for i in range(500000)]
j = 1
for i in range(3, 500001, 2):
	arr[i] = arr[i - 2] + ((i - 2) * 2 + i * 2) * j
	j += 1
for _ in range(int(input())):
	n = int(input())
	print(arr[n])


t = int(input())
for i in range(t):
	n = int(input())
	res = 0
	for i in range(n):
		if i % 2 == 0:
			res += i ** 2
	print(res * 2)


import sys

def eprint(*args):
	print(*args, file=sys.stderr)
zz = 1
from math import *
import copy
if zz:
	input = sys.stdin.readline
else:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('all.txt', 'w')

def li():
	return [int(x) for x in input().split()]

def fi():
	return int(input())

def si():
	return list(input().rstrip())

def mi():
	return map(int, input().split())
t = fi()
while t > 0:
	t -= 1
	n = fi()
	c = 0
	d = 0
	for i in range(n // 2):
		c += (d + 8) * (i + 1)
		d += 8
	print(c)


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def integer():
	return int(inp())

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')
from functools import reduce

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def solve():
	n = integer()
	n //= 2
	print(4 * n * (n + 1) * (2 * n + 1) // 3)
testcase(int(inp()))


t = int(input())
for _ in range(t):
	n = int(input())
	moves = 0
	for (i, m) in enumerate(range(1, n + 1, 2)):
		moves += (2 * m + 4 * i - 2) * i
	print(moves)


for i in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		sum = 0
		j = 1
		for i in range(3, n + 1, 2):
			a = int(8 * (i - 1) / 2) * j
			j += 1
			sum += a
		print(sum)


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(0)
		continue
	total = 0
	c = 8
	for x in range(n // 2):
		total += c * (x + 1)
		c += 8
	print(total)


import math
from collections import defaultdict, Counter, deque

def primeFactor(n):
	if n % 2 == 0:
		return 2
	i = 3
	while i ** 2 <= n:
		if n % i == 0:
			return i
		i += 1
	return n

def main():
	n = int(input())
	s = n // 2
	ans = s * (s + 1) // 2 * 8
	s = s - 1
	i = 1
	even = 2
	temp = 0
	while s >= 1:
		temp += i * (i + 1) + s * even
		even += 2
		s -= 1
		i += 1
	print(ans + temp * 4)
t = int(input())
for _ in range(t):
	main()


k = int(input())
for i in range(0, k):
	n = int(input())
	print((n * n * n - n) // 3)


t = int(input())
for j in range(t):
	n = int(input())
	sum = 0
	ct = 1
	for i in range(3, n + 1, 2):
		sum += ct * 4 * (i - 1)
		ct += 1
	print(sum)


testcases = int(input())
for i in range(testcases):
	a = int(input())
	N = (a - 1) // 2
	counter = 0
	for i in range(1, N + 1):
		counter += 8 * i ** 2
	print(counter)


solutions = [0] * 500001
t = 0
for n in range(3, 500001, 2):
	t += 4 * (n - 1) * (n // 2)
	solutions[n] = t
t = int(input())
for _ in range(t):
	print(solutions[int(input())])


T = int(input())
for _ in range(T):
	N = int(input())
	res = 0
	half = N // 2
	total_depth = half
	for depth in range(1, total_depth + 1):
		count = half + 1 + (half - 1) - 2 * (depth - 1)
		res += count * (half - depth + 1)
	print(res * 4)


for _ in range(int(input())):
	n = int(input())
	prev = int(n / 2)
	count = 0
	total = 0
	if n == 1:
		print(0)
	else:
		for i in range(1, n, 2):
			total += i ** 2
		ans = prev * n ** 2 - total
		print(ans)


dp = [0] * 500001
Sum = 8
count = 1
for i in range(3, 500001, 2):
	dp[i] = dp[i - 2] + count * Sum
	Sum += 8
	count += 1
T = int(input())
for _ in range(T):
	n = int(input())
	print(dp[n])


import math

def ans(n):
	if n is 1:
		return 0
	x = 1 + (n - 3) // 2
	total = 0
	start = 8
	mul = 1
	for i in range(1, x + 1):
		start = 8 * mul
		mul += 1
		total = total + start * i
		pass
	return total
	pass
t = int(input())
while t > 0:
	n = int(input())
	print(ans(n))
	t -= 1


for _ in range(int(input())):
	n = int(input())
	k = n * n
	i = 1
	Ans = 0
	t = 8
	while k - t > 0:
		Ans += t * i
		k -= t
		t += 8
		i += 1
	print(Ans)


from collections import Counter, defaultdict, deque
from math import *
import sys
input = sys.stdin.readline
dp = [0, 8]
for i in range(5, 5 * 10 ** 5 + 11, 2):
	dp.append(dp[-1] + (i - 1) * 4 * (i // 2))

def solve():
	n = int(input())
	print(dp[n // 2])
tt = int(input())
for test in range(tt):
	solve()


test = int(input())
for i in range(test):
	n = int(input())
	if n == 3:
		print(8)
	elif n == 1:
		print(0)
	else:
		k = int((n - 1) / 2)
		expo = k * (k + 1) * (2 * k + 1) / 3
		to = k * (k + 1) / 2
		expo -= to
		ans = 4 * (expo + k * (k + 1) / 2)
		print(int(ans))


t = int(input())
for i in range(t):
	k = int(input())
	logic = 0
	k = k // 2
	logic = 4 * k * (k + 1) * (2 * k + 1) // 6
	print(logic * 2)
	i = i + 1


for x in range(int(input())):
	inp = int(input())
	if inp == 1:
		print(0)
	else:
		nu = inp ** 2 - 1
		i = 1
		res = 0
		while nu != 0:
			res += 8 * i ** 2
			nu -= 8 * i
			i += 1
		print(res)


from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

def ri():
	return int(input())

def rl():
	return list(map(int, input().split()))

def solve():
	n = ri()
	answer = 0
	half = (n + 1) // 2
	for i in range(1, half):
		ring = (2 * i + 1) ** 2 - (2 * i - 1) ** 2
		answer += i * ring
	print(answer)
mode = 'T'
if mode == 'T':
	t = ri()
	for i in range(t):
		solve()
else:
	solve()


from sys import *
from math import *
from bisect import *
from heapq import heappush, heappop
from itertools import combinations
from collections import deque
setrecursionlimit(100000000)
input = stdin.readline
lmi = lambda : list(map(int, input().split()))
mi = lambda : map(int, input().split())
si = lambda : input().strip('\n')
ssi = lambda : input().strip('\n').split()
for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		ans = 0
		cur = 8
		for i in range(1, n // 2 + 1):
			ans += cur * i
			cur += 8
		print(ans)


t = int(input())
for i in range(t):
	n = 0
	k = 0
	res = 0
	k = int(input())
	n = k // 2
	res = n * (n + 1) * (2 * n + 1) // 6
	print(res * 8)


def solve():
	n = int(input())
	moves = 0
	layer = 1
	for i in range(3, n + 1, 2):
		moves = moves + layer * (i * 2 + 2 * (i - 2))
		layer += 1
	print(moves)
t = int(input())
for _ in range(t):
	solve()


h = lambda x: 8 * x * (x - 1) * (x - 2) // 3 + 12 * x * (x - 1) + 8 * x

def solve():
	n = int(input())
	print(h(n // 2))
t = int(input())
for _ in range(t):
	solve()


test = int(input())

def solution(n):
	sum = 0
	while n > 1:
		sum += ((n - 2) * 4 + 4) * ((n - 1) // 2)
		n = n - 2
	return sum
for i in range(test):
	ca = int(input())
	if ca == 1:
		print(0)
	else:
		print(solution(ca))


t = int(input())
for _ in range(t):
	n = int(input())
	count = n * n
	res = 8
	if n == 1:
		print(0)
	else:
		i = 2
		limit = 8
		while limit < count:
			limit += 8 * i
			if limit > count:
				break
			res += 8 * i * i
			i += 1
		print(res)


for i in range(int(input())):
	n = int(input())
	n = pow(n, 2) - 1
	count = 0
	i = 1
	while n != 0:
		count += 8 * pow(i, 2)
		n -= 8 * i
		i += 1
	print(count)


import collections as cc
I = lambda : list(map(int, input().split()))
import sys
input = sys.stdin.readline
for tc in range(int(input())):
	(n,) = I()
	ans = 0
	temp = []
	while n != 1:
		ans = n * 4 - 4
		temp.append(ans)
		n -= 2
	ans = 0
	k = 1
	for i in temp[::-1]:
		ans += i * k
		k += 1
	print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print('0')
	elif n == 3:
		tp = 4 * n - 4
		ans = tp * (n // 2)
		print(ans)
	else:
		tp = 4 * n - 4
		ans = tp * (n // 2)
		n -= 2
		for i in range(n, 2, -2):
			tp = 4 * i - 4
			ans += tp * (i // 2)
		print(ans)


for f in range(int(input())):
	n = int(input())
	m = n // 2
	prev = 1
	cur = 3
	mov = 0
	for i in range(m):
		mov += (i + 1) * (cur ** 2 - prev ** 2)
		prev += 2
		cur += 2
	print(mov)


import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]
for _ in range(int(input())):
	n = int(input())
	ans = 0
	k = 0
	for i in range(n // 2 + 1):
		ans += k * i
		k += 8
	print(ans)


t = int(input())
for o in range(t):
	n = int(input())
	z = n // 2
	ans = 4 * (2 * z * z * z + 3 * z * z + z) // 3
	print(ans)


arr = [0 for i in range(5 * 10 ** 5 + 1)]
arr[3] = 8
for i in range(5, 5 * 10 ** 5 + 1):
	if i % 2 != 0:
		arr[i] = arr[i - 2] + (i * i - pow(i - 2, 2)) * (i // 2)
for i in range(int(input())):
	n = int(input())
	print(arr[n])


import math
t = int(input())
while t:
	t -= 1
	n = int(input())
	s = 0
	while n >= 3:
		s += 4 * (n - 1) * ((n - 1) // 2)
		n -= 2
	print(s)


t = int(input())
for j in range(t):
	n = int(input())
	kolca = n // 2 + 1
	hody = 0
	for i in range(kolca):
		p_kolca = 4 * 2 * i
		hody += p_kolca * i
	print(hody)


import sys
test = int(input())
for t in range(test):
	n = int(input())
	if n == 1:
		print('0')
	else:
		total = 0
		i = 1
		ring = 1
		while i < n:
			total += 2 * i * ring
			total += 2 * (i + 2) * ring
			i += 2
			ring += 1
		print(total)


import sys

def solve():
	t = int(input())
	for tests in range(0, t):
		n = int(input())
		ans = 0
		for i in range(1, int((n + 1) / 2)):
			ans += 8 * i * i
		print(ans)

def main():
	solve()
main()


import sys
input = sys.stdin.readline
from math import log2, log, ceil

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def nCr(n, k):
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return res

def upper_bound(a, x, lo=0):
	hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if a[mid] < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def primefs(n):
	primes = {}
	while n % 2 == 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(1000000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]
spf_sieve()

def factoriazation(x):
	ret = {}
	while x != 1:
		ret[spf[x]] = ret.get(spf[x], 0) + 1
		x = x // spf[x]
	return ret

def int_array():
	return list(map(int, input().strip().split()))

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
for _ in range(int(input())):
	n = int(input())
	x = (n - 1) // 2
	ans = 0
	for i in range(1, x + 1):
		ans += i * (8 * i)
	print(ans)


import sys

def solve(n):
	if n == 1:
		return 0
	total_move_cost = 0
	steps = n // 2
	num_of_squares = 8
	move_cost = 1
	for _ in range(1, steps + 1):
		total_move_cost += num_of_squares * move_cost
		num_of_squares = num_of_squares + 8
		move_cost += 1
	return total_move_cost
lines = sys.stdin.readlines()
for i in range(1, len(lines)):
	n = int(lines[i])
	print(solve(n))


import math

def pp(x, y):
	if y == 0:
		return 1
	t = pp(x, int(y / 2))
	if y % 2 == 0:
		return t * t
	elif y > 0:
		return x * t * t
	else:
		return t * t / x
for _ in range(int(input())):
	n = int(input())
	n = pp(n, 2) - 1
	m = 0
	p = 1
	while n > 0:
		m += pp(p, 2) * 8
		p += 1
		n -= p * 8
	print(m)


testcas = int(input())
for eachin in range(testcas):
	n = int(input())
	summ = 0
	for i in range(1, n // 2 + 1):
		summ = summ + 8 * i * i
	print(summ)


from sys import stdin, stdout
from math import gcd, ceil, sqrt
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
mod = 1000000007
tc = ii1()
for _ in range(tc):
	n = ii1()
	res = 0
	for i in range(1, n // 2 + 1):
		res += 8 * i ** 2
	print(res)


import io, os
R = lambda : map(int, input().split())
for _ in range(int(input())):
	n = int(input())
	ans = 0
	for i in range(n):
		ans += i * (i + 1)
	print(ans)


dp = []
for i in range(1, 500001):
	dp.append((i - 1) * (((i - 1) * 2 + 1) * 4 - 4))
s = 0
pref = []
for i in range(1, 500001):
	s += dp[i - 1]
	pref.append(s)
rw = int(input())
for weqeq in range(rw):
	n = int(input())
	print(pref[n // 2])


t = int(input())
list1 = []
for test_case in range(t):
	n = int(input())
	n = n // 2
	ans = 8 * n * (n + 1) * (2 * n + 1) * (1 / 6)
	list1.append(int(ans))
for items in list1:
	print(items)


dp = [1] * 250000
dp[0] = 0
t = 8
count = 1
for i in range(3, 500000, 2):
	dp[int(i // 2)] = dp[int(i // 2) - 1] + t * count
	t += 8
	count += 1
for _ in range(int(input())):
	N = int(input())
	print(dp[int(N // 2)])


def solve(n):
	mid = (1 + n // 2) * (n // 2)
	diff = 1
	ans = 0
	pre = mid
	for i in range(n // 2):
		pre += diff
		diff += 2
		ans += pre
	return ans * 2 + mid
t = int(input())
for i in range(t):
	n = int(input())
	print(solve(n))


for _ in range(int(input())):
	n = int(input())
	k = 3
	p = 1
	a = 8
	s = 0
	while k <= n:
		s = s + p * a
		a = a + 8
		p = p + 1
		k = k + 2
	print(s)


from functools import reduce
import sys

class Read:

	@staticmethod
	def string():
		return input()

	@staticmethod
	def int():
		return int(input())

	@staticmethod
	def list(delimiter=' '):
		return input().split(delimiter)

	@staticmethod
	def list_int(delimiter=' '):
		return list(map(int, input().split(delimiter)))

def main():
	t = Read.int()
	for _ in range(t):
		n = Read.int()
		res = 0
		while n != 1:
			res += (n * 2 + (n - 2) * 2) * (n // 2)
			n -= 2
		print(res)
main()


t = int(input())
for z in range(t):
	n = int(input())
	ans = 0
	count = 1
	for i in range(1, n, 2):
		dist = (4 * (i + 2) - 4) * count
		ans += dist
		count += 1
	print(ans)


for _ in range(int(input())):
	n = int(input())
	s = 0
	c = 3
	l = 1
	while c <= n:
		d = 2 * c + 2 * (c - 2)
		s += l * d
		l += 1
		c += 2
	print(s)


n = int(input())
for _ in range(n):
	k = int(input())
	buf = 8
	ans = 0
	for i in range(1, 1 + int(k / 2)):
		ans += i * buf
		buf += 8
	print(ans)


import sys
input = lambda : sys.stdin.readline().rstrip()
inp = sys.stdin.buffer.readline

def I():
	return list(map(int, inp().split()))
from heapq import *
for _ in range(I()[0]):
	(n,) = I()
	k = 3
	ans = 0
	for i in range(1, n // 2 + 1):
		ans += (2 * k + 2 * (k - 2)) * i
		k += 2
	print(ans)


test = int(input())
while test > 0:
	n = int(input())
	pos = int(n / 2)
	mov = int(pos * (pos + 1) * (2 * pos + 1) / 6)
	print(8 * mov)
	test = test - 1


for _ in range(int(input())):
	n = int(input())
	short = 8 * n // 2
	ans = 8 * (n // 2 * (n // 2 + 1) // 2)
	start = 2
	tot = n // 2 - 1
	ans2 = 0
	for i in range(n // 2 - 1):
		ans2 += tot * (2 * start + (tot - 1)) // 2
		tot -= 1
		start += 1
	print(ans + ans2 * 8)


t = int(input())
for i in range(t):
	n = int(input())
	p = 1
	sm = 0
	for j in range(3, n + 1, 2):
		sm += p * 4 * (j - 1)
		p += 1
	print(sm)


t = int(input())
for i in range(t):
	n = int(input())
	a = n ** 2
	d = a * (n - 1)
	c = d // 2
	b = 0
	for i in range(1, n, 2):
		b += i ** 2
	print(c - b)


def solve():
	n = int(input())
	if n == 1:
		print(0)
		return
	elif n == 3:
		print(8)
		return
	x = n // 2
	val = 2 * 4 * (x * (x + 1) // 2)
	left = n * n - (n * 4 - 3)
	sect = n // 2 - 1
	y = sect * (sect + 1) * (sect + 2) // 3
	print(val + y * 8)
	return
t = int(input())
for i in range(t):
	solve()


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def main():
	t = I()
	rr = []
	for _ in range(t):
		n = I()
		r = 0
		for i in range(1, n // 2 + 1):
			r += i * i * 2 * 4
		rr.append(r)
	return JA(rr, '\n')
print(main())


testy = int(input(''))
results = []
for i in range(0, testy):
	n = int(input(''))
	m = int((n - 1) / 2)
	tmp = m * (m + 1) * (2 * m + 1)
	results.append(int(tmp * 4 / 3))
for result in results:
	print(result)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, functools

def solve(line):
	n = int(line)
	nh = n // 2
	ans = 0
	for i in range(nh + 1):
		ans += i * 2 * i
	return ans * 4
T = int(sys.stdin.readline())
t = 0
while True:
	line = sys.stdin.readline().rstrip()
	if not line:
		break
	print(solve(line))
	t += 1


def main():
	t = int(input())
	for _ in range(t):
		x = int(input())
		n = (x - 1) // 2
		s = n * (n + 1) * (2 * n + 1) // 6
		print(s * 8)
main()


C = []
t = int(input())
for j in range(t):
	sum = 0
	n = int(input())
	for i in range(1, n // 2 + 1):
		sum += 8 * i * i
	C.append(sum)
for i in C:
	print(i)


def moves(n, p):
	ans = 0
	for i in range(1, n + 1, 2):
		ans += (i - 1) * 4 * p
		p = p + 1
	return ans
t = int(input())
p = 0
for i in range(0, t):
	n = int(input())
	print(moves(n, p))


import math, sys
from sys import stdin, stdout
from collections import Counter, defaultdict, deque
input = stdin.readline
I = lambda : int(input())
li = lambda : list(map(int, input().split()))

def solve():
	n = I()
	k = n * n - (4 * n - 3)
	n = n // 2
	s = n * (n + 1) // 2 * 8
	c = 2
	for i in range(n - 1):
		s += c * 2 * 4 * (i + 1)
		c += 1
	print(s)
for _ in range(I()):
	solve()


d = dict()
d[1] = 0
d[3] = 8
N = 5 * 10 ** 5 + 10
for i in range(5, N, 2):
	d[i] = d[i - 2] + i // 2 * (4 * i - 4)
t = int(input())
for i in range(t):
	n = int(input())
	print(d[n])


def solve(n):
	total = 0
	divs = n // 2
	for i in range(1, divs + 1):
		total += i * (i * 8)
	return total

def main():
	t = int(input())
	for i in range(t):
		n = int(input())
		ans = solve(n)
		print(ans)
main()


from sys import stdin, stdout
cin = stdin.readline
cout = stdout.write
for _ in range(int(cin())):
	n = int(cin())
	ans = 0
	y = (n - 1) // 2
	for i in range(y):
		ans += 8 * (i + 1) ** 2
	cout(str(ans) + '\n')


t = int(input())
for you in range(t):
	n = int(input())
	n = (n - 1) // 2
	sumi = 0
	for i in range(n):
		sumi += 8 * (i + 1) * (i + 1)
	print(sumi)


import math
Q = int(input())
II = 0
while II < Q:
	n = int(input())
	ans = 0
	for i in range(1, math.floor(n / 2) + 1):
		ans += i * 8 * i
	print(ans)
	II += 1


l = [0]
for i in range(5 * 10 ** 5 + 1):
	l.append(l[-1] + (4 * (2 * i + 3) - 4) * (i + 1))
for i in range(int(input())):
	n = int(input())
	print(l[n // 2])


def main():
	n = int(input())
	tot = 0
	for i in range(1, n // 2 + 1):
		tot += i * (2 * (4 * i + 1) - 2)
	print(tot)
t = int(input())
for i in range(t):
	main()


x = int(input())
while x > 0:
	n = int(input())
	s = n / 2
	sum = 0
	i = 1
	while i < s:
		sum += i * ((i * 2 + 1) * 2 + ((i - 1) * 2 + 1) * 2)
		i += 1
	print(sum)
	x -= 1


def show(n):
	sum = 0
	i = 1
	while i <= n:
		sum += (i - 1) / 2 * (i - 1) * 4
		i += 2
	return sum
n = int(input())
for _ in range(n):
	print(int(show(int(input()))))


t = int(input())
for t in range(t):
	n = int(input())
	if n == 1:
		print(0)
	else:
		n = n // 2
		result = 8 * (n + 1) * (2 * n + 1) * n
		print(result // 6)


def ip():
	return int(input())

def Ip():
	return map(int, input().split())
N = 500001
l = [0] * N
for i in range(3, N, 2):
	l[i] = l[i - 2] + 4 * (i - 1) * (i // 2)
for _ in range(0, int(input())):
	n = ip()
	print(l[n])


from sys import stdin, stdout

def solve():
	n = int(stdin.readline())
	n >>= 1
	return 4 * int(n * (n + 1) * (2 * n + 1) / 3)
for _ in range(int(stdin.readline())):
	stdout.write(str(solve()) + '\n')


t = int(input())
final = []
for z in range(t):
	n = int(input())
	sum = 0
	i = 1
	j = 1
	if n >= 3:
		for k in range(int((n - 1) / 2)):
			sum += i * 4 * (n - j)
			i += 1
			j += 1
	final.append(sum)
for z in range(t):
	print(final[z])


for case in range(int(input())):
	n = int(input())
	k = n // 2
	ans = 0
	for i in range(1, k + 1):
		ans += i * i
	print(ans << 3)


t = int(input())
for _ in range(t):
	n = int(input())
	x = int(n / 2)
	ans = 0
	ans += 2 * (x * (x + 1))
	ans += 4 * (int(2 * x * (x + 1) * (2 * x + 1) / 6) - int(x * (x + 1) / 2))
	print(ans)


def solve(n):
	s = 0
	for i in range(n // 2):
		kek = n - 2 * i
		lkek = kek * 2 + (kek - 2) * 2
		s += kek // 2 * lkek
	return s
[print(solve(*map(int, input().split()))) for t in range(int(input()))]


for _fuck in range(int(input())):
	sum = 0
	init = int(input())
	while init >= 3:
		sum += (init - 1) * (init - 1)
		init -= 2
	print(sum * 2)


for _ in range(int(input())):
	n = int(input())
	maxima = (n - 1) // 2
	result = 0
	for i in range(maxima + 1):
		result = result + i * 8 * i
	print(result)


import sys

def process():
	n = int(sys.stdin.readline().strip())
	s = 0
	for i in range(3, n + 1, 2):
		s += 2 * (i - 1) * (i - 1)
	print(s)
T = int(sys.stdin.readline())
for x in range(T):
	process()


from math import ceil
for _ in range(int(input())):
	n = int(input())
	c = 0
	for i in range(1, ceil(n / 2)):
		c = c + 8 * pow(i, 2)
	print(c)


t = int(input())
for tc in range(t):
	n = int(input())
	if n == 1:
		print(0)
		continue
	summ = 0
	count = 1
	for i in range(3, n + 1, 2):
		summ += count * (i ** 2 - (i - 2) ** 2)
		count += 1
	print(summ)


T = int(input().rstrip())
for _ in range(T):
	N = int(input().rstrip())
	moves = 0
	for i in range(0, (N + 1) // 2):
		moves += 8 * i * i
	print(moves)


def check(n):
	result = 0
	if n == 1:
		return 0
	while n > 1:
		x = (4 * n - 4) * (n // 2)
		result += x
		n -= 2
	return result
t = int(input())
while t:
	n = int(input())
	print(check(n))
	t -= 1


t = int(input())
for test in range(t):
	n = int(input())
	start = n // 2
	ans = 0
	k = 1
	for i in range(start, 0, -1):
		ans += (n - k) * 4 * i
		k += 2
	print(ans)


for _ in range(int(input())):
	n = int(input())
	summ1 = 0
	i = n
	j = 1
	while n > 0:
		summ1 = summ1 + (n - 1) * 4 * j
		n -= 2
		j += 1
	d = 1
	summ2 = 0
	n = i
	for i in range(2, n // 2 + 1):
		d = i * i - i
		summ2 = summ2 + d * 4
	print(summ1 + summ2)


for i in range(int(input())):
	n = int(input())
	x = 0
	y = n // 2
	for j in range(1, n // 2 + 1):
		x += (n - (2 * j - 1)) * 4 * y
		y -= 1
	print(x)


t = int(input())
import math
output = []
for _ in range(t):
	a = int(input())
	moves = 0
	for i in range(1, math.ceil(a / 2) + 1):
		moves += 2 * (i - 1) * 4 * (i - 1)
	output.append(moves)
for item in output:
	print(item)


import sys
import math
from collections import defaultdict

def solve(test):
	n = int(input())
	p = n // 2
	ans = 0
	for i in range(1, p + 1):
		ans += i * (8 * i)
	print(ans)
test_cases = int(input())
for t in range(1, test_cases + 1):
	solve(t)


for _ in range(int(input())):
	n = int(input())
	num1 = 0
	num2 = 0
	moves = 0
	k = n // 2 + 1
	for i in range(k):
		moves += num1 * i
		num1 += 8
	print(moves)


t = int(input())
for _ in range(t):
	n = int(input())
	summ = 0
	for i in range(3, n + 1):
		if i % 2 == 1:
			summ = summ + (i - 1) ** 2
	summ = summ * 2
	print(summ)


t = int(input())
dp = [0] * 5 * 10 ** 5
for j in range(t):
	n = int(input())
	q = 1
	for i in range(3, n + 2, 2):
		dp[i] = dp[i - 2] + (i ** 2 - (i - 2) ** 2) * q
		q += 1
	print(dp[n])


t = int(input())
while t:
	t -= 1
	ans = 0
	m = int(input())
	n = m - int((m + 1) / 2)
	l = 3
	for i in range(1, n + 1):
		ans += (l + l + (l - 2) * 2) * i
		l += 2
	print(ans)


for _ in range(int(input())):
	n = int(input())
	c = (n // 2, n // 2)
	s = 0
	for j in range(n):
		s += max(abs(c[0] - 0), abs(c[1] - j))
	ts = s
	for i in range(1, n // 2 + 1):
		s -= n - 2 * i
		ts += s
	print(ts * 2 - s)


for _ in range(int(input())):
	n = int(input())
	answer = 0
	i = 3
	count = 1
	prev = 1
	while i <= n:
		power = i ** 2
		answer += (power - prev) * count
		prev = power
		count += 1
		i += 2
	print(answer)


t = int(input())
for i in range(t):
	n = int(input())
	if n == 1:
		print(0)
		continue
	if n == 3:
		print(8)
		continue
	ans = 0
	while n != 1:
		if n != 3:
			ans += (4 * n - 4) * (n // 2)
		else:
			ans += 8
		n = n - 2
	print(ans)


import sys
input = sys.stdin.buffer.readline
t = int(input())
for _ in range(t):
	n = int(input())
	k = n // 2 + 1
	sums1 = 0
	sums2 = 0
	for i in range(k):
		sums1 += i * (2 * i + 1)
		sums2 += i
	print(4 * sums1 - 4 * sums2)


t = int(input())
N = 50 * 10005
ar = [(i * i - (i - 2) * (i - 2)) * (i // 2) for i in range(1, N, 2)]
for i in range(1, len(ar)):
	ar[i] = ar[i - 1] + ar[i]
for i in range(t):
	n = int(input())
	print(ar[n // 2])


t = int(input())
for _ in range(t):
	n = int(input())
	h = n // 2
	mid = h * (h + 1)
	res = mid * n + int(h * (h + 1) * (2 * h + 1) / 3)
	print(res)


def main():
	T = int(input())
	for _ in range(T):
		N = int(input())
		center = N // 2
		res = 0
		for i in range(1, center + 1):
			res += 8 * i * i
		print(res)
main()


for i in range(int(input())):
	print(sum((8 * i * i for i in range(int(input()) // 2 + 1))))


tests = int(input())
for i in range(tests):
	n = int(input())
	moves = 0
	surrondingSquares = 1
	for j in range(n // 2 + 1):
		moves += j * ((2 * j - 1) * 4 + 4)
	print(moves)


t = int(input())
for i in range(0, t):
	n = int(input())
	mid_cell = int((n - 1) / 2)
	k = n
	ans = 0
	for j in range(0, mid_cell):
		dist_mid_cell = mid_cell - j
		num_cells = 4 * k - 4
		k = k - 2
		ans = ans + num_cells * dist_mid_cell
	print(ans)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		s = 0
		count = 0
		for i in range(1, n, 2):
			s += i * i
			count += 1
		print(count * n * n - s)


l = [8 * i ** 2 for i in range(500002)]
ll = [0]
for i in range(1, 500002):
	ll += [ll[i - 1] + l[i]]
t = int(input())
while t:
	n = int(input())
	print(ll[n // 2])
	t -= 1


import sys
import math

def ii():
	return sys.stdin.readline().strip()

def idata():
	return [int(x) for x in ii().split()]

def solve_of_problem():
	n = int(ii())
	ans = n * n * (n // 2)
	for i in range(n - 1, 0, -1):
		ans -= i * i
	print(2 * ans)
	return
for ______ in range(int(ii())):
	solve_of_problem()


t = int(input())
for _ in range(t):
	n = int(input())
	terminal = n // 2
	Inc8 = 8
	ans = 0
	for i in range(1, terminal + 1):
		ans += i * Inc8
		Inc8 = 8 * (i + 1)
	print(ans)


inp = input()
num_cases = int(inp)

def memoize(func):
	mem = {}

	def f(arg, *args, **kwargs):
		if arg in mem:
			return mem[arg]
		else:
			resp = func(arg)
			mem[arg] = resp
			return resp
	return f

def generate_tiers(n):
	prev = 0
	for m in range(1, n + 1, 2):
		total = m ** 2
		yield (total - prev)
		prev = total
for _ in range(num_cases):
	n = int(input())
	moves = 0
	for (pieces, tier) in enumerate(generate_tiers(n)):
		moves += tier * pieces
	print(moves)


for _ in range(int(input())):
	n = int(input())
	sq = n * n
	sq = sq // 3
	sq = sq * n
	if n % 3 == 0:
		sq -= n // 3
		print(sq)
	else:
		print(sq)


from math import floor, ceil
t = int(input())
while t > 0:
	n = int(input())
	result = 0
	for i in range(ceil(n / 2)):
		if i != 0:
			result = result + ((2 * i + 1) * 4 - 4) * i
	print(result)
	t = t - 1


for r in range(int(input())):
	x = int(input())
	x = x // 2
	d = x * (x + 1) * (2 * x + 1) // 6
	d *= 8
	print(d)


def solve():
	m = (n + 1) // 2
	ans = 0
	for i in range(1, m):
		ans += 8 * i * i
	print(ans)
	return
t = int(input())
for i in range(1, t + 1):
	n = int(input())
	solve()


a = int(input())
for i in range(a):
	n = int(input())
	ans = [1]
	for i in range(1, n // 2 + 1):
		if i == 1:
			ans.append(8)
		else:
			ans.append(ans[-1] + 8)
	total = 0
	for i in range(len(ans)):
		total += ans[i] * i
	print(total)


t = int(input())
for i in range(0, t):
	n = int(input())
	answer = 0
	pos = (n - 1) // 2
	answer = pos * (pos + 1) * (2 * pos + 1) // 6
	answer *= 8
	print(answer)


ans = ''
for _ in range(int(input())):
	n = int(input())
	v = 8
	mov = 0
	for i in range(1, n // 2 + 1):
		mov += i * v
		v += 8
	ans += str(mov) + '\n'
print(ans)


for _ in ' ' * int(input()):
	a = int(input())
	z = a // 2
	s = 0
	for i in range(z, 0, -1):
		s += i * (2 * a + 2 * (a - 2))
		a -= 2
	print(s)


try:
	count = int(input())
	while count > 0:
		n = int(input())
		t = n / 2 - 1
		i = 1
		p = 8
		sum = 0
		while t > 0:
			sum = sum + i * p
			i = i + 1
			p = p + 8
			t = t - 1
		print(sum)
except EOFError as e:
	print('')


t = int(input())

def board_moves(n):
	ans = 0
	if n == 1:
		return 0
	if n == 3:
		return 8
	m = n // 2
	for i in range(1, m + 1):
		dis = i
		cells = 8 * i
		ans += dis * cells
	return ans
for _ in range(t):
	n = int(input())
	print(board_moves(n))


try:
	t = int(input())
	for i in range(t):
		n = int(input())
		sum = 0
		if n == 1:
			print(0)
		else:
			p = 1
			while n > 1:
				sum = sum + p * (8 * p)
				p = p + 1
				n = n - 2
			print(sum)
except Exception as e:
	pass


for _ in range(int(input())):
	n = int(input())
	x = n // 2
	s = x * (x + 1) * (2 * x + 1) * 4 // 3
	print(s)


t = int(input())

def fn(n):
	if n == 3:
		return 8
	elif n == 1:
		return 0
	else:
		a = (n / 2 + 1) * 8
		return a
for i in range(t):
	n = int(input())
	a = 8 * (n // 2 * (n // 2 + 1) * (2 * (n // 2) + 1)) / 6
	print(int(a))


for i in range(int(input())):
	q = int(input())
	w = q // 2
	print(8 * w * (w + 1) * (2 * w + 1) // 6)


a = int(input())
for _ in range(a):
	b = int(input())
	c = 0
	for i in range(1, b // 2 + 1):
		c = c + i ** 2 * 8
	print(c)


for t in range(int(input())):
	n = int(input())
	ans = (n - 1) * n * (n + 1) // 3
	print(ans)


for _ in range(int(input())):
	N = int(input())
	answer = 0
	upper = 1
	while N - 2 > 0:
		answer += upper * (8 * upper)
		upper += 1
		N -= 2
	print(answer)


T = int(input())
for t in range(T):
	n = int(input())
	steps = 0
	sections = n // 2
	for sec in range(1, sections + 1):
		steps += sec * (1 + 2 * sec + 2 * (1 + 2 * sec - 1) + (1 + 2 * sec) - 2)
	print(steps)


for _ in range(int(input())):
	n = int(input())
	res = 0
	for i in range(1, n + 1):
		res += i * (i - 1) * 4
	print(res // 4)


n = int(input())
for i in range(0, n):
	o = int(input())
	if o == 1:
		print(0)
	elif o == 3:
		print(8)
	else:
		A = o // 2
		tot = A * (A + 1) // 2 * 2
		S = 1
		V = tot
		for j in range(0, o // 2):
			tot += (V + S) * 2
			S += 2
			V = V + (S - 2)
		print(tot)


def main():
	a = [8 * n ** 2 for n in range(500000)]
	for i in range(1, 500000):
		a[i] += a[i - 1]
	for _ in range(int(input())):
		print(a[int(input()) // 2])
main()


for i in range(int(input())):
	n = int(input())
	s = 0
	p = 0
	for i in range(1, n + 1, 2):
		cb = i * 4 - 4
		s += cb * p
		p += 1
	print(s)


for nt in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
		continue
	ans = 0
	k = 3
	for i in range(1, n // 2 + 1):
		ans += i * (4 * k - 4)
		k += 2
	print(ans)


t = int(input())
while t:
	n = int(input())
	sum = 0
	p = n // 2
	q = p * (p + 1) // 2 * 4
	sum += q
	r = 2 * p - 1
	m = p
	e = 0
	for i in range(r, 0, -2):
		e += i * p
		p = p - 1
	sum += e * 4
	print(sum)
	t = t - 1


def func(v, n, i):
	t = 0
	while v >= n:
		t += i * 4 * (n - 1)
		n += 2
		i += 1
	return t
t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	print(func(n, 1, 0))


from collections import Counter
t = int(input())
while t > 0:
	t = t - 1
	n = int(input())
	a = [0] * n
	for i in range(2, n, 2):
		a[i] = a[i - 2] + (i + 1) // 2 * (4 * i)
	print(a[n - 1])


def solve():
	n = int(input())
	m = n + 1 >> 1
	res = m * (m + 1) * (2 * m + 1)
	res /= 6
	res -= m * m
	print(int(8 * res))
t = int(input())
for _ in range(t):
	solve()


ans = [0]
for i in range(1, 250000):
	ans.append(ans[i - 1] + i * i * 8)
t = int(input())
for _ in range(t):
	n = int(input())
	print(ans[n // 2])


import math
from sys import stdin, stdout
from heapq import heapify, heappop, heappush
from collections import Counter
T = int(stdin.readline())
for i in range(T):
	N = int(stdin.readline())
	if N == 1:
		print(0)
		continue
	ans = 0
	cd = 1
	ml = 8
	r = 1
	c = 1
	while cd < N * N:
		ans += ml * r * c
		cd += ml * r
		r += 1
		c += 1
	print(ans)


for tc in range(0, int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		moves = 0
		i = 1
		for x in range(3, n + 1, 2):
			moves += 2 * (x * i) + 2 * ((x - 2) * i)
			i += 1
		print(moves)


t = int(input())
s = int(5 * 100000.0 + 1)
pre = [0] * s
for i in range(1, s):
	if i & 1:
		pre[i] = (4 * (i - 2) + 4) * (i // 2)
	pre[i] += pre[i - 1]
for _ in range(t):
	print(pre[int(input())])


def f(n, N):
	return 4 * (n - 2) + (N - n + 1) + f(n - 2, N)
for t in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
		continue
	res = 0
	for i in range(3, n + 1, 2):
		res += 4 * ((i - 2) // 2 + 1) ** 2 + 4 * (i // 2) ** 2
	print(res)


from __future__ import division, print_function
import sys
from sys import stdin, stdout
import bisect
from bisect import bisect_left as bl
from bisect import bisect_right as br
import itertools
from collections import Counter
import collections
import math
import heapq
import re

def modinv(n, p):
	return pow(n, p - 2, p)

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())

def Divisors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l

def most_frequent(list):
	return max(set(list), key=list.count)

def GCD(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def ncr(n, r, p):
	t = fact[n] * (ifact[r] * ifact[n - r] % p) % p
	return t

def Convert(string):
	li = list(string.split(''))
	return li

def SieveOfEratosthenes(n):
	global prime
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	f = []
	for p in range(2, n):
		if prime[p]:
			f.append(p)
	return f
prime = []
q = []

def dfs(n, d, v, c):
	global q
	v[n] = 1
	x = d[n]
	q.append(n)
	j = c
	for i in x:
		if i not in v:
			f = dfs(i, d, v, c + 1)
			j = max(j, f)
	return j

def main():
	for _ in range(inin()):
		n = inin()
		count = 0
		m = n // 2
		for i in range(n // 2 + 1):
			count += 8 * i * i
		print(count)
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


test = int(input())
for _ in range(test):
	n = int(input())
	moves = 0
	for i in range(n // 2 + 1):
		moves += 8 * i ** 2
	print(moves)


for _ in range(int(input())):
	cuc = int(input())
	print((cuc ** 3 - cuc) // 3)


t = int(input())
for _ in range(t):
	n = int(input())
	rings = int((n - 3) / 2 + 1)
	temp = 0
	i = 1
	total = 0
	while i <= rings:
		temp = temp + 8
		total = total + temp * i
		i = i + 1
	print(total)


for _ in range(int(input())):
	x = int(input())
	if x == 1:
		print(0)
	else:
		coun = 0
		x = x // 2
		for i in range(1, x + 1):
			z = 2 * i + 1
			summ = z * 2 + 2 * (z - 2)
			coun += summ * i
		print(coun)


import sys
readline = sys.stdin.readline
readall = sys.stdin.read
ns = lambda : readline().rstrip()
ni = lambda : int(readline().rstrip())
nm = lambda : map(int, readline().split())
nl = lambda : list(map(int, readline().split()))
prn = lambda x: print(*x, sep='\n')

def solve():
	n = ni()
	c = 0
	for i in range(n // 2):
		c += (i + 1) * (i + 1) * 2 * 4
	print(c)
	return
T = ni()
for _ in range(T):
	solve()


T = int(input())
while T != 0:
	T -= 1
	m = int(input())
	n = (m + 1) // 2
	ans = (n - 1) * n * m * 2
	print(ans // 3 * 2)


for _ in range(int(input())):
	n = int(input())
	c = 0
	if n == 1:
		c = 0
	else:
		p = n // 2
		q = n
		while p > 0:
			c += (4 * q - 4) * p
			p -= 1
			q -= 2
	print(c)


T = int(input())
for i in range(T):
	N = int(input())
	if N == 1:
		print(0)
	else:
		c = N // 2
		print(int(8 * c * (c + 1) * (2 * c + 1) / 6))


def int_input():
	return int(input())

def ints_input():
	return (int(x) for x in input().split())
t = int_input()
for _ in range(t):
	n = int_input()
	l0 = n // 2 * (n // 2 + 1)
	ans = l0
	for i in range(n // 2):
		l0 += 1 + 2 * i
		ans += 2 * l0
	print(ans)


for _ in range(int(input())):
	n = int(input())
	a = [0] * (n // 2 + 1)
	temp = 8
	for i in range(1, n // 2 + 1):
		a[i] = temp * i
		temp += 8
	print(sum(a))


def num_cells(boundary):
	return (boundary - 2) * 4 + 4
for i in range(int(input())):
	n = int(input())
	tot = 0
	for (times, side) in enumerate(range(1, n + 1, 2)):
		tot += num_cells(side) * times
	print(tot)


t = int(input())
for _ in range(t):
	n = int(input())
	ans = 0
	for i in range(1, n // 2 + 1):
		si = 2 * i + 1
		psi = 2 * (i - 1) + 1
		ans += (si ** 2 - psi ** 2) * i
	print(ans)


for _ in range(int(input())):
	n = int(input())
	d = n // 2
	cnt = 0
	for i in range(d):
		cnt += (d - i) * ((n - 2 * i) ** 2 - (n - 2 * i - 2) ** 2)
	print(cnt)


for ii in range(int(input())):
	n = int(input())
	ans = 0
	for i in range(n // 2 + 1):
		ans += pow(i, 2)
	print(8 * ans)


def solution(a):
	ans = 0
	area = 0
	for i in range(a // 2 + 1):
		ans += area * i
		area = area + 8
	return ans
import sys
iput = sys.stdin.readline
for x in range(int(iput())):
	A = int(iput())
	print(solution(A))


def ans(n):
	if n % 2 == 1:
		m = n // 2
		a = 0
		for i in range(1, m + 1):
			a += i * (2 * i - 1)
		a += (m + 1) * m // 2
		a *= 4
		return a
o = int(input())
for i in range(o):
	n = int(input())
	print(ans(n))


import collections

def solve(n):
	ans = 0
	k = 0
	for i in range(n // 2 + 1):
		ans += i * k
		k += 8
	return ans
t = int(input().strip())
for i in range(t):
	n = int(input().strip())
	print(solve(n))


import sys
from collections import deque, defaultdict as dd
from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right
from itertools import permutations
from datetime import datetime
from math import ceil, sqrt, log, gcd

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def read():
	tc = 0
	if tc:
		input = sys.stdin.readline
	else:
		sys.stdin = open('input1.txt', 'r')
		sys.stdout = open('output1.txt', 'w')

def solve():
	for _ in range(ii()):
		n = ii()
		c = 1
		s = 0
		j = 1
		k = 8
		for i in range(n // 2):
			s += k * j
			k += 8
			j += 1
		print(s)
solve()


t = int(input())
while t:
	n = int(input())
	ans = 0
	while n != 1:
		k = (n + 1) // 2 - 1
		c = n ** 2 - (n - 2) ** 2
		ans += k * c
		n = n - 2
	print(ans)
	t -= 1


for case in range(int(input())):
	n = int(input())
	k = n >> 1
	print(k * (k + 1) * (2 * k + 1) // 6 << 3)


class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: gcd(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from bisect import bisect_right, bisect_left
from fractions import Fraction

def pre(s):
	n = len(s)
	pi = [0] * n
	for i in range(1, n):
		j = pi[i - 1]
		while j and s[i] != s[j]:
			j = pi[j - 1]
		if s[i] == s[j]:
			j += 1
		pi[i] = j
	return pi

def prod(a):
	ans = 1
	for each in a:
		ans = ans * each
	return ans
from math import gcd

def lcm(a, b):
	return a * b // gcd(a, b)

def binary(x, length=16):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y
for _ in range(int(input())):
	n = int(input())
	n = n // 2
	print(8 * n * (n + 1) * (2 * n + 1) // 6)


def solve(n):
	sum_ = 0
	k = int((n - 1) / 2)
	for i in range(1, k + 1):
		sum_ += i ** 2
	sum_ = sum_ * 4 * 2
	return str(sum_)
answers = []
t = int(input())
for i in range(t):
	n = int(input())
	answers.append(solve(n))
print('\n'.join(answers))


t = int(input(''))
for i in range(t):
	n = int(input(''))
	m = n // 2
	sums = 0
	for j in range(1, m + 1):
		sums += j * (8 * j)
	print(sums)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
		continue
	n = n // 2
	soma = 0
	mult = 1
	quad = 8
	while n > 0:
		soma += quad * mult
		quad += 8
		mult += 1
		n -= 1
	print(soma)


t = int(input())
while t > 0:
	n = int(input())
	k = 0
	p = 1
	w = 8
	for i in range(0, n // 2):
		k += w * p
		p = p + 1
		w = w + 8
	print(k)
	t = t - 1


for _ in range(int(input())):
	n = int(input())
	k = n // 2
	ans = 8 * (2 * k ** 3 + 3 * k ** 2 + k) // 6
	print(ans)


t = int(input())
for z in range(t):
	n = int(input())
	if n == 1:
		print(0)
	elif n == 3:
		print(8)
	else:
		summ = 8
		ind = 2
		l = int(n / 2) - 1
		k = 3
		for i in range(l):
			f = ((k + 2) * 2 + k * 2) * ind
			summ += f
			k += 2
			ind += 1
		print(summ)


t = int(input())
for _ in range(t):
	n = int(input())
	count = 8
	cost = 1
	total = 0
	i = n // 2 - 1
	while i >= 0:
		total += count * cost
		count += 8
		cost += 1
		i -= 1
	print(total)


def read():
	return list(map(int, input().split()))
for i in range(int(input())):
	n = int(input())
	ans = 0
	p = 0
	for i in range(n // 2):
		ans += (n - 2 * i - 1) * 4 * (n // 2 - i)
	print(ans)


def f(n):
	return 2 * n + 2 * (n - 2)
t = int(input())
while t:
	n = int(input())
	moves = 0
	if n == 1:
		print(0)
	elif n == 3:
		print(8)
	else:
		moves = 8
		k = 2
		i = 5
		while i <= n:
			moves += k * f(i)
			k += 1
			i += 2
		print(moves)
	t -= 1


for i in range(int(input())):
	n = int(input())
	cnt = 1
	ans = 0
	if n == 1:
		print(0)
	else:
		for i in range(3, n + 1, 2):
			if i == 3:
				ans += cnt * 8
				cnt += 1
			else:
				ans += cnt * (4 * i - 4)
				cnt += 1
		print(ans)


array = {}
array[1] = 0
sum = 0
cnt = 8
pos = 1
for i in range(1, 5 * 10 ** 5 + 1):
	sum += i * cnt
	array[pos + 2] = sum
	pos += 2
	cnt += 8
for _ in range(int(input())):
	n = int(input())
	print(array[n])


t = int(input())
while t:
	n = int(input())
	if n == 1:
		print(0)
	else:
		count = 1
		ans = 0
		for i in range(3, n + 1, 2):
			ans += (i * 2 + (i - 2) * 2) * count
			count += 1
		print(ans)
	t -= 1


import math
import atexit
import io
import sys
_OUTPUT_BUFFER = io.StringIO()
sys.stdout = _OUTPUT_BUFFER

@atexit.register
def write():
	sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())

def array_to_string(a):
	s = ''
	for i in a:
		s += str(i) + ' '
	return s[0:len(s) - 1]

def isPrime(n):
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return 0
	return 1

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def lcm(a, b):
	return a * b / gcd(a, b)
t = int(input())
while t > 0:
	t = t - 1
	n = int(input())
	center = n // 2 + 1
	dis = n // 2
	k = n
	s = 0
	while k > 1:
		blocks = 2 * k + 2 * (k - 2)
		s += blocks * dis
		k -= 2
		dis -= 1
	print(s)


T = int(input())
for i in range(T):
	n = int(input())
	if n == 1:
		print('0')
	elif n == 3:
		print('8')
	else:
		pos = n // 2
		k = 1
		ans = 8
		res = 0
		while pos != k - 1:
			res = res + ans * k * k
			k += 1
		print(res)


t = int(input())
for _ in range(t):
	n = int(input())
	a = (n - 1) // 2
	ans = 0
	for I in range(1, a + 1):
		b = 2 * I + 1
		c = b - 2
		ans += (b * b - c * c) * I
	print(ans)


T = input()
t = int(T)
for i in range(0, t):
	N = input()
	n = int(N)
	n = int((n - 1) / 2)
	sum1 = 0
	for j in range(1, n + 1):
		sum1 += 8 * j * j
	print(sum1)


input1 = input()
input1 = int(input1)
for i in range(input1):
	n = int(input())
	ans = 0
	blocks = 0
	for j in range(n, 1, -2):
		blocks = blocks + 4 * (j - 1)
		ans = ans + blocks
	print(ans)


t = int(input())
DP = []
DP.append(0)
for i in range(1, 250004):
	DP.append(DP[i - 1] + 4 * (i * 2) * i)
for i in range(t):
	n = int(input())
	print(DP[n // 2])


from math import *
t = int(input())
m = []
for i in range(t):
	x = list(map(int, input().split()))
	m.append((x[0] - 1) / 2)
for i in range(t):
	a = m[i]
	print(int(8 * a * (a + 1) * (2 * a + 1) / 6))


from sys import stdin, stdout
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	ans = 0
	for i in range(1, n // 2 + 1):
		ans += i * (4 * (2 * i + 1) - 4)
	stdout.write(str(ans) + '\n')


t = int(input())
while t:
	n = int(input())
	a = n // 2
	s = a * (a + 1) * (2 * a + 1) // 6
	c = 8 * s
	print(c)
	t -= 1


t = int(input())
for i in range(t):
	num = int(input())
	k = (num - 1) / 2
	if num == 1:
		print('0')
		continue
	result = 4 * k * (k + 1) * (2 * k + 1) / 3
	print(int(result))
	continue


c = int(input())
for _ in range(c):
	n = int(input())
	lines = n // 2
	sum = 0
	for i in range(1, lines + 1):
		sum += 8 * i * i
	print(sum)


t = int(input())
w = []
for i in range(t):
	n = int(input())
	if n == 1:
		s = 0
		w.append(s)
	else:
		k = n // 2
		s = 8 * k * (k + 1) * (2 * k + 1) / 6
		rt = int(s)
		w.append(rt)
for wer in w:
	print(wer)


t = int(input())
l = []
for i in range(t):
	s1 = int(input())
	l.append(s1)
for s in l:
	s2 = 0
	c = (s - 1) // 2
	for i in range(1, c + 1):
		s2 = s2 + i ** 2
	print(s2 * 8)


def read_int():
	return int(input())

def read_ints():
	return map(int, input().split(' '))
t = read_int()
for case_num in range(t):
	n = read_int()
	x = n // 2
	ans = x * (x + 1) * (2 * x + 1) // 6
	print(ans * 8)


for _ in range(int(input())):
	n = int(input())
	mid = (n + 1) // 2
	s = 0
	c = 8
	k = 1
	x = 1
	for i in range(1, mid):
		s += c * x * k
		x += 1
		k += 1
	print(s)


import sys
import math

def inputnum():
	return int(input())

def inputnums():
	return map(int, input().split())

def inputlist():
	return list(map(int, input().split()))

def inputstring():
	return [x for x in input()]
t = int(input())
for q in range(t):
	n = inputnum()
	ans = 0
	cur = n - 1
	temp = n // 2
	while cur >= 2:
		ans += cur * temp
		cur -= 2
		temp -= 1
	print(4 * ans)


TT = int(input())
for _ in range(TT):
	n = int(input())
	ans = 0
	cost = 1
	for i in range(1, n // 2 + 1):
		ans += 8 * i * cost
		cost += 1
	print(ans)


t = int(input())
res = []
for i in range(t):
	n = int(input())
	summ = 0
	for j in range(3, n + 1):
		if j % 2 == 1:
			summ += (j - 1) ** 2
	res.append(summ * 2)
for i in res:
	print(i)


x = int(input())
for xa in range(x):
	p = int(input())
	q = (p + 1) // 2
	q = p - q
	ma = 0
	while p > 1:
		ma += (p ** 2 - (p - 2) ** 2) * q
		q -= 1
		p -= 1
		p -= 1
	print(ma)


t = int(input())
for ti in range(t):
	n = int(input())
	if n == 1:
		print(0)
	elif n == 3:
		print(8)
	else:
		summ = 0
		add = 0
		for i in range(n // 2 + 1):
			summ += i ** 2
		summ *= 8
		print(summ)


t = int(input())
for j in range(t):
	n = int(input())
	a = (n - 1) // 2
	b = (n - 1) // 2 + 1
	c = 0
	for i in range(a):
		c += i * (i + 1)
		c += (i + 1) * ((a - i - 1) * 2 + 1)
	c *= 4
	c += 2 * a * (a + 1)
	print(c)


kl = int(input())
for l in range(kl):
	n = int(input())
	s = 0
	for i in range(1, n // 2 + 1):
		s += 8 * i * i
	print(s)


t = int(input())
for _ in range(t):
	n = int(input())
	ans = 0
	steps = n // 2
	for side in range(n, 1, -2):
		ans += (side * 4 - 4) * steps
		steps -= 1
	print(ans)


T = int(input())
for _ in range(T):
	N = int(input()) // 2
	output = 8 * N * (N + 1) * (2 * N + 1) // 6
	print(output)


from itertools import accumulate
t = int(input())
for i in range(t):
	n = int(input())
	s = 0
	for i in range(3, 1 + n, 2):
		s += 8 * (i // 2) ** 2
	print(s)


a = int(input())
for i in range(a):
	ans = 0
	t = int(input())
	t = t // 2
	ans = t * (t + 1) * (2 * t + 1) // 6
	print(ans * 8)


def main(n):
	sum = 0
	for i in range(n // 2):
		sum += (i + 1) ** 2 * 8
	return sum
t = int(input())
for i in range(t):
	n = int(input())
	print(main(n))


import math
for _ in range(int(input())):
	n = int(input())
	ans = 0
	p = 0
	for i in range(1, n + 1, 2):
		ans += (math.pow(i, 2) - math.pow(i - 2, 2)) * p
		p += 1
	print(int(ans))


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(0)
	else:
		n = int(n // 2)
		x = n * (n + 1) * (2 * n + 1) * 8
		x = x // 6
		print(x)


for _ in range(int(input())):
	n = int(input())
	sum = 0
	sum += n // 2 * n
	l = sum
	z = n - 2
	for i in range(1, n // 2):
		sum += l - z
		l -= z
		z = z - 2
	sum1 = n // 2
	sum = sum * 2
	sum += (sum1 + 1) * sum1 // 2 * 2
	print(sum)


t = int(input())
while t:
	i = 1
	n = int(input())
	sum = 0
	while i < n:
		sum = sum + ((i + 2) * (i + 2) - i * i) * ((i + 1) / 2)
		i = i + 2
	t -= 1
	print('%d' % sum)


import sys
input = sys.stdin.readline
import heapq
import copy
import math

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

class Node:

	def _init_(self, val):
		self.data = val
		self.left = None
		self.right = None

def bin_search(arr, l, r, val):
	if arr[r] <= val:
		return r + 1
	if r - l < 2:
		if arr[l] > val:
			return l
		else:
			return r
	mid = int((l + r) / 2)
	if arr[mid] <= val:
		return bin_search(arr, mid, r, val)
	else:
		return bin_search(arr, l, mid, val)

def pr_list(a):
	print(*a, sep=' ')

def find_permut(hashm, l):
	ans = 1
	total = math.factorial(l)
	for i in hashm:
		if i != 0:
			ans = ans * math.factorial(i)
	return int(total / ans)

def main():
	tests = inp()
	mod = 1000000007
	limit = 10 ** 18
	for test in range(tests):
		ans = 0
		n = inp()
		m = int((n - 1) / 2)
		for i in range(1, m + 1):
			ans = ans + i * ((2 * i + 1) * 2 + (2 * (i - 1) + 1) * 2)
		print(ans)
main()


import sys

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def input():
	return sys.stdin.readline().strip()
for _ in range(int(input())):
	n = int(input())
	a = n // 2
	ans = 0
	for i in range(1, a + 1):
		ans = ans + 8 * i * i
	print(ans)


T = int(input())
for tc in range(T):
	n = int(input())
	k = (n - 1) // 2
	moves = 4 * k * (k + 1) * (2 * k + 1) // 3
	print(moves)


n = int(input())
for _ in range(n):
	t = int(input())
	ans = 0
	m = 2
	x = 1
	while m < t:
		ans += m * x
		m += 2
		x += 1
	print(4 * ans)


def solve(n):
	m = n // 2
	moves = 8 * m * (m + 1) * (m * 2 + 1)
	print(int(moves / 6))
t = int(input())
for i in range(t):
	solve(int(input()))