fork download
  1. (a,b,c)=gets.split.map{|i|i=i.to_i}
  2. if a==0
  3. if b==0 then puts c==0?"-1":"0";exit end
  4. puts "1";p -c.to_f/b;exit
  5. end
  6. if (d=b*b-4*a*c)<0 then puts "0";exit end
  7. if d==0 then puts "1";p -b.to_f/2/a;exit end
  8. puts "2"
  9. if a<0 then a=-a;b=-b;c=-c end
  10. p (-b-Math.sqrt(d))/2/a,(-b+Math.sqrt(d))/2/a
Success #stdin #stdout 0.01s 7964KB
stdin
1 -5 2
stdout
2
0.4384471871911697
4.561552812808831