## MWC '15 #1 P2: Postcard

View as PDF

Points: 3 (partial)
Time limit: 2.0s
Memory limit: 256M

Author:
Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

Salarios77 wants to send a postcard to atarw 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).

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

* *
. .
. .
* *

• commented on March 20, 2016, 12:30 p.m.

Batch , Case may have irregular spacing.

• commented on March 20, 2016, 1:32 p.m.

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!

• commented on March 19, 2016, 3:35 p.m.

Why are the problems worth 100 or 300 points? What does this translate into in DMOJ's main points system?

• commented on March 19, 2016, 4:18 p.m.

No, its just point value within the contest, so for example, if someone solve P4, one of the harder problems, it is worth more than if someone solves P1.

• commented on March 19, 2016, 12:43 p.m. edited

Do all of the test cases have 4 black ink dots? Or do some of them have more than four *?

• commented on March 19, 2016, 1:10 p.m.

The number of black ink dots can be from 0 ≤ x ≤ NM