#P4048. [JSOI2010] 冷冻波

    ID: 2988 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 难度: 8 上传者: 标签>计算几何2010各省省选江苏枚举,暴力最大流

[JSOI2010] 冷冻波

Description

WJJ likes the game "Warcraft III." In the game, the Lich is a powerful hero whose skill Frozen Nova can kill exactly one sprite each time. We consider both liches and sprites as points on the plane.

If the Euclidean distance between a lich and a sprite does not exceed RR, and the lich's line of sight to that sprite is not blocked by any tree (that is, the line segment between the lich and the sprite has no common point with any tree), then the lich can instantly kill that sprite.

There are NN liches in the forest. After casting Frozen Nova, each lich must wait for a cooldown period before casting again. Different liches have different cooldowns and cast ranges, but each cast always kills exactly one sprite.

Starting from time 00, what is the minimum time needed to kill all the sprites?

Input Format

The first line contains three integers NN, MM, KK (N,M,K200N, M, K \le 200), representing the number of liches, sprites, and trees.

The next NN lines each contain four integers x,y,r,tx, y, r, t, representing the coordinates, attack range, and casting interval (in seconds) of each lich.

The next MM lines each contain two integers x,yx, y, representing the coordinates of each sprite.

The next KK lines each contain three integers x,y,rx, y, r, representing the coordinates and radius of each tree.

All coordinates have absolute values at most 1000010000; radii and casting intervals are at most 2000020000.

Output Format

Output one line: the minimum time (in seconds) needed to eliminate all sprites. If it is impossible to eliminate all sprites, output 1-1.

2 3 1
-100 0 100 3
100 0 100 5
-100 -10
100 10
110 11
5 5 10
5

Hint

Translated by ChatGPT 5