eolymp
bolt
Try our new interface for solving problems
Problems

The Laurel-Hardy Story

The Laurel-Hardy Story

Time limit 1 second
Memory limit 128 MiB
prb1507

Laurel and Hardy are two famous movie characters of the 50's. They are well known for their differences in weight as you can see in the picture on the left. In case you don't 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 seesaw 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 on the right (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 = h[1] is the distance of Hardy from the ground. Your job is to find out the distance of Laurel (denoted by h[2] = AC) from the ground.

prb1507-2-en

Input data

First line contains an integer n (0 < n1000), 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:

Each line contains three integers r (10r100), d (5dr), h[1] (5h[1]d). The meanings of these integers are given in the problem statement above.

Output data

For each input set produce one line of output. This line contains the serial of output followed by a floating-point number, which indicates the value of h[2]. This floating-point number should be rounded up to four digits after the decimal point. Look at the output for sample input for details.

Examples

Input example #1
2
10 10 10
10 7 6
Output example #1
Case 1: 10.0000
Case 2: 8.0342