#P9684. Chair Seating Probability

    ID: 22831 Type: Default 1000ms 256MiB

Chair Seating Probability

Chair Seating Probability

There is a long table with n+2n+2 chairs arranged in a row and labeled from 00 to n+1n+1, with equal distances between any two adjacent chairs. Initially, one person sits on chair 00 and another on chair n+1n+1. Then, mm persons enter one by one and choose seats according to the following process:

  1. They uniformly randomly choose an empty chair.
  2. After sitting, they perform a sequence of moves. At each step, let the current position be $i$ and let $$d=\min_{x\in S}\;|i-x|,$$ where $S$ is the set of already occupied chairs. They check if moving to an adjacent (left or right) chair that is empty can increase $d$. If one or both adjacent moves yield a larger minimal distance, they move to the one with the larger value (in case of a tie, they choose the left move). This process repeats until no adjacent move can increase $d$.
    (It can be shown that this process terminates in a finite number of steps.)

For each chair numbered 11 to nn, determine the probability that it is eventually occupied by one of the mm persons. All results should be printed with 6 decimal places.

inputFormat

The input consists of a single line containing two integers nn and mm where 1nsmall1\leq n \leq \text{small} and m1m\geq 1. The chairs are numbered from 00 to n+1n+1, and the initial occupied chairs are 00 and n+1n+1.

outputFormat

Output nn numbers separated by a space. The ii-th number (for 1in1\leq i \leq n) represents the probability that chair ii is eventually occupied, printed with 6 decimal places.

sample

1 1
1.000000