3879: Fishermen

内存限制:128 MB 时间限制:1.000 S
评测方式:文本比较 命题人:
提交:158 解决:29

题目描述

The ocean can be represented as the first quarter of the Cartesian plane. There are n fish in the ocean. Each fish has its own coordinates. There may be several fish at one point. There are also m fishermen. Each fisherman has its own x-coordinate. The y-coordinate of each fisherman is equal to 0. Each fisherman has a fishing rod of length l. Therefore, he can catch a fish at a distance less than or equal to l. The distance between a fisherman in position x and a fish in position (a,b) is|a−x|+ b. Find for each fisherman how many fish he can catch.

输入

The first line contains three integers n, m, and l (1 ≤ n,m ≤ 2*10^5,1 ≤ l ≤ 10^9) — the number of fish, the number of fishermen, and the length of the fishing rod, respectively. Each of the next n lines contains two integers xi and yi (1 ≤ xi,yi,≤ 10^9) — the fish coordinates. Next line contains m integers ai (1 ≤ ai ≤ 10^9) — the fishermen coordinates. 

输出

For each fisherman, output the number of fish that he can catch, on a separate line.

样例输入 复制

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

样例输出 复制

2
2
3
2