def lscan; gets.split.map(&:to_r); end a,b,c = lscan if a == 0 if b == 0 if c == 0 p -1 else p 0 end exit end p 1 h = -c/b printf "%.15f\n", h exit end d = b*b-4*a*c z = -b/2/a if d < 0 p 0 elsif d == 0 p 1 printf "%.15f\n", z else # 2az + b = 0 p 2 printf "%.15f\n", (-1e99..z.to_f).bsearch{|x| a*x*x+b*x+c < 0} printf "%.15f\n", (z.to_f..1e99).bsearch{|x| a*x*x+b*x+c > 0} # printf "%.15f\n", z-Math.sqrt(d)/2/a.abs # printf "%.15f\n", z+Math.sqrt(d)/2/a.abs end