Problem E
Monochromatic Minesweeper

In the game of minesweeper you are given a rectangular grid
of a particular size. At the beginning of the game, the
contents of all cells are hidden. The player can reveal the
content of a cell by clicking on it. Some cells contain mines,
and all other cells contain a number between
Minesweeper can be a dangerously addictive game, so you have been assigned to a task force intended to eliminate minesweeper addiction once and for all. Your job is to construct minesweeper boards that are so frustrating to play that any player who tries to solve one will immediately give up on the game forever.
In particular, you will need to find boards with a certain
structure which we will now describe. We call a board
Input
The input will contain a single line with
Output
The first line of output must contain the smallest possible
number of mines in any
Sample Input 1 | Sample Output 1 |
---|---|
3 3 1 |
1 ... .#. ... |
Sample Input 2 | Sample Output 2 |
---|---|
6 6 3 |
16 #.#..# .#.##. #...#. .#...# .##.#. #..#.# |