QOJ.ac

QOJ

时间限制: 3 s 内存限制: 512 MB 总分: 100

#182. 円盤で多角形を覆う

统计

平らな紙の上に凸多角形が描かれています。手に持った円盤を置いて、多角形のできるだけ広い面積を覆おうとしています。言い換えると、多角形と円盤の共通部分の面積を最大化する必要があります。

入力

入力は、次の形式の単一のテストケースからなります。すべての入力項目は整数です。

$$\begin{array}{cc}n&r\\x_1&y_1\\\vdots&\vdots\\x_n&y_n\end{array}$$

$n$は多角形の頂点数です($3 \le n \le 10$)。$r$は円盤の半径です($1 \le r \le 100$)。$x_i$と$y_i$は多角形の$i$番目の頂点の座標を表します($1 \le i \le n$)。座標は$0 \le x_i \le 100$および$0 \le y_i \le 100$を満たします。

頂点は反時計回りの順序で与えられます。前述のとおり、与えられる多角形は凸です。すなわち、すべての頂点の内角は$180^\circ$未満です。凸多角形の境界は、自分自身と交差したり接したりすることがない点に注意してください。

出力

多角形と円盤の共通部分の面積の最大値を出力してください。答えの誤差は$0.0001$($10^{-4}$)を超えてはいけません。

入出力例

入力 1

4 4
0 0
6 0
6 6
0 6

出力 1

35.759506

入力 2

3 1
0 0
2 1
1 3

出力 2

2.113100

入力 3

3 1
0 0
100 1
99 1

出力 3

0.019798

入力 4

4 1
0 0
100 10
100 12
0 1

出力 4

3.137569

入力 5

10 10
0 0
10 0
20 1
30 3
40 6
50 10
60 15
70 21
80 28
90 36

出力 5

177.728187

入力 6

10 49
50 0
79 10
96 32
96 68
79 90
50 100
21 90
4 68
4 32
21 10

出力 6

7181.603297

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.