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

31086번 - Circle 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB509620.000%

문제

Prof. Pang does research on the minimum covering circle problem. He does not like random algorithms so he decides to find an efficient deterministic one. He starts with the classical idea of binary search. In each iteration of the binary search, the following problem needs to be solved:

Given the radius $r$ of a circle and a convex hull $C,ドル let $S$ be defined as $$S=\{p\ |\ \text{the circle with center $p$ and radius $r$ covers $C$}\}.$$ Find the area of $S$.

입력

The first line contains a single positive integer $T$ denoting the number of test cases.

For each test case, the first line contains two integers $n$ and $r$ (1ドル\le n\le 1000,ドル 1ドル\le r\le 30000$) separated by a single space denoting the number of vertices of the convex hull and the radius. If $n=1,ドル the convex hull contains only 1ドル$ point. If $n=2,ドル the convex hull is a line segment.

Each of the following $n$ lines contains two integers $x, y$ ($-10000\le x, y\le 10000$) separated by a single space denoting a vertex at $(x, y)$. It is guaranteed that no two vertices coincide and no three vertices are collinear. Vertices are listed in counter-clockwise order.

It is guaranteed that the sum of $n$ over all test cases does not exceed 200000ドル$.

출력

Output a single decimal indicating the answer. Your answer will be considered correct if the absolute or relative error is no more than 10ドル^{-6}$.

제한

예제 입력 1

3
4 1
0 0
1 0
1 1
0 1
4 1
0 0
1 1
0 2
-1 1
4 100
0 0
1 0
1 1
0 1

예제 출력 1

0.315146743628
0
31016.928202570849

노트

출처

Contest > Open Cup > 2020/2021 Season > Stage 15, Grand Prix of China, Division 1 J번

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

출처

대학교 대회

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

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