Zeroes of polynomials

Given a function ff continuous in an interval [a,b][a,b], and such that f(a)f(b)<0f(a) \cdot f(b) < 0, a basic theorem of Mathematics states that there must exist at least one zero of ff in (a,b)(a,b), that is, a real number zz such that a<z<ba < z < b and f(z)=0f(z) = 0.

Given a polynomial p(x)=c4x4+c3x3+c2x2+c1x+c0p(x) = c_4 x^4 + c_3 x^3 + c_2 x^2 + c_1 x + c_0 with exactly one zero in (0,1)(0,1), can you find this zero?

Input

Each input line describes a polynomial p(x)p(x) of degree at most 4 with exactly one zero in (0,1)(0,1). Each polynomial is given in decreasing order of ii as follows: c44c33c22c11c00c_4\ 4\ c_3\ 3\ c_2\ 2\ c_1\ 1\ c_0\ 0. Every cic_i is a real number. The pairs ciic_i\ i with ci=0c_i = 0 are not present in the input.

Output

For every polynomial, print its case number, followed by an approximation of its zero zz in (0,1)(0,1), with the following convention: zz must be a real number with exactly 5 digits after the decimal point, such that 0z0.999990 \le z \leq 0.99999 and p(z)p(z+0.00001)<0p(z) \cdot p(z + 0.00001) < 0. Always print the 5 decimal digits of zz.

Observations

Problem information

Author: Salvador Roura

Generation: 2026-01-25T12:15:23.123Z

© Jutge.org, 2006–2026.
https://jutge.org