Alex is a circle of radius . Well, life as a circle is not
easy. If he were a point, moving around and passing through
doors would be effortless. But now he has to carefully inspect
the surroundings before making every move.
Alex’s is initially at position , where is much bigger than the
width of the corridor .
Alex wants to meet Bob, who happens to be living to the far
right of the corridor (may as well be somewhere at , where is much bigger than
). The lengths of
the two doors are .
It is guaranteed that , so that door B will never hit the opposite side of
the wall.
You are given
scenarios. In each scenario, the angles and are given (both are radians in the
range ). Find
the largest
such that when Alex’s radius is shrunk to , he can reach Bob while avoiding
the obstacles (walls and doors).
Formally, Alex when shrunk to radius can reach Bob if and only if there
exists a (continuous) curve from to such that the
minimal distance between a point on the curve and a point on an
obstacle (a wall or a door) is at least . In particular, if then Alex will be able to
reach Bob.
Input
The first line of input consists of three integers,
, , and ( and ). The second line of
input consists of an integer (), the number of scenarios to
follow. Each of the next lines consists of a pair of real
numbers, representing angles and (in radians). The numbers are
given with exactly
decimal places.
Output
For each scenario, output the required answer on a separate
line. Your answer will be accepted if its absolute or relative
error (compared to the judge’s answer) is at most .
Sample Input 1 |
Sample Output 1 |
10 6 8
4
0.0000 0.0000
3.1415 0.0000
1.0472 0.0000
1.0472 1.5708
|
0.000000000
3.000000000
2.598079885
1.000000000
|