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

9611번 - Vicinity 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB21819817491.579%

문제

This is one of the most basic geometry proximity problems. We are given n points in the plane and we should determine which points are in the vicinity of a particular point.

Let the set of points P = {p1, p2 , …, pn} , where pi has coordinates (xi, yi). We use d(pi,pj) to denote the distance between the two points. A point pj is in the vicinity of point pi if d(pi,pj) ≤ dv .We may call dv the vicinity distance. Given a set of points P, point pi and dv, your task is to write a program to calculate the number of points which are in the vicinity of point pi.

입력

The first line contains an integer n (2≤ n ≤ 1000) which determines the number of points. The following n lines contain two integers which correspond to the coordinates (xi,yi) of each point (-106 ≤ xi, yi ≤ 106). Then, the following line includes t (1≤ t ≤ 50) indicating the number of test cases, followed by t lines and each line contains 2 positive integers i (1≤ i ≤ n) and dv (1 ≤ dv ≤ 100) which indicate the point pi and its vicinity distance, respectively.

출력

For each test case, print out in a line the number of points in the vicinity of the corresponding point.

제한

예제 입력 1

5
0 0
0 1
1 1
3 -3
2 2
3
1 1
5 3
4 1

예제 출력 1

1
3
0

힌트

출처

ICPC > Regionals > Asia Pacific > Thailand > 2013 ACM-ICPC Asia Phuket Regional Programming Contest 연습 세션 PC번

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

출처

대학교 대회

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

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