408070: GYM102978 H Harsh Comments
Description
Posted on a blog are $$$N+M$$$ harsh comments. You made $$$N$$$ comments, and the $$$i$$$-th of them has $$$A_i$$$ downvotes. The $$$i$$$-th of the other $$$M$$$ comments has $$$B_i$$$ downvotes.
Mike is going to delete the comments, one by one, by repeating the following operation:
- Choose a comment randomly and delete it. More precisely, let $$$x_1,x_2,\ldots,x_k$$$ be numbers of downvotes the remaining comments have. Then, he will choose the $$$i$$$-th of them with the probability $$$x_i/\left(\sum_{1\leq j \leq k}x_j \right)$$$ and detele it.
Note that the choices in the operations are independent.
Find the expected number of operations Mike will do until he deletes all of your comments. The answer is a rational number, so print it modulo $$$998244353$$$ as usual. We can prove that such representation is always possible under the constraints of this problem.
InputThe first line contains integers $$$N$$$ and $$$M$$$ ($$$1 \leq N,M \leq 100$$$).
The second line contains integers $$$A_1,A_2,\ldots,A_N$$$ ($$$1 \leq A_i \leq 100$$$).
The third line contains integers $$$B_1,B_2,\ldots,B_M$$$ ($$$1 \leq B_i$$$, $$$\sum_{1 \leq i \leq N} A_i + \sum_{1 \leq i \leq M} B_i < 998244353$$$).
OutputPrint the answer.
ExamplesInput1 2 1 1 1Output
2Input
1 1 2 1Output
332748119Input
3 3 2 3 5 7 11 900000000Output
636512475