#P15880. [ICPC 2026 NAC] Friend Meetup
[ICPC 2026 NAC] Friend Meetup
Description
A group of friends live happily on a 2D Manhattan grid, which has a horizontal road running through it for every integer and a vertical road for every integer . Each friend is located at the intersection of two roads and has a walking speed (in grid units per second). They can only travel by moving along the roads at those speeds.
Life on the grid gets boring, so pairs of friends sometimes like to meet up. They do so by moving towards each other along routes that cause them to meet at a common point as quickly as possible. (This point does not have to be at the intersection of two roads; but does have to lie on a road, of course.) They would like to know: over all possible pairs of friends, what's the longest it could take a pair of friends to meet up?
Input Format
The first line of input contains an integer , the number of friends.
Each of the next lines contains three space-separated integers , , and , indicating a friend located at who travels at units per second along the grid.
Output Format
Print the real number of seconds it would take for a pair of friends to meet up for whom this time is the longest, assuming that each pair takes optimal routes to meet up as quickly as possible. Your answer will be accepted if it differs from the judge solution by relative or absolute error at most .
3
0 0 1
1 1 3
-1 1 4
0.5
京公网安备 11011102002149号