P17574 [JAG 2026 Summer Camp #3] Line Up!

Description

There are $N$ people on a two-dimensional plane. The $i$-th person is initially located at $(x_i,y_i)$ and can move freely in any direction at a speed of at most $v_i$ units per second. They all want to line up on a single straight line. Find the minimum time required for them to do so. More precisely, find the minimum nonnegative real number $T$ for which there exists a straight line such that every person can reach some point on it within $T$ seconds. The position and orientation of the line may be chosen freely. Multiple people may occupy the same point.

Input Format

The input consists of a single test case of the following format. ```text N x_1 y_1 v_1 x_2 y_2 v_2 ... x_N y_N v_N ``` The first line contains an integer $N$ ($3\le N\le1000$), representing the number of people. For each $i$ ($1\le i\le N$), the $i$-th of the following $N$ lines contains three integers $x_i$, $y_i$, and $v_i$ ($-10^9\le x_i,y_i\le10^9$, $1\le v_i\le10^5$). The $i$-th person is initially located at $(x_i,y_i)$ and has a maximum speed of $v_i$ units per second.

Output Format

Print a single real number representing the minimum time required for all $N$ people to be located on a single straight line. Your answer will be considered correct if its absolute or relative error does not exceed $10^{-7}$.