Brackets parade#230

Brackets parade

1 second
128 megabytes
Very easy

Find the number of different correct bracket sequences consisting of k_1 pairs of brackets of the first type, k_2 pairs of brackets of the second type, ..., k_m pairs of brackets of the -th type.

A bracket sequence is considered correct if:

Input

The first line contains the number of test cases (0 < n \leq 1000). Each of the following lines describes a test case. Each line starts with the number (0 < m \leq 100), the number of different types of brackets. Then positive integers k_1, k_2, \ldots, k_m follow, each separated by a space. Here, k_i is the number of pairs of brackets of the -th type. The total number of bracket pairs does not exceed .

Output

For each test case, output a line containing a single integer: the answer to the problem modulo .

Examples

Example 1

Loading
Loading