Problem E
Explosion Exploit

You are contemplating your next move. You want to play an
“Explosion” spell which deals
Given the current health of all minions, what is the probability that the Explosion will remove all of the opponent’s minions? Note that it does not matter if all your own minions die in the process as well, and the damage continues to be dealt even if all your own minions are gone.
Input
The first line of input contains the three integers
Output
Output the probability that the Explosion removes all the
opponent’s minions, accurate up to an absolute error of
Sample Input 1 | Sample Output 1 |
---|---|
1 2 2 2 1 1 |
0.3333333333 |
Sample Input 2 | Sample Output 2 |
---|---|
2 3 12 3 2 4 2 3 |
0.1377380946 |