In this problem, team A kicks first (which is determined by a coin toss, as usual), both teams will
attempt at most 5 shots (after all the 10 shots, the game may end in draw again), but the game will end
as soon as the winner is already determined. For example, after the first 8 kicks the score is 3-2 (left side
is team A’s score, right side is team B), then if the 9-th kick is a goal, the game will end immediately
with score 4-2, because even team B got its last kick, it still loses for sure. Another example: if all the
first 9 kicks are goals, the last kick (from team B) will still be performed, because although team B
cannot win, the result might be a “draw”, which is better than “lose”.
Input
There will be at most 100 test cases. Each case contains two lines. The first line contains 10 floating
numbers. The first 5 numbers are the goal probability of the players in team A (player 1 will shoot
first, etc), the next 5 numbers are the goal probabilities of the players in team B. Each probability will
have exactly one digit after the decimal point. The second line contains your guess, in the format of
scoreA − scoreB. 0 ≤ scoreA, scoreB ≤ 5.
Output
For each test case, print the case number and the probability (in percentage) that your wild guess is
correct, to 2 decimal places. An absolute error of 0.01% will be ignored.