Where's the Rainbow
Time limit1sMemory limit128 MB
Given the height of a semicircular rainbow and the viewing angle to its top, compute the distance from the origin to the nearest point of the arc.
Problem
After a long day of solving problems you step outside and see a rainbow, and you want to know how far you have to walk to reach the pot of gold at its end.
On the two dimensional plane the rainbow is a semicircle whose center lies on the axis. Its highest point has height , so its radius is , and if the center is then the top of the arc is with . The two points where the arc meets the axis belong to the rainbow.
You stand at the origin. Ignore your height and width and treat yourself as a single point. Looking up from the origin at the top of the rainbow gives an angle of inclination .
Given and , find , the distance from you to the closest point of the rainbow.

Input
The first line contains the number of test cases. Each of the following lines holds one test case as two real numbers separated by a single space. The first value is (), the height of the rainbow at its highest point. The second is the angle of inclination (), measured in degrees. Both numbers consist of decimal digits and at most one decimal point.
Output
For each test case print one line of the form Case x: d, where is the case number starting from 1 and is the distance from you to the rainbow, rounded to six digits after the decimal point. Always print all six digits, trailing zeros included.
No input sits close enough to a rounding boundary for the sixth digit to be in doubt, so double precision arithmetic produces the same digits as the intended answer.