def lscan; gets.split.map(&:to_f); 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 abort else p 2 printf "%.15f\n", z-Math.sqrt(d)/2/a.abs printf "%.15f\n", z+Math.sqrt(d)/2/a.abs end