Hide

Problem D
Double Sort

Given two integers $n$ and $m$ ($n \le m$), you generate a sequence of $n$ integers as follows:

  1. First, choose $n$ distinct integers between $1$ and $m$, inclusive.

  2. Sort these numbers in non-decreasing order.

  3. Take the difference sequence, which transforms a sequence $a_1$, $a_2$, $a_3$, $\ldots $ into $a_1$, $a_2-a_1$, $a_3-a_2$, $\ldots $

  4. Sort the difference sequence in non-decreasing order.

  5. Take the prefix sums of the sorted difference sequence to get the final sequence. This transforms a sequence $b_1$, $b_2$, $b_3$, $\ldots $ into $b_1$, $b_2+b_1$, $b_3+b_2+b_1$, $\ldots $

For example, with $n = 3$ and $m = 10$:

  1. Suppose we initially chose $6$, $2$, $9$.

  2. The sequence in order is $2$, $6$, $9$.

  3. The difference sequence is $2$, $4$, $3$.

  4. The sorted difference sequence is $2$, $3$, $4$.

  5. The prefix sums of the sorted difference sequence are $2$, $5$, $9$.

Suppose you chose a uniformly random set of distinct integers for step $1$. Compute the expected value for each index in the final sequence.

Input

The single line of input contains two integers $n$ ($1 \le n \le 50$) and $m$ ($n \le m \le 10\, 000$), where $n$ is the size of the sequence, and all of the initial integers chosen are in the range from $1$ to $m$.

Output

Output $n$ lines. Each line contains a single real number, which is the expected value at that index of the final sequence. Each answer is accepted with absolute or relative error at most $10^{-6}$.

Sample Input 1 Sample Output 1
3 5
1
2.3
4.5
CPU Time limit 1 second
Memory limit 2048 MB
Author
Lewin Gan
Source 2022 ICPC North America Championship
License Creative Commons License (cc by-sa)

Please log in to submit a solution to this problem

Log in