#P3744. 李彬的几何

    ID: 2703 远端评测题 1000ms 128MiB 尝试: 0 已通过: 0 难度: 7 上传者: 标签>数学贪心计算几何Special Judge枚举,暴力叉积

李彬的几何

Description

PP has NN vertices P1,P2,P3,,PNP_1, P_2, P_3, \dots, P_N. The coordinates of vertex PiP_i in the 2D plane are (xi,yi)(x_i, y_i). The vertices are given in clockwise order.

Li Bin may choose a real number DD, then move each vertex by at most DD units. Now he wants to know the minimal value of DD that makes this convex polygon no longer convex.

Input Format

The first line contains 11 integer NN.

The next NN lines each describe a vertex with two integers, the xix_i and yiy_i of that vertex. The vertices are given in clockwise order and form a strictly convex polygon.

Output Format

Output a real number DD, representing the minimal DD that makes this polygon non-convex.

Let your answer be aa and the standard answer be bb. You are correct if and only if abmax(1,b)104\frac{|a - b|}{\max(1, b)} \le 10^{-4}.

4
0 0
0 1
1 1
1 0

0.3535533906

6
5 0
10 0
12 -4
10 -8
5 -8
3 -4
1.0000000000

Hint

Constraints: For 100%100\% of the testdata, 4N10004 \le N \le 1000, 109xi,yi109-10^9 \le x_i, y_i \le 10^9.

Translated by ChatGPT 5