QUADEQ - Quadratic Equation
Given a, b and c in quadratic equation (a*x2 + b*x + c = 0), find all real roots.
Input
You are given 3 integers: a, b and c.
-1000 <= a, b, c <= 1000
a != 0
Output
Print the number of real roots, followed by the values of the real roots in ascending order (if they exist).
Your output will be considered to be correct if the difference between your output and the actual answer is not more than 10−6.
Example
Input: -1 0 2 Output: 2 -1.414213562 1.414213562
Input: 1 2 3 Output: 0
Input: 1 -8 16 Output: 1 4
Added by: | Walid Amin |
Date: | 2019-11-16 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All |