module Main where
import Text.Printf
import Data.List
run [a,b,c] =
let d = b^2 - 4*a*c
in case d of
_ | abs a
< 1e
-308
-> if abs b
> 1e
-308
then (1,[-c
/b
]) else (if c
/=0 then 0 else -1,[]) _ | d < 0 -> (0, [])
_ | d == 0 -> let root = (-b)/(2*a) in (1, [if root == 0 then 0 else root])
_ -> let roots
= map (\d
-> ((-b
) + d
)/(2*a
)) $ zipWith (*) [1, (-1)] $ map sqrt [d
,d
] in (2, sort roots)
main = do
mapM_ (printf
"%.15f\n") roots
bW9kdWxlIE1haW4gd2hlcmUKIAppbXBvcnQgVGV4dC5QcmludGYKaW1wb3J0IENvbnRyb2wuTW9uYWQKaW1wb3J0IERhdGEuTGlzdAogCiAKcnVuIDo6IFtEb3VibGVdIC0+IChJbnQsIFtEb3VibGVdKQpydW4gW2EsYixjXSA9IAogICAgbGV0IGQgPSBiXjIgLSA0KmEqYyAKICAgIGluIGNhc2UgZCBvZiAKICAgICAgIF8gfCBhYnMgYSA8IDFlLTMwOCAtPiBpZiBhYnMgYiA+IDFlLTMwOCB0aGVuICgxLFstYy9iXSkgZWxzZSAoaWYgYy89MCB0aGVuIDAgZWxzZSAtMSxbXSkgCiAgICAgICBfIHwgZCA8IDAgLT4gKDAsIFtdKSAKICAgICAgIF8gfCBkID09IDAgLT4gbGV0IHJvb3QgPSAoLWIpLygyKmEpIGluICAoMSwgW2lmIHJvb3QgPT0gMCB0aGVuIDAgZWxzZSByb290XSkKICAgICAgIF8gIC0+IGxldCByb290cyA9IG1hcCAoXGQgLT4gKCgtYikgKyBkKS8oMiphKSkgJCB6aXBXaXRoICgqKSBbMSwgKC0xKV0gJCBtYXAgc3FydCBbZCxkXSAKICAgICAgICAgICAgIGluICgyLCAgc29ydCByb290cykKICAgICAgIAogCm1haW4gPSAgZG8KICAgIChuLCByb290cykgPC0gZ2V0TGluZSA+Pj0gcmV0dXJuIC4gcnVuIC4gbWFwIChceCAtPiBmcm9tSW50ZWdyYWwgJCAocmVhZCB4OjpJbnQpKSAuIHRha2UgMyAuIHdvcmRzCiAgICBwcmludCBuCiAgICBtYXBNXyAocHJpbnRmICIlLjE1ZlxuIikgcm9vdHMK