People with headphones P55080


Statement
 

pdf   zip

thehtml

Professor Oak is a hater. His new rage is against the people that wear headphones while walking on the street. They seem to move on straight lines no matter what, never caring about people around. Prof. Oak has a radical idea of what should be done: to capture all those headphone people and intern them in a bedlam for some psychiatric treatment.

Let us model this situation: We have n points on the two-dimensional plane. Every point moves forever with some constant speed. Two or more points can be at the same position at the same time (that is, there are no collisions). Prof. Oak can decide when to capture all the points. He will do that with the smallest circular net that covers all the points.

Can you compute the minimum possible radius of the net if we choose the best moment in time (past, present, or future)?

Input

Input consists of several cases, each with the number of points n, followed by four real numbers xi, yi, ai and bi to define every point, by its position (xi, yi) at time 0, and its constant speed (ai, bi). Assume 2 ≤ n ≤ 1000, and that the four numbers defining each point have absolute values bounded by 1000 and at most two decimal digits.

Output

For every case, print with one digit after the decimal point the minimum radius to capture all the points if we optimally choose when to do it. The input cases have no precision issues.

Public test cases
  • Input

    4  1 3 0 -1  3 -1 -1 0  -1 -3 0 1  -3 1 1 0
    3  0 0 0 0  10 0 0 0  6 -20 0 2
    6  2 6 -1 -5  5 -10 0 8  45 8 -2 89  -12 -45 -5 -7  50 60 7 8  -56 78 78 -23
    2  12.34 42.23 -12.3 18.4  33.14 -78.99 -8.75 -34.12
    

    Output

    1.0
    5.0
    65.6
    6.3
    
  • Information
    Author
    Salvador Roura
    Language
    English
    Official solutions
    C++
    User solutions
    C++