QOJ.ac

QOJ

時間限制: 2 s 記憶體限制: 256 MB 總分: 100

#15058. Soldier Deployment

统计

Background

JYY has recently been playing a war game. JYY needs to continuously recruit soldiers to defend his territory. Now that JYY has recruited a new soldier, he wants to know how to deploy this new soldier to maximize the area that his army can defend.

JYY currently has $N$ soldiers, numbered $1$ to $N$, distributed on a two-dimensional plane. The coordinates of the $i$-th soldier are $(x_i, y_i)$.

A point is said to be defended if, starting from that point and moving in any direction, the distance to at least one of JYY's soldiers decreases. The area that JYY can defend is the set of all such points.

Now, JYY has one newly recruited soldier and $M$ possible locations where this new soldier can be deployed. JYY wants to know, for each available location, what the area of the region he can defend would be if the new soldier were deployed at that location.

Input

The first line contains two positive integers $N$ and $M$.

The next $N$ lines each contain two integers $x_i$ and $y_i$, representing the position of the $i$-th soldier.

The next $M$ lines each contain two integers $u_i$ and $v_i$, representing the $i$-th possible location $(u_i, v_i)$ for the new soldier.

Output

Output $M$ lines, where the $i$-th line contains a real number rounded to one decimal place, representing the area of the region JYY can defend after deploying the new soldier at $(u_i, v_i)$.

Subtasks

For $30\%$ of the data, $N, M \le 500$.

For $60\%$ of the data, $N, M \le 10\,000$, and at most $500$ locations result in an increase in the area JYY can defend after deploying the new soldier.

For $100\%$ of the data, $N, M \le 10^5$, and $-10^8 \le x_i, y_i, u_i, v_i \le 10^8$.

The data guarantees that all $(x_i, y_i)$ and $(u_i, v_i)$ are distinct.

Examples

Input 1

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

Output 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.