#P5544. [JSOI2016] 炸弹攻击1

[JSOI2016] 炸弹攻击1

Description

The game map can be simply regarded as a two-dimensional plane. JYY has built NN buildings, and each building is a circle. The center of the ii-th building is at (xi,yi)(x_i,y_i) with radius rir_i. There are MM enemies on the map, and each enemy can be approximated as a point on the plane. The ii-th enemy is located at (pi,qi)(p_i,q_i). JYY can use a bomb with an adjustable radius: he can set a radius not exceeding RR, then choose a point on the plane to detonate it, and all enemies within the range are eliminated.

Of course, because the bomb is very powerful, if the explosion range touches JYY's buildings, then JYY's buildings will be damaged. (Note: if the bomb's explosion range only touches the boundary of a building, it will not damage the building; if an enemy appears on the boundary of the explosion range, that enemy is eliminated.) JYY can freely control the detonation position and the explosion radius. As a cautious player, he wants to eliminate as many enemies as possible while ensuring that none of his buildings are damaged at all.

Input Format

The first line contains three non-negative integers: N,M,RN, M, R.

The next NN lines each contain three integers. The ii-th line gives xi,yi,rix_i,y_i,r_i, describing the position and radius of the ii-th building. The data guarantees that no buildings intersect (but their boundaries may touch).

The next MM lines each contain two integers. The ii-th line gives pi,qip_i,q_i, describing the position of the ii-th enemy.

Output Format

Output one line with one integer, representing the maximum number of enemies that JYY can eliminate.

1 5 3
0 0 1
3 3
-3 3
3 -3
3 0
0 3 
3

Hint

  • For 20%20\% of the data, M=2M = 2.
  • For another 20%20\% of the data, N=0N = 0.
  • For another 20%20\% of the data, M50M \leq 50.
  • For 100%100\% of the data, the Constraints are:
    • 0N100 \leq N \leq 10.
    • 0<M1030 < M \leq 10^3.
    • 1R,ri2×1041 \leq R, r_i \leq 2 \times 10^4.
    • pi,qi,xi,yi2×104|p_i|, |q_i|, |x_i|, |y_i| \leq 2 \times 10^4.

Translated by ChatGPT 5