#P1024. [NOIP 2001 提高组] 一元三次方程求解
[NOIP 2001 提高组] 一元三次方程求解
Description
Given a cubic equation of the form . You are given the coefficients of the equation (where are real numbers). It is guaranteed that the equation has three distinct real roots, the roots lie in the range to , and the absolute difference between any two roots is . Output the three real roots in increasing order on a single line (separated by spaces), each to exactly 2 decimal places.
Hint: Let the equation be . If there exist two numbers and with and , then there is a root in the interval .
Input Format
One line containing real numbers .
Output Format
One line containing real roots in increasing order, each to exactly decimal places.
1 -5 -4 20
-2.00 2.00 5.00
Hint
- If and , then there is a root in .
- Source: NOIP 2001 Senior, Problem 1.
Translated by ChatGPT 5
京公网安备 11011102002149号