#P1526. [NOI2003] 智破连环阵
[NOI2003] 智破连环阵
Description
After spending tens of billions, Country B finally developed a new weapon — the Linked Formation (Zenith Protected Linked Hybrid Zone). Legend says the Linked Formation is a self-sustaining intelligent weapon that never stalls. However, reconnaissance by Country A’s spies revealed that the Linked Formation actually consists of independent weapons numbered . Initially, weapon is in the attack state, while all other weapons are in invincible defense. Thereafter, once weapon () is destroyed, weapon automatically switches from invincible defense to the attack state second later. When weapon is destroyed, this expensive Linked Formation is destroyed.
To thoroughly defeat Country B’s scientists, the defense minister of Country A plans to use the cheapest weapon — bombs — to destroy the Linked Formation. After long and precise probing, Country A’s scientists obtained the planar coordinates of the weapons in the Linked Formation, then determined the planar coordinates of bombs and planted them. Each bomb has a continuous detonation duration of minutes. During its activation window, each bomb can instantly eliminate any Country B weapon that is in the attack state and whose planar distance to it does not exceed . Similar to the Linked Formation, bomb detonates continuously for minutes at first, then bomb detonates for minutes, then bomb , and so on, until the Linked Formation is destroyed.
Clearly, different sequences have different effects. A good sequence may destroy the Linked Formation using only a small number of bombs; a bad sequence may fail even after using all bombs. Now, please determine an optimal sequence such that the Linked Formation is destroyed during the detonation time of bomb . Here, should be as small as possible.
Input Format
The first line contains three integers: , , and , denoting that the Linked Formation of Country B consists of weapons, Country A has bombs available, and the bomb attack radius is . The next lines each contain a pair of integers , representing the planar coordinates of weapon . Then the next lines each contain a pair of integers , representing the planar coordinates of bomb . The input testdata is guaranteed to be random, correct, and to have a solution.
Output Format
One line containing an integer , the actual number of bombs used.
4 3 6
0 6
6 6
6 0
0 0
1 5
0 3
1 1
2
Hint
For of the testdata, , , , .
Each test point has a time limit of seconds.
Translated by ChatGPT 5
京公网安备 11011102002149号