Area of Effect

No attempts yetTime limit5sMemory limit256 MB

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 (1n101 \le n \le 10) is the number of villages.
  • mm (1m20001 \le m \le 2000) is the number of opposing minions.
  • rr (1r200001 \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 (20000vx,vy20000-20000 \le v_x, v_y \le 20000) and vrv_r is its radius (1vr200001 \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 (20000mx,my20000-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.