Figure 1. Eight similar clusters
The night sky is represented by a sky map, which is a two-dimensional matrix of 0's and 1's. A cell contains the digit 1 if it has a star, and the digit 0 otherwise.
STARRY.INthe first two lines contain, respectively, the width W and the height H of a sky map. The sky map is given in the following H lines, of W characters each.
23In this case, the sky map has width 23 and height 15. Just to make it clearer, notice that this input file corresponds to the following picture of the sky.
Figure 2. Picture of the sky
STARRY.OUTcontains the same map as
STARRY.IN, except that the clusters are marked as described in Task.
a000a0000000000b0000000This is one possible result for the sample input above. Notice that this output file corresponds to the following picture.
Figure 3. Picture with the clusters marked