Drawing Marbles
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
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 c[1]
, c[2]
, .., c[col]
, where c[i]
(1 ≤ c[i]
≤ 50) is the number of marbles of color i. It is known that 1 ≤ n ≤ c[1]
+ c[2]
+ .. + c[col]
.
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.
Examples
Input #1
Answer #1
Submissions 187
Acceptance rate 53%