#Lutece1495. Bomb
Bomb
Migrated from Lutece 1495 B
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
There are bombs needing exploding.
Each bomb has three attributes: exploding radius , position and lighting-cost which means you need to pay cost making it explode.
If a un-lighting bomb is in or on the border the exploding area of another exploding one, the un-lighting bomb also will explode.
Now you know the attributes of all bombs, please use the minimum cost to explode all bombs.
Input
First line contains an integer (), which indicates the number of test cases.
Every test case begins with an integers (), which indicates the numbers of bombs.
In the following lines, the -th line contains four intergers , , and (), indicating the coordinate of -th bomb is , exploding radius is and lighting-cost is .
Output
For every test case, you should output Case #x: y
, where x
indicates the case number and counts from and y
is the minimum cost.
Samples
1
5
0 0 1 5
1 1 1 6
0 1 1 7
3 0 2 10
5 0 1 4
Case #1: 15
Resources
第二届中国大学生程序设计竞赛 杭州站(CCPC 2016 Hangzhou Site)