题目描述
Problem Description
$N$ players sit in a circle to play a game. Initially, all players are numbered clockwise from $1$ to $N$. The first round starts with player $1$ as the dealer. In each round, the dealer randomly (with equal probability) selects a card from the deck. Suppose the number on the card is $X$, the dealer first shows the number to all players, then the $X$-th person clockwise from the dealer's position will be executed (i.e., removed from the game). The card is then returned to the deck and reshuffled. The next person clockwise from the executed player becomes the dealer for the next round. After $N-1$ rounds, only one player will remain, who is the winner of the game. Now, you know in advance that there are $M$ cards and the numbers on each card. You need to determine the probability of each player winning.
Here is a simple example:
For instance, there are $4$ players and four cards with numbers 3, 4, 5, 6.
In the first round, the dealer is player $1$. Suppose he selects a card with the number $5$. Then, counting clockwise 1, 2, 3, 4, 1, player $1$ is removed from the game.
In the second round, the dealer is the next person clockwise from player $1$, which is player $2$. Suppose player $2$ selects a card with the number $6$, then 2, 3, 4, 2, 3, 4, player $4$ is removed from the game.
In the third round, player $2$ becomes the dealer again. If player $2$ selects a card with the number $6$ again, player $3$ is removed, and the final winner is player $2$.
Input Format
The first line contains two integers $N, M$ representing the number of players and the total number of cards, respectively.
The next line contains $M$ integers, each giving the number on a card.
Output Format
Output a line containing $N$ real numbers in percentage format, rounded to two decimal places. These numbers represent the winning probabilities for players $1$ to $N$, separated by spaces, with no trailing space at the end.
Sample Input and Output
Sample Input #1
5 5
2 3 5 7 11
Sample Output #1
22.72% 17.12% 15.36% 25.44% 19.36%
Sample Input #2
4 4
3 4 5 6
Sample Output #2
25.00% 25.00% 25.00% 25.00%
Notes
For $30\%$ of the data, $1 \le N \le 10$.
For $50\%$ of the data, $1 \le N \le 30$.
For $100\%$ of the data, $1 \le N \le 50$, $1 \le M \le 50$, $1 \le$ the number on each card $\le 50$.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分