You are given an array $$$a$$$ of $$$n$$$ positive integers $$$a_1, a_2, \ldots, a_n$$$.
You may repeatedly apply the following operation:
You must keep applying the operation until there is no valid index where the operation can be applied. That is, you must apply the operation until no two adjacent elements in the array sum up to an odd number. The resulting array is called terminal. Depending on the order in which you perform the operations, you can end up with different terminal arrays.
Consider every terminal array reachable from $$$a$$$ through some sequence of operations. Determine how many distinct lengths these terminal arrays can have.
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases.
The first line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 3 \cdot 10^5$$$) — the length of the array.
The second line contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$1 \le a_i \le 10^9$$$) — the elements of the array.
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$3 \cdot 10^5$$$.
For each test case, output a single integer — the number of distinct lengths a terminal array reachable from $$$a$$$ can have.
233 5 741 2 3 4
12
In the first test case, every adjacent pair sums up to an even number, so no operation can be performed. The array is already terminal, and the only reachable length is $$$3$$$.
In the second test case, different orders of operations can leave arrays of different lengths. For instance:
Only lengths $$$1$$$ and $$$2$$$ can be reached, so the answer is $$$2$$$.
| Name |
|---|


