By filling a rectangle with slashes (/) and backslashes (\), you can generate nice little mazes. Here is an example:
The input contains several maze descriptions. Each description begins with one line containing two integers w and h (1 <= w,h <= 75), the width and the height of the maze. The next h lines represent the maze itself, and contain w characters each; all these characters will be either "/" or "\".
The input is terminated by a test case beginning with w = h = 0. This case should not be processed.
For each maze, first output the line "Maze #n:", where n is the number of the maze. Then, output the line "k Cycles; the longest has length l.", where k is the number of cycles in the maze and l the length of the longest of the cycles. If the maze does not contain any cycles, output the line "There are no cycles.".
Output a blank line after each test case.
6 4 \//\\/ \///\/ //\\/\ \/\/// 3 3 /// \// \\\ 0 0
Maze #1: 2 Cycles; the longest has length 16. Maze #2: There are no cycles.