#define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define eps 0.000000001 #define LONG_INF 10000000000000000 #define GOLD 1.61803398874989484820458 #define MAX_MOD 1000000007 #define f(n) for(int i=0;i> a >> b >> c; double n = 0; int cnter = 0; failed:; for (int i = 0;i < 5000;++i) { n = n - (calc_f(n) / calc_fd(n)); } //nは解の一つ if ((long long)n == 0) { if(cnter % 2 == 0){ n = -10000*(cnter+1); }else n = 10000 * (cnter+1); cnter += 1; goto failed; } vector ans; ans.push_back((long long)n); double q = 1; double w = a + ans[0]; double h = -1 * (c / ans[0]); double topper = -1 * w + sqrt(w*w - 4 * q*h); topper /= 2 * q; ans.push_back((long long)(topper)); topper = -1 * w - sqrt(w*w - 4 * q*h); topper /= 2 * q; ans.push_back((long long)(topper)); sort(ans.begin(), ans.end()); cout << ans[0] << " " << ans[1] << " " << ans[2] << endl; return 0; }