#B2066. Rescue Mission to Save Rooftop People

    ID: 11148 Type: Default 1000ms 256MiB

Rescue Mission to Save Rooftop People

Rescue Mission to Save Rooftop People

In this problem, a rescue boat departs from the base located at the origin of a Cartesian coordinate system to rescue people from various rooftops. Each rooftop is given by its coordinates and the number of people on it.

For each rescue trip, the boat travels from the base to one rooftop at a speed of 50 meters per minute, loads all the people on that rooftop (taking 1 minute per person), and then returns to the base along the same path. On the return, each person disembarks, taking 0.5 minutes per person.

The distance from the base (0,0) to a rooftop at (x, y) is computed using the formula: $$d=\sqrt{x^2+y^2}$$.

Assume that the straight line from the base to any rooftop does not pass through any other rooftop. Your task is to compute the total time required for all people to be rescued and brought back to the base.

inputFormat

The first line contains an integer n (1 ≤ n ≤ 10^5), the number of rooftops.

Each of the following n lines contains three space-separated numbers: x, y and k, where (x, y) represents the coordinates of a rooftop and k the number of people on that rooftop.

outputFormat

Output a single number representing the total time (in minutes) required for all rescue operations. The result should be accurate to at least one decimal place.

sample

1
30 40 10
17.0