A group of $$$n$$$ people decided to decorate the Christmas tree. They have $$$(n+1)$$$ boxes of decorations, numbered from $$$0$$$ to $$$n$$$. Initially, the $$$i$$$-th box contains $$$a_i$$$ decorations.
We say that a permutation $$$p$$$ of size $$$n$$$ (an array of size $$$n$$$ where each number from $$$1$$$ to $$$n$$$ appears exactly once) is fair if it is possible to hang all the decorations on the tree using the following process:
During this process, there should never be a situation where person $$$i$$$ needs to hang a decoration, but both box $$$0$$$ and box $$$i$$$ are empty. If such a situation cannot be avoided, the permutation is not fair. However, if the people can choose from which box to take a decoration during each step in such a way that this situation does not arise, then the permutation is fair.
Your task is to calculate the number of fair permutations. Since the answer may be large, output it modulo $$$998244353$$$.
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 5000$$$) — the number of test cases.
The first line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 50$$$).
The second line contains $$$(n+1)$$$ integers $$$a_0, a_1, \dots, a_n$$$ ($$$0 \le a_i \le 10^6$$$).
For each test case, print a single integer — the number of fair permutations, taken modulo $$$998244353$$$.
431 2 1 031 0 2 012 546 1 4 2 1
20112
In the first example, the fair permutations are $$$[1, 2, 3]$$$ and $$$[1, 3, 2]$$$.
Let's take a closer look at the Christmas tree decoration for permutation $$$[1, 3, 2]$$$:
Note that if the person $$$p_1=1$$$ takes the decoration from the box $$$0$$$ during the first step, then the person $$$p_2=3$$$ won't be able to perform the next step (since both boxes $$$0$$$ and $$$3$$$ will be empty). However, since this situation can be avoided, the permutation is fair.
| Name |
|---|


