H. Beyblade Battle
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Tyson is up to his beyblading ways again. In a beyblade battle, two players launch their beyblades (small spinning tops) into an arena to battle each other until one stops spinning.

This time, Tyson is up against a particularly defensive opponent, and needs to determine how close his beyblade can get to his opponent's since his own beyblade is equipped with a ranged attack. However, his opponent's beyblade has two defensive walls set up that try to keep other beyblades away.

Tyson has done some preliminary calculations and determined that the arena can be modeled as the $$$2D$$$ plane with the opponent's beyblade at the origin. The walls protecting the opponent's beyblade are both infinite lines that pass through the origin (forming an X-shape with the origin at the crossing). The first wall makes an angle of $$$\alpha$$$ degrees measured counterclockwise from the positive $$$x$$$-axis, and the second wall makes an angle of $$$\beta$$$ degrees (also measured counterclockwise from the positive $$$x$$$-axis). Tyson's beyblade begins at location $$$(p_x, p_y)$$$, and Tyson launches it at an angle of $$$\theta$$$ degrees (measured counterclockwise with respect to the vector extending from $$$(p_x,p_y)$$$ in the positive $$$x$$$ direction). When the beyblade collides with either wall, it reflects off the wall perfectly with angle of incidence equal to the angle of reflection, much like light bounces off of a mirror. Assuming that Tyson's beyblade keeps traveling for infinite time, what is the closest distance it will get to his opponent's beyblade, and how many total times will it bounce off of a wall?

It is guaranteed that $$$0 \leq \alpha \lt \beta \lt 180$$$, $$$\beta - \alpha \gt 10^{-2}, 180 - (\beta - \alpha) \gt 10^{-2}$$$, and that Tyson's beyblade starts at least distance $$$10^{-2}$$$ away from either wall. Furthermore, the minimum distance between Tyson's beyblade and the origin along its path of motion is at least $$$10^{-6}$$$ units.

Input

The first line contains two space-separated fixed-point real numbers, $$$\alpha$$$ and $$$\beta$$$, such that $$$0 \le \alpha \lt \beta \lt 180$$$. It is guaranteed that $$$\beta - \alpha \gt 10^{-2}$$$ and $$$180 - (\beta - \alpha) \gt 10^{-2}$$$.

The second line contains two space-separated integers $$$p_x$$$ and $$$p_y$$$ $$$(-10^5 \le p_x, p_y, \le 10^5)$$$.

The third line contains one fixed-point real number $$$\theta$$$ $$$(0 \le \theta \lt 360)$$$.

All fixed-point real numbers $$$\alpha$$$, $$$\beta$$$, and $$$\theta$$$ have exactly five digits after their decimal points and will not be in scientific notation.

Output

Print a real number and an integer, separated by a space: the closest distance Tyson's beyblade reaches to the origin along its trajectory, and the total number of times the beyblade bounces off of a wall. Your answer will be judged correct if the distance differs from the judge solution by an absolute or relative error of at most $$$10^{-6}$$$.

Examples
Input
0.00000 90.00000
1 1
45.00000
Output
1.414214 0
Input
45.00000 90.00000
2 3
270.00000
Output
2.000000 3