QOJ.ac

QOJ

時間限制: 1 s 記憶體限制: 128 MB 總分: 100

#11575. 拯救恐龙

统计

Bytetown 传来突发新闻:古生物学家在城市附近发现了恐龙化石遗迹!听到这个消息后,几位 Bytetown 的市民想要去捡几块骨头据为己有。为了保护这些无价的恐龙遗迹,Bytetown 市长决定保护挖掘区域,并为此雇佣了一支军队。

Byteasar 将军已经在挖掘区域的几个战略位置部署了 $n$ 名士兵。如果挖掘区域内的一个点,向任何方向移动都会不可避免地减小该点到至少一名士兵的距离,我们就称该点是“受保护的”。

Byteasar 将军刚刚分配到一名新兵。将军决定将这名新兵安置在剩余的 $m$ 个空闲战略位置之一。对于每一种可能的安置方案,他都想知道挖掘区域中受保护部分的面积总和是多少。

输入格式

输入的第一行包含两个整数 $n$ 和 $m$ ($3 \leqslant n \leqslant 100\,000$, $1 \leqslant m \leqslant 100\,000$):表示已经驻扎在挖掘区域的士兵人数和空闲战略位置的数量。接下来的 $n$ 行提供了士兵位置的描述。其中第 $i$ 行包含两个整数 $x_i, y_i$ ($-10^8 \leqslant x_i, y_i \leqslant 10^8$),表示第 $i$ 名士兵所处位置的坐标(在直角坐标系中)。接下来的 $m$ 行提供了空闲战略位置的描述(格式相同)。输入中列出的所有点都是互不相同的。

你可以假设由 $n$ 名士兵保护的挖掘区域面积为正。

输出格式

你的程序应输出恰好 $m$ 行。第 $i$ 行应包含将新兵安置在第 $i$ 个空闲战略位置后,挖掘区域中受保护部分的面积总和。所有数字应保留一位小数。

样例

输入 1

3 2
0 0
2 -1
1 2
3 1
1 0

输出 1

5.0
2.5

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.