1152: 一元三次方程求解

文件提交:无需freopen 内存限制:128 MB 时间限制:1.000 S
评测方式:普通裁判 命题人:
提交:1 解决:1

题目描述

有形如:lns="http://www.w3.org/1998/Math/MathML">3+2++=0 这样的一个一元三次方程。给出该方程中各项的系数(lns="http://www.w3.org/1998/Math/MathML">,,, 均为实数),并约定该方程存在三个不同实根(根的范围在 lns="http://www.w3.org/1998/Math/MathML">100 至 lns="http://www.w3.org/1998/Math/MathML">100 之间),且根与根之差的绝对值 lns="http://www.w3.org/1998/Math/MathML">1。要求由小到大依次在同一行输出这三个实根(根与根之间留有空格),并精确到小数点后 lns="http://www.w3.org/1998/Math/MathML">2 位。

提示:记方程 lns="http://www.w3.org/1998/Math/MathML">()=0,若存在 lns="http://www.w3.org/1998/Math/MathML">2 个数 lns="http://www.w3.org/1998/Math/MathML">1 和 lns="http://www.w3.org/1998/Math/MathML">2,且 lns="http://www.w3.org/1998/Math/MathML">1<2lns="http://www.w3.org/1998/Math/MathML">(1)×(2)<0,则在 lns="http://www.w3.org/1998/Math/MathML">(1,2) 之间一定有一个根。

输入

一行,lns="http://www.w3.org/1998/Math/MathML">4 个实数 lns="http://www.w3.org/1998/Math/MathML">,,,

输出

一行,lns="http://www.w3.org/1998/Math/MathML">3 个实根,从小到大输出,并精确到小数点后 lns="http://www.w3.org/1998/Math/MathML">2 位。

样例输入

1 -5 -4 20

样例输出

-2.00 2.00 5.00