#P1883. Minimizing the Maximum of Quadratic Functions

    ID: 15166 Type: Default 1000ms 256MiB

Minimizing the Maximum of Quadratic Functions

Minimizing the Maximum of Quadratic Functions

Given n quadratic functions \(f_1(x), f_2(x), \dots, f_n(x)\) (each of the form \(ax^2+bx+c\)), define \(F(x)=\max\{f_1(x), f_2(x), \dots, f_n(x)\}\). Find the minimum value of \(F(x)\) on the interval \([0, 1000]\).

You are required to output the minimum value with 6 digits after the decimal point.

inputFormat

The first line contains an integer n denoting the number of quadratic functions. Each of the next n lines contains three space-separated real numbers a, b, and c representing the coefficients of a quadratic function \(ax^2+bx+c\).

outputFormat

Output the minimum value of \(F(x)\) on the interval \([0,1000]\) with exactly 6 digits after the decimal point.

sample

1
1 0 0
0.000000