Sunlight Hours (Small)

Compute the share of building height that gets at least H hours of direct sun as the sun travels a semicircular path past blocking buildings.

Medium6GeometryBinary searchNo attempts yetTime limit5sMemory limit512 MB

Problem

A is about to get married and has enough money for a home, but picking one with enough sunlight is hard. The city is full of buildings, and many homes sit in another building's shadow for much of the day. Work out how many homes in the city meet A's requirement.

The sun rises at (R,0)(-R, 0) at 6 in the morning, travels a semicircular path of radius RR at a constant speed, and sets at (R,0)(R, 0) 12 hours later at 6 in the evening. The center of the semicircle is the origin (0,0)(0, 0) on the ground.

The vertical lines in the picture are buildings, and the blue region is the interval of time when the sun reaches the home at the very bottom of the middle building.

The city has NN buildings. Building ii is the vertical segment from (Xi,0)(X_i, 0) to (Xi,Yi)(X_i, Y_i) and has zero thickness. No two buildings stand at the same coordinate.

Every building holds infinitely many homes of the same form, and no two homes in one building sit at the same height. The homes are spread evenly along the height of the building from the ground to the top, and the number of homes per unit of height is the same in every building. The share of homes that satisfy a condition is therefore the total length of the heights that satisfy it, divided by the sum of all building heights Y1+Y2++YNY_1 + Y_2 + \cdots + Y_N.

The home at height hh in building ii is the point (Xi,h)(X_i, h), where 0hYi0 \le h \le Y_i. The sun reaches that home at a given moment when the segment joining the home and the sun is not blocked by another building. That is, for every building jj with jij \ne i, if the segment crosses the line x=Xjx = X_j, the crossing point must be higher than YjY_j. The home's own building has zero thickness, so it never blocks the sun.

Find the share of homes that get at least HH hours of sun in a day.

Input

The first line holds the number of test cases TT.

Each test case is given in this form.

N R H
X1 Y1
...
XN YN

On the first line, NN is the number of buildings, RR is the radius of the semicircle the sun travels, and HH is the smallest number of sunlit hours A accepts. Each of the next NN lines holds the coordinate XiX_i and the height YiY_i of one building. Coordinates are measured from the center of the semicircle.

Constraints

  • 1T1001 \le T \le 100
  • 1N51 \le N \le 5
  • 100R1000100 \le R \le 1000
  • 1H121 \le H \le 12
  • Yi>0Y_i > 0
  • Xi2+Yi2<R2X_i^2 + Y_i^2 < R^2
  • The values XiX_i are distinct within one test case.
  • Every number in the input is an integer.

Output

For each test case print one line in the form Case #x: y. Here xx is the test case number starting from 1, and yy is the share of homes that get at least HH hours of sun in a day. Print yy rounded to seven digits after the decimal point, with all seven digits shown.