0133. Square Roots

Имя входного файла: sqrooots.in
Имя выходного файла: sqrooots.out
Ограничение по времени: 500 ms
Ограничение по памяти: 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.insqrooots.out
1 -2 -32 -1.000000 3.000000


Источник: Petrozavodsk Summer 2003. Blitz Kontest, Monday, August 25
Автор: Andrew Lopatin, Nick Durov

Обсудить       Отправить решение



Версия для печати