Can you dig it
All submissions for this problem are available.
The Indian archaeologists recently found remains of an ancient architecture. The location where it was found can be modeled as X, Y square grid cells. The archaeologists then determined whether a building existed at a particular cell or not.
After examining all the clues, they concluded that two buildings, with square shaped floor plans, existed at the location from different periods in time. There is also a possibility that their floor plans may overlap as the buildings were from different periods in time.
You need to determine, for each building, the possible location and size (the length of a side of the square of the floor plan).
On the first line, there are two integers X (1 ≤ X ≤ 100) and Y (1 ≤ Y ≤ 100), which specify the size of the location. The next X lines contain strings comprising of '.' (dot) or 'x' (lowercase letter). Here '.' indicates that nothing was found in that cell, while 'x' means that a building was present there.
For each of the two buildings, print on a single line the row and the column of its upper left corner and the size of the building. Also please note that the test data will guarantee that a solution always exists, although it may not necessarily be unique.
Input: 4 6 xx.... xx.xxx ...xxx ...xxx Output: 1 1 2 2 4 3 Input: 3 3 xx. xxx ... Output: 1 1 2 2 3 1
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.