Anti-Cyclotron United (ACU) believes that the end of the world will be caused by cyclotrons. In order to help it predict when this will occur, ACU reviews satelite photos of power lines. ACU has determined that power lines servicing cyclotrons always form a diamond.
Given an image showing power lines, determine the number of unique diamonds formed.
InputThe first line will contain the number of datasets to consider. Each data set begins with the height H and width W of the satelite photo image separated by a single space (1 ≤ H,W ≤ 100). The following H lines contain W (non-whitespace) pixels of the image. Power lines are represented by slashes (/ and \). Other characters indicate non-power lines. |
OutputEach data set should produce one line of output indicating the number of unique diamonds formed by the power lines in the satellite image. | |
Sample input:
2 4 4 _/\_ /\/\ \/\/ _\/_ 5 7 ./\/\.. /\/\/\. \/\/^^\ .\/\vv/ ..\/\/. |
Sample output:
5 8 |