QOJ.ac

QOJ

Time Limit: 4 s Memory Limit: 512 MB Total points: 100 Hackable ✓

#13343. New Year's Army

Statistics

Agent $04$ is a very dangerous person. He has an army of $n$ people, and this army guards the divine cattle.

Each person in the army has a rank, and all ranks are distinct. As the Year of the Gengzi passes and the Year of the Xinchou arrives, the person who was originally at rank $i$ will have a new rank of $p_i$, where $p$ is a permutation.

For the person who was originally at rank $i$, if $p_i > p_{i+1}$, it means their new rank is not higher than the person who was originally ranked lower than them, which makes them unhappy. Specifically, the person who was originally at the lowest rank cannot be unhappy.

You have a subordinate who infiltrated Agent $04$'s army early on, and his rank in the past year was $k$. He has found out that the total number of unhappy people (including himself) is $m$.

You want to know, for each $l$ where $1 \le l \le n$, how many possible permutations exist such that your subordinate's new rank is $l$, to facilitate your future rescue mission. The number of ways should be taken modulo $998244353$.

Input

A single line containing three integers $n, m, k$.

Output

A single line containing $n$ integers, representing the number of possible permutations for each $l$ from $1$ to $n$, modulo $998244353$.

Examples

Input 1

4 2 1

Output 1

1 2 4 4

Input 2

5 0 2

Output 2

0 1 0 0 0

Input 3

11 2 4

Output 3

14880 14160 12816 11640 11496 12480 13896 15093 15696 15600 14880

Input 4

See ex_army4.in and ex_army4.ans in the download files. This sample satisfies the constraints of Subtask $3$.

Constraints

For $100\%$ of the data, $1 \le n \le 5 \times 10^5$, $0 \le m \le n-1$, $1 \le k \le n$.

Subtask Special Constraints Score
$1$ $n \le 10$ $5$
$2$ $n \le 300$ $15$
$3$ $n \le 3 \times 10^3$ $15$
$4$ $n \le 10^5$ $35$
$5$ $k=1$ $15$
$6$ No special constraints $15$

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.