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$$$.
Input

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.

Output

Output $$$m$$$ integers in a line, the $$$i$$$-th of which indicates the number of subsets modulo $$$998\,244\,353$$$ when $$$r=i-1$$$.

ExamplesInput
1 1 2
Output
4 4
Input
1919 8 10
Output
577613260 577613260 822345879 577613260 822345879 577613260 577613260 822345879 577613260 822345879

加入题单

上一题 下一题 算法标签: