Logo
(追記) (追記ここまで)

16330번 - Fishermen 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB94666170.115%

문제

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 · 105, 1 ≤ l ≤ 109) — 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 ≤ 109) — the fish coordinates.

Next line contains m integers ai (1 ≤ ai ≤ 109) — the fishermen coordinates.

출력

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

제한

예제 입력 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

힌트

The picture illustrates for the above example the area on which the third fisherman can catch fish.

출처

ICPC > Regionals > Europe > Southeastern European Regional Contest > SEERC 2018 E번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /