404983: GYM101726 F Sunbathing in the garden

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

F. Sunbathing in the gardentime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

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.

Input

The 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
Output

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.

ExampleInput
2
3 2 1
10 0 5
4 5 3
0 2 4 20
Output
254.2026707524
747.7036208413

Source/Category

加入题单

算法标签: