Explore Track of Point

Time Limit: 1000ms
Memory Limit: 65536KB
This problem will be judged on HDU. Original ID: 5476
64-bit integer IO format: %I64d      Java class name: Main

Description

In Geometry, the problem of track is very interesting. Because in some cases, the track of point may be beautiful curve. For example, in polar Coordinate system, $\rho = \cos 3\theta$ is like rose, $\rho = 1 - \sin \theta$ is a Cardioid, and so on. Today, there is a simple problem about it which you need to solve.

Give you a triangle $\Delta ABC$ and AB = AC. M is the midpoint of BC. Point P is in $\Delta ABC$ and makes $min\{\angle MPB + \angle APC, \angle MPC + \angle APB\}$ maximum. The track of P is $\Gamma$. Would you mind calculating the length of $\Gamma$?

Given the coordinate of A, B, C, please output the length of $\Gamma$.

Input

There are T ($1 \leq T \leq 10^4$) test cases. For each case, one line includes six integers the coordinate of A, B, C in order. It is guaranteed that AB = AC and three points are not collinear. All coordinates do not exceed $10^4$ by absolute value.

Output

For each case, first please output "Case #k: ", k is the number of test case. See sample output for more detail. Then, please output the length of $\Gamma$ with exactly 4 digits after the decimal point.

Sample Input

1
0 1 -1 0 1 0

Sample Output

Case #1: 3.2214

Source

Language: 
Theme: 
Share Code? 

Powered by NB231 | Current Style: .