//sj 가 아직
Archeologists recently found the remains of Greco-Roman architecture. The location can be modeled as a grid of R·C square cells. For each of the cells, archeologists have determined if some building was there or if the cell has always been empty.
After examining the artifacts in detail, they concluded that the location contains two buildings from different periods in time, and that the floor plans of both buildings are of square shape.
Because the buildings were from different periods in time, it is possible that their floor plans overlap. Determine the possible location and size (length of the side of the square occupied by the floor plan) for each building.
Note: The test data will guarantee that a solution always exists, although it may not necessarily be unique.
input 3 3 xx. xxx ... output 1 1 2 2 3 1 input 4 6 xx.... xx.xxx ...xxx ...xxx output 1 1 2 2 4 3 input 5 5 ..... xxx.. xxxx. xxxx. .xxx. output 2 1 3 3 2 3
출처:coci COCI 2008/2009 contest1 3/6