The ICPC World Finals are held in a luxurious hotel with a large ballroom. A buffet will be served there, and the organizers want to decorate its walls with photographs of past champion teams.
To avoid any appearance of favoring some teams over others, every photograph must be well lit: each one must be directly illuminated by at least one lightbulb. As a result, the perimeter wall splits into illuminated stretches (where photographs may hang) and dark stretches (where they may not).
Seen from above, the ballroom is an axis-aligned rectangle whose lower-left corner is at $(0, 0)$ and whose upper-right corner is at $(X, Y)$. Inside it are several lightbulbs and several columns. Every column is a cylinder running from floor to ceiling, so light can neither pass through it nor go over it; in the top view each column is a circle. Each lightbulb is a point that emits light in every direction.
A point $p$ on the perimeter wall is illuminated if there is a straight light ray - a line segment - that starts at some lightbulb, ends at $p$, and does not touch or pass through any column.
Given the floor plan, determine the total length of the illuminated parts of the perimeter wall.
The input contains several test cases.
Each test case begins with a line holding four integers $L$, $C$, $X$, and $Y$: the number of lightbulbs, the number of columns, and the width and height of the ballroom.
The next $L$ lines each contain two integers $x$ and $y$, the coordinates of a lightbulb. The following $C$ lines each contain three integers $x$, $y$, and $r$: the coordinates of a column's center and its radius.
Constraints: $1 \le L, C \le 10^3$ and $4 \le X, Y \le 10^6$. For every coordinate pair $0 < x < X$ and $0 < y < Y$ (for both lightbulbs and column centers). Every radius is positive. No two columns overlap, though they may touch, and no column touches or crosses the ballroom border. No lightbulb lies inside a column or on its boundary, and no two lightbulbs share a position.
The input ends with a line containing 0 0 0 0, which must not be processed.
Input is read from standard input.
For each test case, print a single line with the total length of the illuminated parts of the perimeter wall.
The value must be printed as a real number with exactly four digits after the decimal point, rounding the last digit up (that is, take the ceiling at the fourth decimal place).
Output is written to standard output.