#P16044. [ICPC 2022 NAC] Double Sort

[ICPC 2022 NAC] Double Sort

题目描述

Given two integers nn and mm (nmn \le m), you generate a sequence of nn integers as follows:

  1. First, choose nn distinct integers between 1 and mm, inclusive.
  2. Sort these numbers in non-decreasing order.
  3. Take the difference sequence, which transforms a sequence a1,a2,a3,a_1, a_2, a_3, \dots into a1,a2a1,a3a2,a_1, a_2 - a_1, a_3 - a_2, \dots.
  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 b1,b2,b3,b_1, b_2, b_3, \dots into b1,b2+b1,b3+b2+b1,b_1, b_2 + b_1, b_3 + b_2 + b_1, \dots.

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

  1. Suppose we initially chose 6,2,96, 2, 9.
  2. The sequence in order is 2,6,92, 6, 9.
  3. The difference sequence is 2,4,32, 4, 3.
  4. The sorted difference sequence is 2,3,4.2, 3, 4.
  5. The prefix sums of the sorted difference sequence are 2,5,92, 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.

输入格式

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

输出格式

Output nn 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 10610^{-6}.

3 5
1
2.3
4.5