Coverage

No attempts yetTime limit1sMemory limit128 MB

Problem

A cell phone user travels along a straight line segment whose two endpoints have integer coordinates. The user has cell phone coverage at a point if and only if that point lies within the transmission radius of at least one transmission tower. As the user moves along the path, coverage may be gained or lost whenever the user crosses inside the radius of some tower or leaves the radii of all towers.

Given up to $100$ towers with their positions and transmission radii, compute the percentage of the path along which the user has cell phone coverage.

All $(x, y)$ coordinates are integers in the range $[-100, 100]$, and every tower radius is an integer in the range $[1, 100]$.

Input

The input is a sequence of configurations, one per line, each of the form:

N C0X C0Y C1X C1Y T1X T1Y T1R T2X T2Y T2R ...

Here $N$ is the number of towers, $(C0X, C0Y)$ is the start of the user's path, and $(C1X, C1Y)$ is the end of the path. For each tower $k$, $(TkX, TkY)$ is its position and $TkR$ is its transmission radius. The start and end points of every path are distinct.

The input ends with a line containing a single $0$:

0

Output

For each configuration, print one line containing the percentage of the path that has cell phone coverage, rounded to two decimal places.