0133. Square Roots
Input file name: | sqrooots.in |
Output file name: | sqrooots.out |
Time limit: | 500 ms |
Memory limit: | 64 megabytes |
Your task is to find the real roots of the equation ax2+bx+c=0.
Input file
Input file consists of three integers a, b and c. Their absolute values may not exceed 109.
Output file
The first line of the output file represents the number of roots of the equation. The next k lines contain one real number each rounded up to six digits after decimal point – the root of this equation. The roots have to be displayed in ascending order. If there are infinitely many roots, output a single number -1 instead of the number of roots.
Examples:
sqrooots.in | sqrooots.out |
---|---|
1 -2 -3 | 2 -1.000000 3.000000 |
Source: Petrozavodsk Summer 2003. Blitz Kontest, Monday, August 25
Author: Andrew Lopatin, Nick Durov
Discuss Submit a solution