1025: SYH’s Easy Area Problem
Memory Limit:256 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:37
Solved:11
Description
SYH has drawn a picture which only contains the following gird of pattern:
Which is expressed by: ‘.’, ‘\’, ‘/’.
These red lines can form a close pattern. SYH wants you to calculate the area of the close pattern. Assume that the area of a grid is one.
Input
The first line conatins an integer T, means the number of test cases. For each test case, the first line contains two integers n and m, which means the size of the pattern. Then an n×m pattern followed.
Output
For each test case ouput “Case: #x:y” in a single line. x is the test case number (starting from 1), and y is your answer.
Sample Input Copy
1
6 4
....
/\/\
\../
.\.\
..\/
....
Sample Output Copy
Case #1: 8
HINT
For the first sample, the pattern is drawn below:
1 ≤ T ≤ 102, 2 ≤ n, m ≤ 102.