|
||||||||||
Earth HourTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 125536/65536 K (Java/Others)Total Submission(s): 2458 Accepted Submission(s): 1005 Problem Description Earth Hour is an annual international event created by the WWF (World Wide Fund for Nature/World Wildlife Fund), held on the last Saturday of March, that asks households and businesses to turn off their non-essential lights and electrical appliances for one hour to raise awareness towards the need to take action on climate change. To respond to the event of this year, the manager of Hunan University campus decides to turn off some street lights at night. Each street light can be viewed as a point in a plane, which casts flash in a circular area with certain radius. What's more, if two illuminated circles share one intersection or a point, they can be regarded as connected. Now the manager wants to turn off as many lights as possible, guaranteeing that the illuminated area of the library, the study room and the dormitory are still connected(directly or indirectly). So, at least the lights in these three places will not be turned off. Input The first line contains a single integer T, which tells you there are T cases followed. In each case: The first line is an integer N( 3<=N<=200 ), means there are N street lights at total. Then there are N lines: each line contain 3 integers, X,Y,R,( 1<=X,Y,R<=1000 ), means the light in position(X,Y) can illuminate a circle area with the radius of R. Note that the 1st of the N lines is corresponding to the library, the 2nd line is corresponding to the study room, and the 3rd line is corresponding to the dorm. Output One case per line, output the maximal number of lights that can be turned off. Note that if none of the lights is turned off and the three places are still not connected. Just output -1. Sample Input
Sample Output
Source | ||||||||||
|