[Hidden]
#### 1228. H. In the Spotlight

#### Description

#### Input

The first line of input will contain only a positive integer $p$, which is the number of scenes to evaluate. This will be followed by $p$ scene descriptions. The first line of each scene description will contain three integers, $x_{s}$ and $y_{s}(0<x_{S},y_{S}<1000)$, representing Stacie's position, and $n(0<n<100)$, the number of lights that are turned on. The second line will contain $n$ distinct non-negative integers less than $α_{1},α_{2},...α_{n}$; these are the positions of the lights along the $x$-axis. (Note that distance units are not provided because all distance units are the same.) The third line will contain $n$ positive integers less than $a_{1},a_{2},...a_{n}$; these are the focus angles, in degrees, for each corresponding light on the preceding line. The fourth line of each scene description contains $n$ positive integers less than $I_{1},I_{2},...I_{n}$; these are the intensities of the lights at their source points for each corresponding light on the preceding lines. All numbers on the same line will be separated from each other by exactly one space, with no leading or trailing spaces. (Use 3.14159265 for the value of $π$.)
#### Output

#### Samples

#### Source

UCF Practice 2013

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=x_{max}$, 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.

The Problem:

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 $s$ is the number of the scene in the input (counting from 1) and $t$ 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.

Input
Copy

2 5 5 3 0 5 10 50 45 40 100 100 100 10 2 2 10 40 15 5 400 500

Output

Scene #1: Spotlight intensity on Stacie is 6.000 Scene #2: Spotlight intensity on Stacie is 100.000

Time Limit: | 1000MS (C/C++,Others×2) |

Memory Limit: | 256MB (C/C++,Others×2) |

Special Judge: | No |

AC/Submit: | 1 / 1 |

Tags: |