Anti-Missile | 프로그래밍의 벗 PivotOJ
PivotOJ

Anti-Missile

시간 제한: 1000ms메모리 제한: 2048MB출처: ICPC Asia Tehran Regional Contest 2024BOJ 33198
이 문제는 본문 이미지 일부가 표시되지 않습니다. 텍스트만으로 풀이가 어려울 수 있습니다.

문제

We want to execute a strategic missile strike against an enemy’s critical resources. The enemy has deployed air defence systems to protect these resources. However, their defence setup has certain vulnerabilities, and your mission is to exploit them effectively.

Each air defence system can protect all strategic resources and air defence systems within its radius of operation, but cannot defend itself. Due to technical limitations, each critical resource or air defence system is protected by at most one other air defence system.

Missiles can be used to destroy either an undefended strategic resource or an air defence system.

A resource is considered undefended if no active air defence system protects it. When an air defence system is destroyed, it can no longer protect any resources or other air defence systems. Your goal is to maximize the number of strategic resources destroyed.

입력

The input consists of the following:

The first line contains three integers mm (number of missiles), nn (number of strategic resources), and dd (number of air defence systems), where (0m,n,d50000 \le m, n, d \le 5\, 000).

The next nn lines contain two integers xix_i and yiy_i (0xi,yi1090 \le x_i , y_i \le 10^9) the coordinates of the iith strategic resource.

The following dd lines each contain three integers xjx_j, yjy_j and rjr_j (0xj,yj1090 \le x_j , y_j \le 10^9; 0rj1090 \le r_j \le 10^9) the coordinates of the jjth air defence system and its radius of protection.

출력

Output the maximum number of strategic resources that can be destroyed.

힌트

The example test case is depicted by the figure below:

[이미지 1]

예제

예제 1

입력
3 4 3
0 0
10 20
20 20
30 30
5 5 9
16 16 14
25 25 5
출력
2
코드를 제출하려면 로그인하세요.