DWITE Online Computer Programming Contest, November 2007, Problem 3
A common way to value a house, among other things, is by the area of the rooms. Though it could be less than trivial to accurately calculate the area of a room that is not in a standard shape. Given a floor plan diagram, with rooms of interest marked, their areas should be calculated.
The input will contain two lines with one integer value each,
#
- wall.
- open space{1..5}
- integers to , marking rooms of interest
The output will contain
The area of the room is defined as
Sample Input
5
6
1###..
##4#5.
2#####
.#.#..
...#.3
Sample Output
1
6
4
1
4
Problem Resource: DWITE
Comments
This comment is hidden due to too much negative feedback. Show it anyway.
The number counts as a space in the room.