Circle
면접 대비시간 제한3초메모리 제한512 MB
원 밖의 두 점 A와 B에 대해, 원 위의 점 C를 골라 두 경로가 원 밖을 지나도록 하면서 A에서 C까지와 B에서 C까지 거리의 합을 최소로 만든다.
문제
There are two points and and an obstacle circle on a Cartesian plane.
Now, you need to choose a point on the boundary of and then move both points and to point . While moving, the path of either point or can only go outside circle or touch its boundary.
Your goal is to minimize the total moving distance, that is, the sum of the moving distances of and .
입력
The first line contains a single integer , the number of test cases.
Each test case is given on a single line and contains seven integers , where and . Here, , , and is a circle centered at with radius . It is guaranteed that neither nor is strictly inside .
출력
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 nor .