Hitchhiking Across the Galaxy
A traveler aims to visit all the planets in a galaxy and wants to complete his journey in the shortest possible time. The time, in years, that he will spend traveling from one planet to another is determined by the ratio of the mass of the destination planet to the mass of the starting planet. He can begin and end his journey on any planet and can travel between any pair of planets.
Input
The first line of the input contains a natural number n (1 ≤ n ≤ 500), representing the number of planets in the galaxy. Each of the following n lines contains an integer m_i, which denotes the mass of the i-th planet (1 ≤ m_i ≤ 3000).
Output
Print the minimum number of years required for the traveler to complete his journey, with a precision of at least three decimal places.