Hide

Problem H
Game Show Elimination

You are running an elimination-style game show, where players are eliminated one at a time until only one remains. Based on what you know about the contestants, you are trying to predict the results.

Each week, the remaining contestants take part in a competition, where each contestant’s score is based on their skill level. Because this is a silly game show, a contestant’s score is a random number that falls within their unique skill range. The contestants are then ranked from highest to lowest based on their scores. (Since scores are all real numbers, there is zero probability that there is a tie.)

The winner of this week’s competition chooses who is eliminated that week. However, all players believe they should pick whoever did the best after them in the week’s competition, so they always choose to eliminate the second place contestant. That contestant is eliminated and goes home. The show continues, week after week, until there is only one contestant left.

The contestants’ final ranks are based on when they left the competition. The last contestant to leave (the winner!) is assigned rank $1$, the second-to-last gets rank $2$, and so on until the first person to leave is assigned the lowest rank.

Given information about the contestants’ skill levels, compute the expected ranks of each player.

Input

The single line of input contains two integers $n$ ($2 \leq n \leq 1\, 000$) and $k$ ($2 \leq k \leq 10$), where $n$ is the number of game show contestants, and $k$ determines the skill range of the contestants.

Contestants are numbered from $1$ to $n$. The skill range of contestant $i$ is from $i$ to $i+k$ inclusive, and their score each week is a randomly assigned real number in this range.

Output

Output $n$ lines. Each line contains a single real number, which is the expected rank of a contestant. The expected ranks must be listed in contestant number order. The answers are accepted within absolute or relative error of at most $10^{-6}$.

Sample Input 1 Sample Output 1
3 2
2.109375
2.625000
1.265625

Please log in to submit a solution to this problem

Log in