This page is still under construction.

Parts of this page are still being built. What you see may change.

Area of Effect

Time limit5sMemory limit256 MB

Summary
Pick a circle of radius at most r that avoids the interiors of the village circles and covers as many minion points as possible.
Level

Hard8 of 10

Topics
Geometry, Brute force
Solved
No attempts yet

Problem

Liam plays a tower defense game. He destroys his opponent's minions while defending his own villages.

Liam's favorite attack is an area of effect attack. The attack range is a perfect circle. Liam picks a center and a radius, and every minion inside that circle or on it is destroyed. A minion is a point with no size.

The attack must not damage Liam's villages. A village is also a perfect circle. The attack circle may touch the wall of a village, but it must not reach inside the village. For a village with center (vx,vy)(v_x, v_y) and radius vrv_r, and an attack with center (cx,cy)(c_x, c_y) and radius ρ\rho, the distance between the two centers must be at least ρ+vr\rho + v_r.

The attack radius has an upper limit rr. Liam can attack with a radius smaller than the limit, but never with a larger one.

Find the largest number of minions that one attack destroys without touching any village.

Input

The first line contains three integers nn, mm, rr separated by spaces.

  • nn (1≤n≤101 \le n \le 10) is the number of villages.
  • mm (1≤m≤20001 \le m \le 2000) is the number of opposing minions.
  • rr (1≤r≤200001 \le r \le 20000) is the upper limit of the attack radius.

Each of the next nn lines contains three integers vxv_x, vyv_y, vrv_r describing one village. (vx,vy)(v_x, v_y) is its center (−20000≤vx,vy≤20000-20000 \le v_x, v_y \le 20000) and vrv_r is its radius (1≤vr≤200001 \le v_r \le 20000). No two villages intersect or overlap.

Each of the next mm lines contains two integers mxm_x, mym_y, the position of one minion (−20000≤mx,my≤20000-20000 \le m_x, m_y \le 20000). No two minions share a position, and no minion is inside a village. A minion can be on the wall of a village.

Output

Print one integer, the largest number of minions destroyed by a single attack.

Examples3

  1. Example 1

    Input
    1 3 3
    0 0 1
    3 3
    -3 3
    3 -3
    
    Expected output
    1
    
  2. Example 2

    Input
    1 5 3
    0 0 1
    3 3
    -3 3
    3 -3
    3 0
    0 3
    
    Expected output
    3
    
  3. Example 3

    Input
    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
    
    Expected output
    5