Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please help me to solve this problem using python. D. Missile Interception time limit per test 1 second0 memory limit per test: 256 megabytes input:

please help me to solve this problem using python.
image text in transcribed
D. Missile Interception time limit per test 1 second0 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 at the radi are set to be infinitely large. However, setting a large radius is costly. The cost is proportional to the square of the radius (L.e., the protected area), so Yihan wants to compute the smallest sum of the squared radii, which is sutficient 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,andr2 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions