Let’s imagine our earth is at the origin of a 3d cartesian coordinate system and has the radius of 100 units. The most beautiful star of the universe Der Stern is at (0, 0, s). You can imagine Der Stern to be a tiny but very bright point. Tonight the moon is at (0, 0, m) and the radius of the moon is r. Calculate the probability that a person would be able to see Der Stern if the position of the person is randomly chosen on the earth surface. You will be able to see Der Stern if there is a line of sight between the person and Der Stern.
Input
The input begins with the number of cases T (1 ≤ T ≤ 300). T test cases follow. Every case consists of 3 integers: s, m, r (-106 ≤ s, m ≤ 106; 1 ≤ r ≤ 106).
The earth, moon and the Star would always be disjoint. That is, they won’t intersect or touch, also none of them will be inside the other.
Output
For each case, output the case number and the required probability. Answer is expected to be within absolute or relative error of 0.001 of the correct solution.
Sample
Sample Input | Sample Output |
---|---|
1 1000 500 1 | Case 1: 0.4499189902 |
Notes
Check the picture. The sphere has a radius of r. Suppose we cut a cap of height h (h ≤ r). The surface area of the cap is 2πrh.