题号:NC207728
时间限制:C/C++/Rust/Pascal 5秒,其他语言10秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld
题目描述
A convex polygon is drawn on a flat paper sheet. You are trying to place a disk in your hands to cover as large area of the polygon as possible. In other words, the intersection area of the polygon and the disk should be maximized.
输入描述:
The input consists of a single test case, formatted as follows. All input items are integers.
n r
x1 y1
...
xn yn
n is the number of vertices of the polygon (3 ≤ n ≤ 10). r is the radius of the disk (1 ≤ r ≤ 100).xi and yi give the coordinate values of the i-th vertex of the polygon (1 ≤ i ≤ n). Coordinatevalues satisfy 0 ≤ xi ≤ 100 and 0 ≤ yi ≤ 100.The vertices are given in counterclockwise order. As stated above, the given polygon is convex.In other words, interior angles at all of its vertices are less than 180◦. Note that the border ofa convex polygon never crosses or touches itself.
输出描述:
Output the largest possible intersection area of the polygon and the disk. The answer shouldnot have an error greater than 0.0001 (10−4 ).
示例4
输入
复制
4 1
0 0
100 10
100 12
0 1
示例5
输入
复制
10 10
0 0
10 0
20 1
30 3
40 6
50 10
60 15
70 21
80 28
90 36
示例6
输入
复制
10 49
50 0
79 10
96 32
96 68
79 90
50 100
21 90
4 68
4 32
21 10