P6719 [BalkanOI 2011] 2circles

Description

In the Cartesian coordinate plane, there is a convex polygon with $N$ points. Now you want to place two circles with radius $R$ inside it, such that the two circles do not overlap. Find the maximum possible value of $R$.

Input Format

The first line contains an integer $N$. The next $N$ lines each contain two integers $x_i, y_i$, representing the coordinates of the $i$-th point of the polygon.

Output Format

Output a single real number $R$.

Explanation/Hint

#### Explanation for Sample 1 When the two circle centers are placed on the diagonal of the square, the radius is maximized, as shown in the figure: ![](https://cdn.luogu.com.cn/upload/image_hosting/xd9hqgbp.png) The radius is $\frac{\sqrt{2}}{2\times (1+\sqrt{2})}\approx 0.293$. #### SPJ Scoring Criteria If the error between your answer and the standard answer does not exceed $0.001$, you will get AC. #### Constraints and Limits - For $10\%$ of the testdata, $N = 3$ is guaranteed. - For $40\%$ of the testdata, $N \le 250$ is guaranteed. - For $100\%$ of the testdata, $3 \le N \le 5\times 10^4$, $-10^7 \le x_i, y_i \le 10^7$, and the points are given in counterclockwise order. #### Note This problem is translated from [Balkan Olympiad in Informatics 2011](http://www.boi2011.ro/boi2011/) [Day 1](http://www.boi2011.ro/boi2011/?pagina=probleme) [T1 2circles](http://www.boi2011.ro/resurse/tasks/2circles.pdf)。 Translated by ChatGPT 5