Question: pythone code D. Missile Interception time limit per test: 1 second memory limit per test: 256 megabytes input: standard input output: standard output Yihan recently

 pythone code D. Missile Interception time limit per test: 1 second

pythone code

D. Missile Interception time limit per test: 1 second memory limit per test: 256 megabytes input: standard input output: standard output Yihan recently designed a missile interception system for the Ministry of Defense. Once the system is deployed, it can intercept and destroy all missiles within a given radius. The radius can be 0 , in which case it protects the certain point that the system is placed. For the testing purpose, two of such systems are deployed, and N missiles are launched. Of course, all missiles will surely be intercepted if the radii are set to be infinitely large. However, setting a large radius is costly. The cost is proportional to the square of the radius (i.e., the protected area), so Yihan wants to compute the smallest sum of the squared radii, which is sufficient to intercept all missiles and finish the testing. Input The first line contains four integers x1,y1,x2, and y2, indicating that the two systems are deployed at (x1,y1) and (x2,y2). The second line contains an integer N, indicating the number of testing missiles. Then for the next N lines, each line contains two integers x and y, indicating that each missile is sent to the coordinates (x,y). Output One integer: r12+r22, where r1 is the protecting radius for system 1 , and r2 is for system 2. Note N105. All absolute values for the coordinates are no more than 1000

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!