Fence |
There is an area bounded by a fence on some flat field. The fence has the height h and in the plane projection it has a form of a closed polygonal line (without self-intersections), which is specified by Cartesian coordinates (Xi, Yi) of its N vertices. At the point with coordinates (0, 0) a lamp stands on the field. The lamp may be located either outside or inside the fence, but not on its side as it is shown in the following sample pictures (parts shown in a thin line are not illuminated by the lamp):
The fence is
perfectly black, i.e. it is neither reflecting, nor diffusing, nor letting the
light through. Research and experiments showed that the following law
expresses the intensity of light falling on an arbitrary illuminated point of
this fence:
You are to write a program that will
find the total illumination of the fence that is defined as the sum of
illuminations of all its illuminated boards.
0.5 1.7 3 1.0 3.0 2.0 -1.0 -4.0 -1.0
5.34