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

5438번 - Secret Island Base 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB5811410.256%

문제

A group of ninjas want to set up a new secret base for training. For its location, they have selected a remote group of islands. In order to keep the base as covert as possible, they want to build it as far away from the coast as possible. To determine how suitable each island is in this respect, the ninjas have come to you for help.

You must write a program which is given the islands; they are modeled as polygons in flat space. For each island they wish to know the furthest away one could possibly get from the coastline. The distance from a point to the coastline is defined as the shortest Euclidean distance (i.e. distance in a straight line) from this point to a point on the coastline.

Of course, this must remain a secret. They promise they won’t kill you, but do not discuss this with anyone! Upsetting a ninja is the last thing you (want to) do in this world.

입력

The first line of the input contains a single number: the number of islands to follow. Each island is given as follows:

  • One line with one integer N, satisfying 3 ≤ N ≤ 20: the number of vertices of the polygon describing the coastline of the island.
  • N lines, each with two integers x and y, satisfying −100 ≤ x, y ≤ 100: the coordinates of each vertex.

The vertices are given in counterclockwise order.

출력

For every island in the input, the output should contain a single floating point number on a single line: the largest distance over which one can be separated from the coastline, while being on the island. Your answer should have either an absolute or a relative error of at most 10-3.

제한

예제 입력 1

1
3
0 0
10 0
3 8

예제 출력 1

2.7421536261

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2011 Preliminaries G번

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

출처

대학교 대회

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

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