| UNICAMP Selection Contest 2025 |
|---|
| Закончено |
Fmota (in the middle) and his friends after winning the Café Com Leite 2024. Source: https://maratona.sbc.org.br/hist/2024/JoaoPessoa/fotos/cafecomleite.jpg The Brazilian final of 2019 was held in Campina Grande, Paraíba, where a living legend of Brazilian marathon studied. At UFCG, the legendary FMota studied, known by many as the Fastest Coder Alive Mota after managing to code Dijkstra from start to finish in less than 30 seconds. Since a very young age, he has participated in programming competitions and has accumulated several awards such as: two gold medals in the Senior OBI, champion of the first Latin American final in Mexico, and even Champion of the Café com Leite (CCL) 2024 competition in João Pessoa.
But with so much fame comes problems, and one of them is an overcrowded wardrobe. This is because, for every competition he participates in, FMota receives an exclusive t-shirt. Since he competes every year, he already has a huge collection that grows more and more each year.
Being obsessed with numbers, FMota likes to calculate how many distinct ways he can wear all his t-shirts over the next days until he exhausts his wardrobe. He does this by following a personal rule:
FMota wears one t-shirt per day and never repeats t-shirts until he has worn all of them from his wardrobe. Additionally, he wears the t-shirts from each competition in blocks, meaning he first wears all the OBI t-shirts (without repeating, in any order), then all the Marathon t-shirts (without repeating), and so on.
Given that he has an initial number of t-shirts from each competition, represented by the vector $$$C$$$, FMota wants to know how many different ways he can wear his t-shirts over the next $$$K + 1$$$ years (the current year plus $$$K$$$ future years). Each new year, he receives exactly one new t-shirt from each competition. Thus, in year 0 he has $$$C_i$$$ t-shirts from competition $$$i$$$, in year 1 he will have $$$C_i + 1$$$, in year 2 he will have $$$C_i + 2$$$, and so on.
Your task is to calculate how many ways FMota can wear the shirts from year 0 to year $$$K$$$. Since this number can be very large, print the answer modulo $$$998244353$$$. That is, if there are $$$x$$$ ways, you should print an integer $$$0 \leq x' \lt 998244353$$$ representing the remainder of the integer division of $$$x$$$ by $$$998244353$$$.
The first line contains two integers $$$N$$$ and $$$K$$$ ($$$1 \leq N \leq 10^5$$$, $$$0 \leq K \leq 10^5$$$) — the number of competitions that FMota regularly participates in and the number of years in the future to consider.
The second line contains $$$N$$$ integers $$$C_1$$$, $$$C_2$$$, ..., $$$C_N$$$ ($$$0 \leq C_i \leq 10^5$$$) — the current number of t-shirts FMota has from each competition.
Print a line with $$$K + 1$$$ integers, separated by spaces, representing the number of ways FMota can dress modulo $$$998244353$$$.
1 50
1 1 2 6 24 120
3 45 3 7
3628800 696729600 854310693 788947910 701240539
2 23 3
36 576 14400
| Название |
|---|


