/* -*- coding: utf-8 -*- * * 955.cc: No.955 ax^2+bx+c=0 - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ /* typedef */ typedef long double ld; /* global variables */ /* subroutines */ /* main */ int main() { int a, b, c; scanf("%d%d%d", &a, &b, &c); if (a == 0) { if (b == 0) printf("%d\n", (c == 0) ? -1 : 0); else printf("1\n%25Lf\n", (ld)c / b); } else { ld fa = a, fb = b, fc = c; ld dd = fb * fb - 4 * fa * fc; if (dd > 0.0) { ld d = sqrtl(dd); ld x0 = (fb >= 0.0) ? (-fb - d) / (fa * 2) : (-fb + d) / (fa * 2); ld x1 = (ld) c / a / x0; if (x0 > x1) swap(x0, x1); printf("2\n%.25Lf\n%.25Lf\n", x0, x1); } else if (dd == 0.0) printf("1\n%.25Lf\n", -fb / (fa * 2)); else puts("0"); } return 0; }