Usually, the path in a maze is calculated as the sum of steps taken from the starting point to the ending point, assuming each step has a distance of exactly . Suppose we could stretch (shorten or extend) the maze in the vertical (north-south) dimension, so that the distance between two vertically adjacent cells becomes instead of . We have a two-dimensional maze where # represents walls, S is the starting cell, and E is the ending cell.
Due to external conditions, the shortest path must be exactly in length.
You are not allowed to change the maze configuration or alter the horizontal dimension. Only the vertical dimension may be stretched by any percentage.
Find the percentage of stretch so that the shortest path in the maze is exactly .
The first line contains the number of test cases. For each test case, the first line contains two numbers and , where is the required length of the shortest path and is the number of lines describing the maze. The following lines describe the maze, with each line representing one row of the maze (each row's length is the horizontal dimension of the maze).
For each test case, print the stretch percentage in the following format:
Case #: %
must have a leading zero if it is between and .
must be rounded to decimal places, and always formatted with decimal places (with trailing zeros if necessary).
Constraints
- The height and width of the maze are at most cells. - All lines describing one maze are the same length. - There is always a solution. - 0.000 \leq P \leq 1000.000 - There will be no direct horizontal-only path connecting S to E. (The result is always unique).
Explanation of the first test case in the example: In the original maze, the length of the shortest path is because there are two horizontal steps and one vertical step. Our goal is to make the shortest path length , so the vertical dimension must be stretched with a percentage value less than . In this case, it is , which means the vertical distance between two cells becomes .

Example 1