410192: GYM103973 B Subset Counting
Memory Limit:512 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
B. Subset Countingtime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard output
Given three integers $$$n,k$$$ and $$$m$$$. Let $$$S=\{i\mid 1\le i\le nm+k,i\in \mathbb Z\}$$$. For all integers $$$r$$$ where $$$0\le r<m$$$, you need to output the number of sets $$$T$$$ such that
- $$$T$$$ is a subset of $$$S$$$.
- The sum of elements in $$$T$$$ is modulo $$$m$$$ exactly $$$r$$$.
The only line of the input contains three integers $$$n\ (0\le n\le 10^{13})$$$, $$$k\ (0\le k<\min(m,500),nm+k>0)$$$ and $$$m\ (1\le m\le 10^5)$$$ as described above.
OutputOutput $$$m$$$ integers in a line, the $$$i$$$-th of which indicates the number of subsets modulo $$$998\,244\,353$$$ when $$$r=i-1$$$.
ExamplesInput1 1 2Output
4 4Input
1919 8 10Output
577613260 577613260 822345879 577613260 822345879 577613260 577613260 822345879 577613260 822345879