Jimmy and Jamy are two brothers. They like to play with colored marble.
Jimmy has N 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 T (≤ 100), denoting the number of test cases.
Each case start with an integer N (1<=N<=100), S and I (1<=I<=N) where N denoting the number of box and S is a character string (“red” or “green” or “blue”) and I is the index number of selected box.
Next, N lines contain three integer R (1<=R<100), G (1<=G<=100), and B (1<=B<=100) where R, G, B denoting the number of color marbles.
For each test case, print a line in the format, "Case T: P", where T is the case number and P is the probability of Jamy tasks and rounded to five places after the decimal point.
1 2 red 1 1 3 3 2 3 4
Case 1: 0.39130