Author: | Far-Eastern Subregional | Time limit: | 1 sec | |
Input file: | input.txt | Memory limit: | 8 Mb | |
Output file: | output.txt | |||
Maximum points: | 100 |
Several pieces of cloth are laid out on the table without overlapping each other. These pieces contain many holes, some so big that entire other piece of cloth may fit into them. Digital black-and-white image of the tabletop was taken, on which areas covered by cloth are represented with '*'s and not covered areas with '.'s. A single piece of cloth is thus represented with 4-connected area of '*'s - i.e., a group of '.'s located next to each other horizontally or vertically, but not diagonally. For example, on the following image there are three pieces - one without holes, and two with one hole each - first has area of 8, and the second - area of 12.
.***..*** .*.*.**.* .***.*.** *...**.*.
Your goal is to find the piece with the most holes in it. The hole is a 4- connected area of '.'s completely surrounded with '*'s. If several pieces have the same number of holes, you must select the one with the smallest area.
No. | Input file (input.txt ) |
Output file (output.txt ) |
---|---|---|
1 |
|
|