Explore Track of Point

Time Limit: 2000/1000 MS (Java/Others)

Memory Limit: 65536/65536 K (Java/Others)


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$.


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.


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




2015 ACM/ICPC Asia Regional Shanghai Online