QOJ.ac

QOJ

Time Limit: 4 s Memory Limit: 256 MB Total points: 10

#10667. 山羊 [A]

Statistics

Byteman 农夫拿起大锤,在无限大的牧场上钉下了 $n$ 根木桩。在接下来的 $k$ 天里,每天早上 Byteman 农夫都会把他的山羊带到牧场,并用一根长度为 $l$ 的绳子将它系在随机选择的一根木桩上。白天,山羊会吃掉它所能触及范围内的所有草。令山羊懊恼的是,草不会再生。此外,粗心的农夫可能会不止一次地将山羊系在同一根木桩上。

请问 $k$ 天后,山羊吃掉草的牧场面积的期望值是多少?

输入格式

标准输入的第一行包含三个整数 $n$、$k$ 和 $l$ ($1 \le n, k, l \le 1000$),分别表示木桩的数量、天数和绳子的长度。接下来的 $n$ 行,每行包含一个木桩的坐标,由一对整数 $x_i, y_i$ 表示 ($-1000 \le x_i, y_i \le 1000$)。没有两根木桩钉在同一个位置。

输出格式

在标准输出的唯一一行中输出一个实数。该数字应为 $k$ 天内山羊吃掉草的牧场面积的期望值。如果答案与正确答案的误差不超过 $10^{-6}$,则视为正确。小数点后最多给出 20 位数字。

样例

输入 1

2 2 1
0 0
1 0

输出 1

4.098204131080311

说明

如果山羊在两天内都被系在同一根木桩上,那么吃掉草的面积将等于 $\pi$。另一方面,如果它被系在两根不同的木桩上,面积将等于 $4\pi/3 + \sqrt{3}/2$。因此,答案是 $7\pi/6 + \sqrt{3}/4$。

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.