The Laurel-Hardy Story

Laurel and Hardy are two famous movie char- acters of the 50’s. They are well known for their differences in weight as you can see in the pic- ture on the left. In case you dont know them I should add that Laurel was the lighter guy. In their younger days Laurel and Hardy used to play with a strange seesaw and when the see- saw was at a stable position Hardy was always nearer the ground. We will now investigate a two dimensional version of their seesaw. The seesaw that Laurel Hardy used can be considered as part of a circle of radius r, as shown in the picture below (Filled gray and having the shape of a D). Hardy sat on point B (rightmost point of the seesaw) and Laurel sat on point A (Leftmost point of the seesaw top AB). d=EF is the distance between the midpoint of line AB and arc AFB. So E is the midpoint of line AB and F is the midpoint of arc AFB. MN is the ground of the seesaw, which is horizontal with the plane. BD=h1 is the distance of Hardy from the ground. Your job is to find out the distance of Laurel (denoted by h2=AC) from the ground. Input First line of the input file contains an integer N (0 < N ≤ 1000), which indicates how many sets of inputs are there. Each of the next N lines contains a single set of input. The description of each set is given below: Eachlinecontainsthreeintegersr(10≤r≤100),d(5≤d≤r),h1 (5≤h1 ≤d). Themeanings of these integers are given in the problem statement above.

2/2 Output For each set of input produce one line of output. This line contains the serial of output followed by a floating-point number, which indicates the value of h2. This floating-point number should be rounded up to four digits after the decimal point. Look at the output for sample input for details. Sample Input 2 10 10 10 10 7 6 Sample Output Case 1: 10.0000 Case 2: 8.0342