Score : $600$ points
There is a $N \times N$ grid, with blocks on some squares.
The grid is described by $N$ strings $S_1,S_2,\dots,S_N$, as follows.
#
, there is a block on the square at the $i$-th row from the top and $j$-th column from the left..
, there is not a block on the square at the $i$-th row from the top and $j$-th column from the left.Takahashi can do the operation below zero or more times.
Find the minimum number of stamina points needed to destroy all the blocks.
#
and .
.Input is given from Standard Input in the following format:
$N$ $S_1$ $S_2$ $\vdots$ $S_N$
Print the answer as an integer.
5 ##... .##.. #.#.. ..... ....#
4
By choosing the subsquares below, Takahashi will consume $4$ stamina points, which is optimal.
3 ... ... ...
0
There may be no block on the grid.
21 ..................... ..................... ...#.#............... ....#.............#.. ...#.#...........#.#. ..................#.. ..................... ..................... ..................... ..........#.....#.... ......#..###......... ........#####..#..... .......#######....... .....#..#####........ .......#######....... ......#########...... .......#######..#.... ......#########...... ..#..###########..... .........###......... .........###.........
19