B. Volatile Kite

Codeforces
IDCF800B
Time2000ms
Memory256MB
Difficulty
geometry
You are given a convex polygon _P_ with _n_ distinct vertices _p_1, _p_2, ..., _p__n_. Vertex _p__i_ has coordinates (_x__i_, _y__i_) in the 2D plane. These vertices are listed in clockwise order. You can choose a real number _D_ and move each vertex of the polygon a distance of at most _D_ from their original positions. Find the maximum value of _D_ such that no matter how you move the vertices, the polygon does not intersect itself and stays convex. ## Input The first line has one integer _n_ (4 ≤ _n_ ≤ 1 000) — the number of vertices. The next _n_ lines contain the coordinates of the vertices. Line _i_ contains two integers _x__i_ and _y__i_ ( - 109 ≤ _x__i_, _y__i_ ≤ 109) — the coordinates of the _i_\-th vertex. These points are guaranteed to be given in clockwise order, and will form a strictly convex polygon (in particular, no three consecutive points lie on the same straight line). ## Output Print one real number _D_, which is the maximum real number such that no matter how you move the vertices, the polygon stays convex. Your answer will be considered correct if its absolute or relative error does not exceed 10 - 6. Namely, let's assume that your answer is _a_ and the answer of the jury is _b_. The checker program will consider your answer correct if . [samples] ## Note Here is a picture of the first sample ![image](https://espresso.codeforces.com/19824412aafab8fcabef388cb9565e54cd80cab6.png) Here is an example of making the polygon non-convex. ![image](https://espresso.codeforces.com/1c6fac549ba45c609730a1c6ac96333bd07c3ff2.png) This is not an optimal solution, since the maximum distance we moved one point is  ≈ 0.4242640687, whereas we can make it non-convex by only moving each point a distance of at most  ≈ 0.3535533906.
Samples
Input #1
4
0 0
0 1
1 1
1 0
Output #1
0.3535533906
Input #2
6
5 0
10 0
12 -4
10 -8
5 -8
3 -4
Output #2
1.0000000000
API Response (JSON)
{
  "problem": {
    "name": "B. Volatile Kite",
    "description": {
      "content": "You are given a convex polygon _P_ with _n_ distinct vertices _p_1, _p_2, ..., _p__n_. Vertex _p__i_ has coordinates (_x__i_, _y__i_) in the 2D plane. These vertices are listed in clockwise order. Yo",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF800B"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are given a convex polygon _P_ with _n_ distinct vertices _p_1, _p_2, ..., _p__n_. Vertex _p__i_ has coordinates (_x__i_, _y__i_) in the 2D plane. These vertices are listed in clockwise order.\n\nYo...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments