Starlet Stacie always insists that the spotlights must shine upon her sufficiently, regardless of where she stands on the stage. Otherwise, she makes a scene.
Consider the floor of the stage to be a Cartesian plane, the front of the stage is the x-axis and the sides of the stage are at x=0 and x=xmax, with the y-axis going toward the back of the stage.
So Stacie's stage position is always 0<x<xmax and 0<y<ymax The spotlights are all mounted along the x-axis, and are all aimed onto the stage (parallel to the y-axis), though they might have different focus angles. Height above the stage floor isn't important, so we need to consider only the 2-dimensional plane.
The focus angle of each spotlight is an angle relative to the aimed direction, on either side, and indicates the area covered by that light beam. Thus each spotlight will essentially cover a stage area that is an isosceles triangle (with the back of the stage as the 3rd side).
Anything outside a spotlight's triangular coverage area gets negligible illumination. The intensity of a light within the triangle (any point within .01 degrees of the focus angle is considered inside the triangle) is given by Isource÷d2 where Isource is the intensity of the light at its source point, and d is the distance from the source point.
If Stacie is standing within the coverage area of more than one light, the total intensity of light shining on her is simply the sum of all such lights.
Given Stacie's stage position and the positions and intensities of various spotlights during a scene, find the intensity of light shining on Stacie.
For each scene desc
Scene #s: Spotlight intensity on Stacie is t
where ss is the number of the scene in the input (counting from 1) and tt is the total light intensity, rounded to the nearest three decimal places (examples: 1.2374 would round to 1.237 and 1.2375 would round to 1.238).
Leave a blank line after the output for each data set. Follow the format illustrated in Sample Output.
2 5 5 3 0 5 10 50 45 40 100 100 100 10 2 2 10 40 15 5 400 500
Scene #1: Spotlight intensity on Stacie is 6.000 Scene #2: Spotlight intensity on Stacie is 100.000