Each test contains multiple test cases. The first line contains the number of test cases $T(1 \le T \le 20)$. Description of the test cases follows.
The first line contains two integers $n(1 \leq n \leq 500),m(1 \leq m < 10^9+7)$, which is the length of Link's bracket sequence and the types of brackets.
The second line contains $n$ integers $a_1,a_2,\ldots,a_n(|a_i| \leq m)$. The $i$-th integer $a_i$ describes the $i$-th character in the sequence:
· If $a_i=0$, it means the bracket in this position is lost.
· $a_i>0$, it means the $i$-th character in the sequence is the $a_i$-th type of left bracket.
· $a_i<0$, it means the $i$-th character in the sequence is the $-a_i$-th type of right bracket.
It is guaranteed that there are at most 15 test cases with $n>100$.