Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

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

Recommended Textbook for

Guide To Client Server Databases

Authors: Joe Salemi

2nd Edition

1562763105, 978-1562763107

More Books

Students also viewed these Databases questions

Question

4. Identify cultural variations in communication style.

Answered: 1 week ago

Question

9. Understand the phenomenon of code switching and interlanguage.

Answered: 1 week ago

Question

8. Explain the difference between translation and interpretation.

Answered: 1 week ago