QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 256 MB Total points: 100

#15058. 士兵部署

統計

故事背景

JYY 最近在玩一款战争游戏。JYY 需要不断的招募士兵来守卫自己的领土。 现在 JYY 招募了一个新的士兵,JYY 想知道如何部署这个新的士兵,才能最大化 JYY 的军队能够守卫的区域。

问题描述

JYY—共现在有 $N$ 个士兵,分别由 $1$ 到 $N$ 编号,分布在一个二维平面上。 第 $i$ 号士兵所处位置的坐标为 $(x_i,y_i)$。

对于一个点,如果从该点出发,朝任意一个方向移动,都会和至少一个 JYY 的士兵的距离减少,则称这个点是可以被守卫的。JYY 可以守卫的区域,就是所有这样的点的集合。

现在 JYY 有一个新招募的士兵,并且一共有 $M$ 个位置可以用来部署这个新的士兵。JYY 想知道,对于每一个可用的位置,如果将这个新士兵部署在这个位置之后,JYY 可以守卫的区域的面积有多大。

输入格式

第一行包含两个正整数 $N$ 和 $M$。

接下来 $N$ 行,每行包含两个整数 $x_i$ 和 $y_i$,表示 $i$ 号士兵的位置。

接下来 $M$ 行,每行包含两个整数 $u_i$ 和 $v_i$,表示第 $i$ 个可以部署新士兵的位置是 $(u_i,v_i)$。

输出格式

一共输出 $M$ 行,第 $i$ 行包含一个保留一位小数的实数,表示将新士兵部署在 $(u_i, v_i)$ 后,JYY 可以守卫的区域的面积。

样例数据

样例 1 输入

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

样例 1 输出

5.0
2.5

子任务

对于 $30\%$ 的数据满足 $N,M \le 500$;

对于 $60\%$ 的数据满足 $N,M \le 10\,000$,并且至多只有 $500$ 个位置满足部署新士兵之后,JYY 可以守卫的区域的面积会增加;

对于 $100\%$ 的数据满足 $N,M \le 10^5$,$-10^8 \le x_i, y_i, u_i, v_i \le 10^8$。

数据满足任意 $(x_i, y_i)$, $(u_i, v_i)$ 各不相同。

About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.