Quiz Contest

아직 제출이 없습니다시간 제한8초메모리 제한1024 MB

문제

The final round of the annual World Quiz Contest is now at the climax!

In this round, questions are asked one by one, and the competitor correctly answering the goal number of questions first will be the champion. Many questions have already been asked and answered. The numbers of questions correctly answered so far by competitors may differ, and thus the numbers of additional questions to answer correctly to win may be different.

The questions elaborated by the judge crew are quite difficult, and the competitors have completely distinct areas of expertise. Thus, for each question, exactly one competitor can find the correct answer.

Who becomes the champion depends on the order of the questions asked. The judge crew know all the questions and who can answer which, but they do not know the order of the remaining questions, as the questions have been randomly shuffled. To help the judge crew guess the champion of this year, count the number of possible orders of the remaining questions that would make each competitor win. Note that the orders of the questions left unused after the decision of the champion should also be considered.

입력

The input consists of a single test case of the following format.

nn mm

a_1a\_1 \cdots a_na\_n

b_1b\_1 \cdots b_nb\_n

Here, nn is the number of competitors and mm is the number of remaining questions. Both nn and mm are integers satisfying 1nm2×1051 ≤ n ≤ m ≤ 2 \times 10^5. Competitors are numbered 11 through nn. The following line contains nn integers, a_1,,a_na\_1, \dots , a\_n, meaning that the number of remaining questions that the competitor ii can answer correctly is a_ia\_i, where n_i=1a_i=m\sum^{n}\_{i=1}{a\_i} = m holds. The last line contains nn integers, b_1,,b_nb\_1, \dots , b\_n, meaning that the competitor ii has to answer b_ib\_i more questions correctly to win. 1b_ia_i1 ≤ b\_i ≤ a\_i holds.

출력

Let c_ic\_i be the number of question orders that make the competitor ii the champion. Output nn lines, each containing an integer. The number on the ii-th line should be c_ic\_i modulo a prime number 998,244,353=223×7×17+1998\\,244\\,353 = 2^{23} \times 7 \times 17 + 1. Note that n_i=1c_i=m!\sum^{n}\_{i=1}{c\_i} = m! holds.