Given a point $P$ and a circular arc (a portion of a circle), your task is to calculate the shortest distance from $P$ to the arc. In other words, you need to find a point on the arc such that the distance to $P$ is minimized.
Tip: Please try to use an exact algorithm. In comparison, approximate algorithms are harder to pass the test data for this problem.
Input
The input contains up to $10000$ test cases. Each test case contains $8$ integers $x_1, y_1, x_2, y_2, x_3, y_3, x_p, y_p$. The starting point of the arc is $A(x_1, y_1)$, it passes through point $B(x_2, y_2)$, and the ending point is $C(x_3, y_3)$. The position of point $P$ is $(x_p, y_p)$. It is guaranteed that $A, B, C$ are distinct and not collinear. The absolute values of the coordinates of all the above points do not exceed $20$.
Output
For each test case, output the test case number and the distance from $P$ to the arc, rounded to three decimal places. Your output may have an error of at most $0.001$ compared to the standard output.
Examples
Input 1
0 0 1 1 2 0 1 -1 3 4 0 5 -3 4 0 1
Output 1
Case 1: 1.414 Case 2: 4.000