#Z14115. 救援
救援
Description
A rescue boat departs from the base camp to save people stranded on several rooftops and bring them back to the base camp. The number of rooftops, their coordinates, and the number of people on each rooftop will be determined by the input. Calculate the total time required for all individuals to reach the base camp and disembark.
The base camp is located at the origin of the Cartesian coordinate system. Each time the rescue boat leaves the base camp, it rescues people and returns them to the base camp.
Points in the coordinate system represent rooftops, each defined by its position coordinates and the number of people on it. The rescue boat departs from the base camp each time, traveling at a speed of 50 meters per minute toward the next rooftop. Upon reaching a rooftop, it rescues all the people there, with each person taking 1 minute to board. The boat then returns along the same route to the base camp, where each person takes 0.5 minutes to disembark. It is assumed that the line connecting the origin to any rooftop does not pass through any other rooftops.
Input Format
The first line contains an integer, n, representing the number of rooftops.
The next n lines each contain two real numbers (in meters) representing the planar coordinates of a rooftop relative to the base camp, followed by an integer representing the number of people on that rooftop.
Output Format
The total time required for the rescue operation, rounded up to the nearest minute.
1
30 40 3
7