Problem B
Gnoll Hypothesis
You are a huge fan of the RPG The Eldest Scrolls:
Earthrim and know all of the game’s internal mechanics.
For instance, when spawning a new monster, each of the
However, in the latest update the developers seem to have
changed the way monsters are spawned. After some testing and
reverse engineering, you realise that instead of spawning all
After the update, some monster types seem to appear less often than before, and some more often (for instance now there seem to be Gnolls all over the place). You believe that the new spawning logic may be responsible for this by having changed the effective spawn chances of the monsters. In order to test this hypothesis, you decide to compute these effective spawn chances after the update.
![\includegraphics[width=.4\textwidth ]{sample1}](/problems/gnollhypothesis/file/statement/en/img-0001.png)
Input
The input consists of:
-
One line with two integers
and ( ), the number of different types of monsters and the number of monsters that are randomly chosen for the spawn pool of each spawn location. -
One line with
real numbers ( for each , ), where is the spawn chance in percent for the th type in the list of monster types. Every real number has at most six digits after the decimal point.
Output
Output a single line containing
Sample Input 1 | Sample Output 1 |
---|---|
5 3 1 25 39 12 23 |
8.7 17.6 31 21.4 21.3 |
Sample Input 2 | Sample Output 2 |
---|---|
3 2 2.019 87.51234 10.46866 |
4.8355533 59.01456 36.1498867 |