Under construction

Still being built. Things may change

Double Sort

Time limit1.5sMemory limit1024 MB

Summary
For a uniformly random n-element subset of 1..m, find the expected final sequence after sorting its positive gaps and taking prefix sums.
Level

Hard8 of 10

Topics
Combinatorics, Probability, Math
Solved
No attempts yet

Problem

Given two integers nn and mm (n≤mn \le m), generate a sequence of nn integers as follows:

  1. Choose nn distinct integers between 11 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, \ldots into a1,a2−a1,a3−a2,…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 b1,b2,b3,…b_1, b_2, b_3, \ldots into b1,b2+b1,b3+b2+b1,…b_1, b_2+b_1, b_3+b_2+b_1, \ldots.

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

  1. Suppose we initially chose 66, 22, 99.
  2. The sequence in order is 22, 66, 99.
  3. The difference sequence is 22, 44, 33.
  4. The sorted difference sequence is 22, 33, 44.
  5. The prefix sums of the sorted difference sequence are 22, 55, 99.

Suppose the set of distinct integers in step 1 is chosen uniformly at random. Compute the expected value at each position of the final sequence.

Input

The input consists of a single line containing two integers nn and mm (1≤n≤501 \le n \le 50, n≤m≤10 000n \le m \le 10\,000). Here nn is the sequence length, and the initial integers are chosen from 11 to mm inclusive.

Output

Output nn lines. Each line contains one real number, the expected value at the corresponding position of the final sequence. An answer is accepted if its absolute or relative error is at most 10−610^{-6}.

Examples1

  1. Example 1

    Input
    3 5
    
    Expected output
    1
    2.3
    4.5