Arbor Day is a big day for the Pine family of Chestnut Grove. Every year the family, led by their father Hickory, covers the front yard and the front of the house with hundreds of Arbor Day decorations. At night Hickory aims a yard light at the front of the house so that people walking by get a good look at the whole display.
Some decorations block the light and drop shadows on the front of the house. Others act like mirrors and send light back onto parts of the wall the direct beam never reaches. In one layout the light spreads out from a point low in the yard, a horizontal decoration in the middle swallows the middle of the beam, and a decoration on the right reflects part of it back, so about 75% of the front of the house ends up lit.
The decorations change from year to year, so Hickory wants one general method that takes a layout and reports how much of the front of his house will be lit.
Light and decorations follow these rules.
Report what percentage of the length of the front of the house is reached by at least one ray.
The input holds several test cases.
Each test case starts with a line holding an integer n, a real number ang and a real number len. n is the number of decorations (0≤n≤10). ang is the spread of the light in degrees (0<ang≤150). The light is always at the origin, and the beam is symmetric about the positive y axis, opening ang/2 degrees on either side. len is the greatest distance any one ray can travel. Past that distance the beam is too weak to add anything to the lighting of the house.
Each of the next n lines holds five integers x1 y1 x2 y2 r. The first four give the endpoints of a decoration. r is 0 for a non-reflective decoration and 1 for a reflective one.
After those n lines comes a single line with four integers x1 y x2 y giving the endpoints of the front of the house, with y>0.
No decoration meets another decoration, the front of the house, or the origin, and no decoration has a y coordinate larger than the y of the front of the house. Every coordinate is between −10000 and 10000. In each test case the placement of the decorations and the value of len keep the total number of reflections at 100 or fewer.
A line holding 0 0.0 0.0 ends the input. It is not a test case.
For each test case print one line in this form.
Case k: p
k is the number of the test case, counting from 1, and p is the percentage of the front of the house that is lit. Round to the nearest hundredth, round a value that lands exactly halfway up, and print exactly two digits after the decimal point. No test case has an answer within 10−6 of a rounding boundary.