Time limit
2s
Memory limit
128 MB
A rectangular room of size N x M is divided into 1 x 1 unit cells. . is an empty cell, # is a wall that blocks light, and * is a light source. There is exactly one light source, treated as a point at the center of the * cell.
For a point in an empty cell, light reaches that point if the line segment from the light source to the point does not intersect the interior of any wall cell. Empty space that light cannot reach is shadow. Wall cells block light, but their own area is not included in the area to output.
Given the room, compute the area of empty space that is in shadow.
The first line contains two positive integers N and M. Both N and M are at most 50.
The next N lines describe the room. . is an empty cell, # is a wall, and * is the light source. Exactly one light source is given.
Print the shadow area on the first line. An absolute or relative error of at most 10^-9 is accepted.