406394: GYM102394 K Keeping Rabbits
Description
DreamGrid is the keeper of $$$n$$$ rabbits. Initially, the $$$i$$$-th ($$$1 \le i \le n$$$) rabbit has a weight of $$$w_i$$$.
Every morning, DreamGrid gives the rabbits a carrot of weight $$$1$$$ and the rabbits fight for the only carrot. Only one rabbit wins the fight and eats the carrot. After that, the winner's weight increases by $$$1$$$. The whole process of fighting and eating ends before the next morning.
DreamGrid finds that the heavier a rabbit is, the easier it is to win a fight. Formally, if the weights of the rabbits are $$$w_1', w_2', \dots, w_n'$$$ before a fight, the probability that the $$$i$$$-th rabbit wins the fight is $$$$$$\frac{w_i'}{\sum\limits_{j=1}^{n}{w_j'}}$$$$$$ He wants to know the expected weight of every rabbit after $$$k$$$ days ($$$k$$$ carrots are given and eaten).
InputThe input contains multiple cases. The first line of the input contains a single integer $$$T\ (1 \le T \le 10^5)$$$, the number of cases.
For each case, the first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \leq n \leq 10^{5}, 1 \leq k \leq 10^{9}$$$). The second line contains $$$n$$$ integers $$$w_1, w_2, \dots, w_n$$$ ($$$1 \le i \le n, 1 \leq w_i \leq 10^{9}$$$).
It's guaranteed that the sum of $$$n$$$ over all cases doesn't exceed $$$10^6$$$.
OutputFor each case, print a single line containing $$$n$$$ space-separated real numbers, where the $$$i$$$-th ($$$1 \le i \le n$$$) number should be equal to the expected weight of the $$$i$$$-th rabbit after $$$k$$$ days.
Your answer will be considered correct if the absolute or relative error does not exceed $$$10^{-4}$$$.
ExampleInput3 1 1 2 2 2 1 3 3 2 1 1 1Output
3.00000000 1.50000000 4.50000000 1.66666667 1.66666667 1.66666667