require "bigdecimal" a, b, c = gets.to_s.split.map{|i| BigDecimal(i) } if a < 0 a = -a b = -b c = -c end if a == 0 && b == 0 puts c == 0 ? -1 : 0 elsif a == 0 puts 1 printf "%.15f\n", (-c/1.0/b) else d = b ** 2 - 4 * a * c if d < 0 puts 0 elsif d == 0 puts 1 printf "%.15f\n", (-b/2.0/a) # ans = Rational( -b, 2 * a) # puts "1 #{ans.to_f}" else ans1 = (-b - d.sqrt(100)) / ( 2.0 * a ) ans2 = (-b + d.sqrt(100)) / ( 2.0 * a ) puts 2 printf "%.15f\n", ans1 printf "%.15f\n", ans2 # puts "2 #{ans1.to_f} #{ans2.to_f}" end end