#K69212. Robot Delivery Success Probability
Robot Delivery Success Probability
Robot Delivery Success Probability
In this problem, you are given data regarding several robots that deliver packages. Each robot has a success probability of delivering its package. Although the input contains additional information about which other robots it may assist, the overall success probability is computed simply as the product of all individual success probabilities. Formally, if there are N robots with success probabilities (p_1, p_2, \ldots, p_N), then the overall probability is given by:
[ P = \prod_{i=1}^{N} p_i ]
Your task is to compute and output this overall probability for each test case. Each test case starts with a positive integer N (the number of robots), followed by N lines of data. Each of these lines begins with a floating‑point number representing the robot's success probability, an integer indicating the number of robots it can assist, and a list of robot indices (which you can ignore for this problem). A test case with N = 0 indicates the end of input.
inputFormat
Input is read from standard input and consists of multiple test cases. Each test case begins with an integer N (N > 0) denoting the number of robots. The next N lines each contain a floating‑point number (the robot's success probability), an integer k (the number of other robots it can assist), followed by k integers (indices of the robots it assists). The input terminates with a test case where N equals 0.
outputFormat
For each test case, output a single line containing the overall delivery success probability, computed as the product of all individual success probabilities.## sample
2
0.80 1 2
0.70 0
0
0.56
</p>