| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 3 초 | 512 MB | 65 | 12 | 9 | 27.273% |
There are two points $A$ and $B$ and an obstacle circle $O$ on a Cartesian plane.
Now, you need to choose a point $C$ on the boundary of $O$ and then move both points $A$ and $B$ to point $C$. While moving, the path of either point $A$ or $B$ can only go outside circle $O$ or touch its boundary.
Your goal is to minimize the total moving distance, that is, the sum of the moving distances of $A$ and $B$.
The first line contains a single integer $t\ (1 \le t \le 10^5),ドル the number of test cases.
Each test case is given on a single line and contains seven integers $x_1, y_1, x_2, y_2, x_3, y_3, r,ドル where $-10^3 \le x_1, y_1, x_2, y_2, x_3, y_3 \le 10^3$ and 1ドル \le r \le 10^3$. Here, $A = (x_1, y_1),ドル $B = (x_2, y_2),ドル and $O$ is a circle centered at $(x_3, y_3)$ with radius $r$. It is guaranteed that neither $A$ nor $B$ is strictly inside $O$.
For each test case, output a single line with a single real number: the answer rounded to the third decimal place. It is guaranteed that the fourth decimal place is neither 4ドル$ nor 5ドル$.
3 0 0 2 2 1 1 1 0 0 2 2 1 0 1 0 0 2 2 1 -1 1
3.571 2.927 3.116