Just like us, letters grow too.
Define $$$F_0 = \mbox{"a"}; F_i = F_{i-1} + \mbox{"b"} + F_{i-1}$$$ for all $$$i \ge 1$$$.
For example, $$$F_1 = F_0 + \mbox{"b"} + F_0 = \mbox{"aba"}$$$.
You are given a string $$$S$$$, but since it can be very large, it is described as an array $$$a$$$ of $$$n$$$ integers, where $$$S = F_{a_1} + F_{a_2} + ... + F_{a_n}$$$.
For example, for $$$a = \{1, 0, 0\}, S = \mbox{"aba" + "a" + "a" = "abaaa"}$$$.
The letters in $$$S$$$ merge and grow together. This is done as follows:
For example, for $$$S = \mbox{"abaaaaba"}$$$, the growing process goes as follows:
$$$\mbox{ab(aa)aaba} \rightarrow \mbox{ab(b)aaba}$$$
$$$\mbox{a(bb)aaba} \rightarrow \mbox{a(c)aaba}$$$
$$$\mbox{ac(aa)ba} \rightarrow \mbox{ac(b)ba}$$$
$$$\mbox{ac(bb)a} \rightarrow \mbox{ac(c)a}$$$
$$$\mbox{a(cc)a} \rightarrow \mbox{a(d)a}$$$
Can you find the size of $$$S$$$ after the growing process is complete?
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ $$$(1 \le t \le 10^4)$$$. The description of the test cases follows.
The first line of each test case contains a single integer $$$n$$$ $$$(1 \le n \le 10^5)$$$ – The size of the array.
The second line of each test case contains $$$n$$$ integers $$$a_1, a_2, ..., a_n$$$ $$$(0 \le a_i \le 15)$$$ – The elements of the array.
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^5$$$
For each test case, output a single integer, the size of $$$S$$$ after the growing process.
341 0 0 180 0 0 0 0 0 0 030 3 0
3 1 13
The first test case is described in the example in the statement.
In the second test case, $$$S = \mbox{"aaaaaaaa"}$$$. It grows into $$$\mbox{"d"}$$$.