Type: Default 1000ms 256MiB

一元三次方程

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

问题描述

有形如: ax^3+bx^2+cx+d=0 这样的一个一元三次方程。给出该方程中各项的系数(a,b,c,d 均为实数),并约定该方程存在三个不同实根(根的范围在 −100至 100 之间),且根与根之差的绝对值 ≥1。要求由小到大依次在同一行输出这三个实根(根与根之间留有空格),并精确到小数点后 2 位。

提示:记方程 f(x)=0,若存在 2 个数 x1 和 x2​ ,且 x1<x2 ,f(x1)×f(x2)<0则在 (x1,x2)之间一定有一个根。

输入格式

一行,4 个实数 a,b,c,d。

输出格式

一行,3 个实根,从小到大输出,并精确到小数点后 2 位

样例

1 -5 -4 20
-2.00 2.00 5.00

Limitation

1s, 1024KiB for each test case.

12.15

Not Claimed
Status
Done
Problem
9
Open Since
2024-12-14 0:00
Deadline
2024-12-31 23:59
Extension
24 hour(s)