Problems
Drawing Marbles
Drawing Marbles
A big box contains marbles of one or more colors. You're given the number of marbles of each color. You draw n marbles randomly from the box, leaving each marble outside the box after taking it. Find the probability that all marbles drawn will be the same color.
Input
Consists of multiple test cases. The first line of each test case contains the number of colors col (1 ≤ col ≤ 50) and the number n. The second line contains col integers c1
, c2
, .., ccol
, where ci
(1 ≤ ci
≤ 50) is the number of marbles of color i. It is known that 1 ≤ n ≤ c1
+ c2
+ .. + ccol
.
Output
For each test case print on a separate line the probability that all marbles drawn will be the same color. Print the probabilities with 4 digits after the decimal point.
Input example #1
1 8 13 3 2 5 6 7 5 4 12 2 34 13 17
Output example #1
1.0000 0.3007 0.0350