405435: GYM101962 G Barra Lighthouse

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

G. Barra Lighthousetime limit per test1.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

The Barra Lighthouse is a famous touristic spot in Soteropolis. The lighthouse is 22 meters tall and its construction dates to 1698. At that time, the lighthouse was constructed right after the tragic wreck of the lead ship of the Commercial Soteropolis fleet.

It is known that the lamp of the lighthouse revolves in counter-clockwise direction with constant speed and a period of $$$T$$$ seconds. Also, it is known that the emitted light is a beam with a spread angle of $$$\alpha$$$ degrees (see the picture below), and that the person responsible for monitoring the coast can only see ships that are at most $$$d$$$ meters away from the lighthouse and that are lightened. We can imagine a system of two-dimensional coordinates with the lighthouse being on $$$(0, 0)$$$.

There are $$$n$$$ ships in the coast of Soteropolis. Those ships are all at bearth, so their coordinates won't change. The $$$i$$$-th of them is at coordinates $$$(x_i, y_i)$$$, $$$y_i > 0$$$. At the moment $$$t = 0$$$, the light beam has its center aligned with the x-axis positive direction, like in the picture shown above.

Your task is to compute, for each ship, for how much time it was visible to the guy in the lighthouse after $$$X$$$ seconds have passed.

Input

The first line contains two integers $$$n, X$$$ ($$$1 \leq n \leq 10^5$$$; $$$1 \leq X \leq 10^7$$$) – the number of ships in the coast and how many seconds have passed, respectively.

The second line contains two real numbers and one integer $$$\alpha, T, d$$$ ($$$0.5 \leq \alpha \leq 45.0$$$; $$$10^{-4} \leq T \leq 10^4$$$; $$$1 \leq d \leq 10^7$$$) – the spread angle of the light beam, the period of the lamp and the maximum distance a ship can be seen from the lighthouse, respectively.

Then $$$n$$$ lines follow, each one with two integers describing x-coordinate and y-coordinate of a ship, respectively. The absolute value of the coordinates won't exceed $$$10^4$$$ and y-coordinates will be strictly greater than zero.

The real numbers in the input will have no more than 5 decimal places.

Output

Output $$$n$$$ lines. The $$$i$$$-th should have a real number – for how many seconds the $$$i$$$-th ship (in the order they appear in the input) was visible to the guy in the lighthouse, during the $$$X$$$ seconds.

Your answer will be considered correct if its absolute error or its relative error does not exceed $$$10^{-4}$$$.

ExampleInput
3 5
15.0 2.2 5
1 1
1 5
-2 1
Output
0.27500000000
0.00000000000
0.18333333333

加入题单

算法标签: