The Red Gem

No attempts yetTime limit1sMemory limit128 MB

Problem

In circle land, in the museum of circles, a grand red circular gem is on display.

The curator has placed the gem on a purple circular platform, surrounded by ordinary orange circular gems.

Visitors (treated as points) may stand only on the circumference of the purple platform; they cannot step onto its interior. The orange gems can block the view of the red gem. All shapes lie flat in one plane, and a line of sight is the straight segment joining a visitor to a point of the red gem; that point is blocked if the segment passes through the interior of some orange gem (disk).

Determine the proportion of the purple platform's circumference from which the entire red gem is visible, completely unobstructed by any orange gem.

Input

The input contains several test cases. Each test case begins with a line of five integers:

n p x y r

where $n$ ($1 \le n \le 100$) is the number of orange gems, $p$ ($10 \le p \le 1000$) is the radius of the purple platform, $(x, y)$ ($-1000 \le x, y \le 1000$) is the center of the red gem relative to the platform's center, and $r$ ($0 < r \le 1000$) is the radius of the red gem. The red gem lies entirely on the platform.

Each of the next $n$ lines contains three integers:

x y r

the center $(x, y)$ ($-1000 \le x, y \le 1000$, relative to the platform's center) and radius $r$ ($0 < r \le 1000$) of one orange gem. Every orange gem also lies entirely on the platform. The orange gems do not overlap the red gem, and they do not overlap one another.

The input ends with a line of five zeros, 0 0 0 0 0, which is not a test case.

Output

For each test case, print on its own line the proportion of the purple platform's circumference from which the entire red gem is visible, unobstructed by any orange gem. This value lies between 0 and 1 inclusive. Print it with exactly 4 digits after the decimal point, using standard round-half-up rounding (5 up, 4 down; e.g. 0.12344 → 0.1234, 0.12345 → 0.1235). Do not print extra spaces or blank lines between answers.