You are given a sorted array of integers $$$[a_1, a_2, \dots, a_n]$$$. We can perform any number of operations of the following type on this array:
For example, consider the array $$$[\mathbf{1}, 1, 1, \mathbf{2}, \mathbf{4}, 4, \mathbf{5}]$$$ (marked elements are shown in bold). If we delete all marked elements, we get $$$[1, 1, 4]$$$, and if we duplicate them, we get $$$[1, 1, 1, 1, 2, 2, 4, 4, 4, 5, 5]$$$.
The operations cannot be performed if the array becomes empty. After each operation, every element gets unmarked.
We call an array of integers $$$b$$$ reachable if it can be obtained from array $$$a$$$ by some number of the described operations. Your task is to count the number of reachable arrays of length $$$k$$$.
The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases.
Each test case consists of two lines:
Additional constraint on the input: the sum of $$$n$$$ over all test cases does not exceed $$$3 \cdot 10^5$$$.
For each test case, output one integer — the number of reachable arrays $$$b$$$ of length $$$k$$$. It can be shown that, under the constraints of the problem, the answer fits into a standard $$$32$$$-bit integer type.
101 514 51 1 2 23 11 1 14 81 2 3 48 61 1 1 2 2 2 2 26 31 1 2 2 3 310 71 1 1 2 2 3 3 3 3 412 51 1 1 1 2 2 2 3 3 4 4 46 51 1 2 2 3 33 11 2 2
1011212101
In the first example, the following sequence of operations can be performed:
In the second example, it is impossible to obtain an array of length $$$5$$$.
In the third example, the following sequence of operations can be performed:
In the fifth example, the arrays $$$[1, 1, 2, 2, 2, 2]$$$ and $$$[2, 2, 2, 2, 2, 2]$$$ can be obtained:
In the seventh example, the arrays $$$[1, 1, 1, 3, 3, 3, 3]$$$ and $$$[3, 3, 3, 3, 3, 3, 3]$$$ can be obtained.