wants to send a postcard to but mailing is expensive. He notices that a good portion of a grid is just white paper, so output the smallest rectangular design that will encompass all of the black ink!
Input Specification
The first line will contain integers (rows), (columns) (separated by space).
Subtask 1 [10%]
Subtask 2 [10%]
Subtask 3 [80%]
The following line will contain the design, with .
representing white space and *
being black (separated by spaces).
Note: Fast input may be required.
Output Specification
Output the grid in its smallest form.
Sample Input
4 4
. * * .
. . . .
. . . .
. * * .
Sample Output
* *
. .
. .
* *
Comments
Batch , Case may have irregular spacing.
We checked the data file and it appears to be fine. Do you have any specific detail we should check? We used the same generator for all cases so if it were to be an issue I'd believe it would happen across all cases. Thanks for the notice though!
Do all of the test cases have 4 black ink dots? Or do some of them have more than four *?
The number of black ink dots can be from 0 ≤ x ≤ NM