#P5850. calc加强版

    ID: 4684 远端评测题 3000ms 256MiB 尝试: 0 已通过: 0 难度: 9 上传者: 标签>数学WC/CTSC/集训队O2优化生成函数快速傅里叶变换 FFT

calc加强版

Description

A sequence a1,,ana_1,\cdots,a_n is valid if and only if:

  • Its length is the given nn.
  • a1,,ana_1,\cdots,a_n are all integers in [1,k][1,k].
  • a1,,ana_1,\cdots,a_n are pairwise distinct.

The value of a sequence is defined as the product of all numbers in it, i.e., a1×a2××ana_1\times a_2\times\cdots\times a_n.

Find the sum of the values of all different valid sequences.

Two sequences are different if and only if they differ at any position.

Output the answer modulo 998244353998244353.

Input Format

One line with two numbers k,mk,m.

Output Format

There are mm lines in total.
On the ii-th line (1im)(1\le i\le m), output the answer when n=in=i.

13 8
91
7462
546546
35387352
3869654
396558319
363789591
879373476

Hint

subtask 1 (84 pts)\text{subtask 1 (84 pts)}1m5001\le m\le 500.

subtask 2 (16 pts)\text{subtask 2 (16 pts)}1m5×1051\le m\le 5\times 10^5,it is recommended to use an efficient output method.

For all testdata, 1mk9982443521\le m\le k\le 998244352.

Translated by ChatGPT 5