The National Weekly Escape Room Challenge (NWERC) is a long-running competition held in Eindhoven. Every week a new escape room is presented, and anyone who completes it in their first attempt gains one point.
At the end of each week, competitors are ranked by the total number of points accumulated so far, highest first. In the case of a tie, they share the same rank. In other words, the rank of a competitor is one more than the number of people with a strictly larger number of points.
The figure illustrates the score progression in the third sample.
The input consists of:
The total number of points awarded is at most $$$1$$$ million.
Output $$$n$$$ lines, the $$$i$$$th of which contains the average rank of the $$$i$$$th competitor during the $$$w$$$-week competition. Your answers should have an absolute or relative error of at most $$$10^{-6}$$$.
3 2 2 1 2 2 1 3
1.000000000 1.500000000 2.500000000
3 1 0
1.000000000 1.000000000 1.000000000
5 6 2 3 5 2 3 1 0 3 3 5 2 3 5 4 2 2 3 4
3.166666667 3.333333333 1.000000000 3.833333333 1.666666667
Name |
---|