#P2116. 城墙
城墙
Description
Once, a greedy king ordered his knight to build a wall outside his castle, requiring that the wall’s minimum distance from the castle must be at least .
The castle is an -gon. The king is extremely stingy and refuses to build even one extra meter of wall; if more is built, he will execute the knight in charge.
Please help this unlucky knight compute the minimal length of the wall that needs to be built.
Input Format
The first line contains two integers , , representing the number of sides of the polygon and the minimum distance.
Then follow lines. Each line contains two integers, the coordinates of a vertex on the polygon.
Output Format
Output a single integer: the minimal length of the wall, rounded to the nearest integer.
9 100
200 400
300 400
300 300
400 300
400 400
500 400
500 200
350 200
200 200
1628
Hint
Constraints
- For of the testdata, it is guaranteed that , , and .
Translated by ChatGPT 5
京公网安备 11011102002149号