Comparison of Composters
A ticket puncher on a bus creates holes in a ticket positioned at specific nodes of a square grid of size M×N. Two punchers are considered identical if all the holes they create can be aligned by overlaying one ticket onto another using a combination of parallel translations, right-angle rotations, or reflections across horizontal and vertical axes. Each punched ticket must have at least one hole.
Write a program to determine if two given punchers are identical.
Input
Your program should read input data for multiple tests from a single ASCII text file. Data for different punchers is separated by an empty line. Each line of the file represents one row of the puncher and contains ones (indicating holes) and zeros (indicating nodes without holes). Numbers on the same line are separated by spaces.
The grid sizes do not exceed 15×15 nodes.
Output
Your program should output the results for all tests to a single ASCII text file. The result for each test should be a line with its sequence number followed by the word "YES" (if the punchers are identical) or "NO" (if they are different).