Tournament of Gold

5

1 votes
Strategies and Expected values, Dynamic Programming, Algorithms, Medium
Problem

Bob is organizing the annual tournament of gold. There are n participants in a line, each starting with 0 gold. Initially, the entire row of participants is "selected". A round of the tournament proceeds as follows:

  1. Bob selects a random subarray of the currently "selected" part of the row. Each subarray has equal probability of being chosen, including the same currently "selected" part.
  2. He gives 1 gold to each participant in the subarray.
  3. He sets this subarray as the new "selected" part of the row.

After k rounds of the tournament proceed, what is the expected amount of gold of each participant ?

It can be proven that the expected amount of gold for the ith participant can be represented as a fraction  PiQi with Qi0 and gcd(Pi,Qi)=1. Print n space-separated integers, the ith of which is PiQ1i  modulo 998244353

It can be proved that Q1 Modulo 998244353 exists under the following constraints. 

Input Format:

The first and only line of input contains two space-separated integers, n and k.

Output Format:

Print n space separated integers, the ith integer denoting the answer for the ith participant .

Constraints:

1n,k500

Note that the Expected Output Feature for Custom Invocation is not supported for this contest. 

Time Limit: 2
Memory Limit: 512
Source Limit:
Explanation

The tournament could proceed in the following ways:

  • [1,2] is selected in the first round, and [1,2] is selected in the second round, occurring with probability 19.
  • [1,2] is selected in the first round, and [1,1] is selected in the second round, occurring with probability 19.
  • [1,2] is selected in the first round, and [2,2] is selected in the second round, occurring with probability 19.
  • [1,1] is selected in the first round, and [1,1] is selected in the second round, occurring with probability 13.
  • [2,2] is selected in the first round, and [2,2] is selected in the second round, occurring with probability 13.

The output corresponds to expected values of 119 for both participants.

Editor Image

?