Logo
(追記) (追記ここまで)

21097번 - Circle 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 512 MB6512927.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ドル$.

제한

예제 입력 1

3
0 0 2 2 1 1 1
0 0 2 2 1 0 1
0 0 2 2 1 -1 1

예제 출력 1

3.571
2.927
3.116

힌트

출처

Camp > Petrozavodsk Programming Camp > Winter 2021 > Day 6: PKU Contest 2 C번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /