题目描述
Background
JYY has recently become obsessed with a tower defense game. In this game, besides building structures, JYY can also use bombs to inflict area damage on enemies on the screen.
Problem Description
The game map can be simplified as a two-dimensional plane. JYY has built $N$ structures, each of which is a circle, where the $i$-th structure has its center at $(x_i, y_i)$ with a radius of $r_i$. There are $M$ enemies on the map, each of which can be approximated as a point on the plane, where the $i$-th enemy is located at $(p_i, q_i)$. JYY can use a bomb with a configurable radius, which can be set to a range not exceeding $R$, and then detonate it at a point on the plane, eliminating all enemies within that range.
However, due to the bomb's powerful blast, if the explosion range touches any of JYY's structures, those structures will also be damaged. (Note: If the bomb's explosion range only touches the boundary of JYY's structures, it will not cause damage; if an enemy is on the boundary of the explosion range, that enemy is eliminated.) JYY can freely control the detonation location and the radius of the bomb. As a cautious player, he hopes to eliminate as many enemies as possible without damaging his structures.
Input Format
The first line contains three non-negative integers: $N$, $M$, and $R$.
The next $N$ lines each contain three integers: $x_i$, $y_i$, and $r_i$, representing the position and radius of the $i$-th structure. It is guaranteed that all structures do not intersect (but may touch at their boundaries).
The following $M$ lines each contain two integers: $p_i$ and $q_i$, representing the position of the $i$-th enemy. Any two enemies have different positions, and no enemy is located inside a structure.
Output Format
Output a single integer, which is the maximum number of enemies JYY can eliminate.
Sample Input and Output
Input Sample #1
1 3 3
0 0 1
3 3
-3 3
3 -3
Output Sample #1
1
Input Sample #2
1 5 3
0 0 1
3 3
-3 3
3 -3
3 0
0 3
Output Sample #2
3
Input Sample #3
4 10 100
0 0 3
10 0 3
10 10 3
0 10 3
0 4
0 5
0 6
5 3
5 -3
5 5
6 7
3 6
10 4
8 4
Output Sample #3
5
Notes
For $100\%$ of the data, it is guaranteed that $1 \leq N \leq 10$, $1 \leq M \leq 2000$, $1 \leq R, r_i \leq 2 \times 10^4$, and $|p_i|, |q_i|, |x_i|, |y_i| \leq 2 \times 10^4$.
The data is sourced from NAIPC 2015 Problem A - Area of Effect, with some newly created data.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分