Jimmy and Jamy are two brothers. They like to play with colored marble.
Jimmy has boxes with three different colors (red, green, and blue) marble. Each box contains one or more red, green, and blue color marble.
Now Jimmy randomly selects a colored marble and asked his brother (Jamy) what is the probability that it comes from “I” box, where “I” means the index number of the given box.
Jamy is a lazy boy and he is unable to respond to his brother (Jimmy).
Please help Jamy to solve his problem. Every box has an equal probability of being selected.
Input starts with an integer (), denoting the number of test cases.
Each case start with an integer (), and () where denoting the number of box and is a character string (“red” or “green” or “blue”) and is the index number of selected box.
Next, N lines contain three integer (), (), and () where , , denoting the number of color marbles.
For each test case, print a line in the format, "Case T: P", where is the case number and is the probability of Jamy tasks and rounded to five places after the decimal point.
Input | Output |
---|---|
1 2 red 1 1 3 3 2 3 4 | Case 1: 0.39130 |