Problem A
Assassins

Assassins generally lay careful plans before executing them, including planning multiple attempts to dispose of the same target, with the second attempt being a backup in case the first attempt fails, the third attempt being a secondary backup, and so on. Using their great annihilytical skills, assassins can also very accurately determine the probability that any given assassination attempt will succeed.
Given the list of planned assassination attempts for a group of assassins, what are the probabilities that each assassin is alive after all these attempts? Performing an assassination attempt requires that the assassin is still alive, so if the assassin is indisposed due to already having been assassinated, the attempt is cancelled.
Input
The first line of input contains two integers
Then follow
Output
Output
Sample Input 1 | Sample Output 1 |
---|---|
4 3 1 2 0.25 1 4 0.42 2 3 1.0 |
1 0.75 0.25 0.58 |
Sample Input 2 | Sample Output 2 |
---|---|
2 3 1 2 0.23 2 1 0.99 1 2 0.99 |
0.2377000000 0.7623770000 |