Quadratic equation

Report a typo

There are real numbers a, b, c, where a ≠ 0.

Solve the quadratic equation ax2+bx+c=0 ax^2 + bx + c = 0 and output all of its roots.

Guaranteed that the equation always has two roots (the discriminant's value > 0, you do not need to check it).

Output the roots in ascending order. Do not round/format them, the testing system does it automatically.

Sample Input 1:

1
-1
-2

Sample Output 1:

-1.0 2.0

Sample Input 2:

1
-7.5
3

Sample Output 2:

0.423966 7.07603
Write a program in Kotlin
import kotlin.math.*

fun main() {
// put your code here
}
___

Create a free account to access the full topic