404983: GYM101726 F Sunbathing in the garden
Description
A company wants to demolish a building and build a garden in one of the main avenues of Yekaterinburg, but first it wants to determine for how long each day will the sun shine in the garden, since there are many other buildings around. This is important since sunbathing is a very popular activity in Yekaterinburg during the summer. The garden is considered to receive sunlight if at least a piece of it is hit by solar rays.
To make things easy, the company chose one day of the year to make the measurings. In this day the sun rises at 5:30 and sets at 21:30 (Russian summers are very long). Consider that the sun is infinitely far and moves in a constant angular velocity.
The sun rises in the east and sets in the west. The buildings are also east-west aligned; their width and the spacing between them is constant, and the garden has the same width as the buildings.
Your task is to determine for how long each day the sun will shine in the garden.
InputThe first line has a single integer T, the number of test cases.
Each case consists of two lines. The first has 3 integers N, W and S, the number of buildings, their width, and the spacing between each adjacent pair of them, respectively.
The second line has N integers h1, ..., hN, the height of each building. The buildings are given from west to east. A height of 0 indicates that the garden will be built at that site, and exactly one height in each case is 0. All units are in meters.
Limits
- 1 ≤ T ≤ 103
- 2 ≤ N ≤ 100
- 1 ≤ W, S ≤ 100
- 0 ≤ hi ≤ 50
For each case, print a single floating point number, the time in minutes that the garden will receive sunlight each day. Errors of up to 10 - 4 are tolerated.
ExampleInput2Output
3 2 1
10 0 5
4 5 3
0 2 4 20
254.2026707524
747.7036208413