The little Jerry is now developing a game. You know developing game is a complex thing as there are many challenges involved. For example, little Jerry is now stuck with some geometric patterns and asks for your help. To help him out, you do not need to know every detail of the game, only information of the particular frame should suffice. Here it is:
Two circles are attached with a wall. They are fixed. A line is attached to the circles in such a way that it touches both the circles and each of the touching points has lower Y coordinates than that of the corresponding center of the circle. Now another circle is dropped on the set up from above (higher Y coordinate). The circle will fall along the Y axis with a constant velocity of 1 unit per second until it touches the line. When it touches the line, it starts to rotate along the line towards the circle that has lower Y coordinate from touching point with a constant angular velocity of 1 revolution per second. When it touches the circle at the end, it stops. If both the touching points have same Y coordinate, i.e. the line is parallel to the X axis, then the falling circle stops as soon as it touches the line.
Now given the setup, you need to find the time after which the falling circle will stop.
Figure 1: Initial Setup, the circle starts falling | Figure 2: The circle touches the line and starts to rotate | Figure 3: The circle touches the circle at the end and stops |
Input
Input starts with an integer T (≤ 10000), denoting the number of test cases.
Each case contains three lines. First two lines contain information of the fixed circles on the line and the 3rd line describes the falling circle. Each of the circles are described with three integers x, y and r (-105 ≤ x, y ≤ 105, 0 < r ≤ 100), where (x, y) denotes the co-ordinate of the center, r denotes the radius. The falling circle will always touch the line first and will drop between the fixed circles.
Output
For each case, print the case number and the required time in seconds. Error less than 10-6 will be ignored. Assume that the falling circle will not bounce when it drops on the line.
Sample
Sample Input | Sample Output |
---|---|
1 0 0 5 100 1 6 50 60 10 | Case 1: 55.000000 |