|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|2 초||512 MB||17||7||5||38.462%|
A group of computer science students arrive in Athens for summer vacation. While thinking of fun ways to explore the Aegean sea by sailing, they came up with the following game:
Your task is the following: given the coordinates of each island and the assigned points, find the ratio R of the optimal route for the sailing cruise.
Let us assume that there are six islands, named A through F, located as shown in the following figure. For example, the coordinates of island B are (4, 2) and its associated points are 6.
The following three figures show three possible sailing routes, starting from Piraeus and returning there. Below each figure is the corresponding ratio R. Among these three, the leftmost route has the highest ratio R of collected points over total distance. Notice that in the rightmost route, the sailing team collects the points of island E - which is located inside the area covered by the cruise.
Also, notice that the routes P, B, E, C, F, E, P and P, B, F, C, P are not legal, because then the team would pass twice through the same point (island E and the intersection of BF and CP, respectively).
The first line of the input will contain a positive integer N: the number of islands. Each of the following N lines will contain three integer numbers Xi, Yi, Pi: the coordinates (Xi, Yi) of the i-th island and the assigned points Pi. There will not be two islands with the same coordinates. (1 ≤ N ≤ 2,000, 0 < Xi ≤ 10,000, -10,000 ≤ Yi ≤ 10,000, 0 ≤ Pi ≤ 10,000)
The output will contain a single line with a single real number: the ratio of the optimalsailing route. The number that you will print must not differ from the actual optimal ratio by more than 10-6.
6 2 0 5 4 2 6 4 4 2 2 6 1 2 3 5 1 4 6