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!
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 the grid in its smallest form.
4 4 . * * . . . . . . . . . . * * .
* * . . . . * *