QOJ.ac

QOJ

実行時間制限: 0.5 s メモリ制限: 256 MB 満点: 100

#2386. 渔夫

統計

海洋可以表示为笛卡尔坐标系的第一象限。海洋中有 $n$ 条鱼,每条鱼都有自己的坐标。同一个点上可能有多条鱼。

此外还有 $m$ 名渔夫。每名渔夫都有自己的 $x$ 坐标,且所有渔夫的 $y$ 坐标均为 $0$。

每名渔夫都有一根长度为 $l$ 的鱼竿。因此,他可以捕获距离小于或等于 $l$ 的鱼。位于位置 $x$ 的渔夫与位于位置 $(a, b)$ 的鱼之间的距离为 $|a - x| + b$。

请计算每名渔夫能捕获多少条鱼。

输入格式

第一行包含三个整数 $n, m$ 和 $l$ ($1 \le n, m \le 2 \cdot 10^5, 1 \le l \le 10^9$),分别表示鱼的数量、渔夫的数量以及鱼竿的长度。

接下来的 $n$ 行,每行包含两个整数 $x_i$ 和 $y_i$ ($1 \le x_i, y_i \le 10^9$),表示鱼的坐标。

最后一行包含 $m$ 个整数 $a_i$ ($1 \le a_i \le 10^9$),表示渔夫的坐标。

输出格式

对于每名渔夫,在单独的一行中输出他能捕获的鱼的数量。

样例

输入格式 1

8 4 4
7 2
3 3
4 5
5 1
2 2
1 4
8 4
9 4
6 1 4 9

输出格式 1

2
2
3
2

说明

下图展示了上述样例中第三名渔夫可以捕获鱼的区域。

下图展示了上述样例中第三名渔夫可以捕获鱼的区域。

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.