Problem D
Cat and Mice
Everyone knows that cats love to eat mice. Naturally, when given the opportunity, any cat wants to eat as many mice as possible.
It just so happens that Cartesian Cat lives on the Cartesian
Plane with her home located at
Cartesian Cat has a plan. At time
Since all cats are efficient by nature, help Cartesian Cat determine what her minimum initial velocity must be if she hopes to eat all of the mice. Assume that she eats the mice in an optimal order.
Input
The first line of input contains a single positive integer,
Output
Output the minimum initial velocity (in units per second)
necessary for Cartesian Cat to allow her to eat all of the
mice, given that she eats them in the optimal order. Your
answer should be correct within a relative or absolute error of
Sample Input 1 | Sample Output 1 |
---|---|
1 3 4 2 .75 |
2.4999999987500003 |
Sample Input 2 | Sample Output 2 |
---|---|
2 0 100 10 0 -100 100 .80 |
9.999999999000002 |
Sample Input 3 | Sample Output 3 |
---|---|
2 0 100 10 0 -100 15 .80 |
23.33333333177778 |