#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define _USE_MATH_DEFINES #include #include using namespace std; #define INFD numeric_limits::infinity() #define INFL (int)1e8 #define INFLL (long long)1e15 #define Loop(i, n) for(int i = 0; i < (int)n; i++) #define Loopll(i, n) for(ll i = 0; i < (ll)n; i++) #define Loop1(i, n) for(int i = 1; i <= (int)n; i++) #define Loopll1(i, n) for(ll i = 1; i <= (ll)n; i++) #define Loopr(i, n) for(int i = (int)n - 1; i >= 0; i--) #define Looprll(i, n) for(ll i = (ll)n - 1; i >= 0; i--) #define Loopr1(i, n) for(int i = (int)n; i >= 1; i--) #define Looprll1(i, n) for(ll i = (ll)n; i >= 1; i--) #define rnd(d) (int)((double)d + (d >= 0) ? 0.5 : -0.5) #define bitmanip(m,val) static_cast>(val) typedef long long int ll; typedef vector vi; typedef vector> vvi; typedef pair P; typedef pair Pll; typedef vector vll; typedef vector> vvll; /*******************************************************/ vll divisors(ll x) { vll ret; Loopll1(i, x) { if (i > 1e6) break; ll y = (ll)i * i; if (y >= x) { if (y == x) ret.push_back(i); break; } else { if (x % i == 0) { ret.push_back(i); ret.push_back(x / i); } } } return ret; } inline ll calc(ll a, ll b, ll c, ll x) { return x * (x * (x + a) + b) + c; } inline ll calc2(ll a, ll b, ll x) { return x * (x + a) + b; } int main() { ll a, b, c; cin >> a >> b >> c; vll ans; if (c == 0) { ans.push_back(0); } else { vll c_divs = divisors(abs(c)); Loop(i, c_divs.size()) { if (calc(a, b, c, c_divs[i]) == 0) { ans.push_back(c_divs[i]); break; } if (calc(a, b, c, -c_divs[i]) == 0) { ans.push_back(-c_divs[i]); break; } } a += ans[0]; b += a * ans[0]; c += b * ans[0]; } ans.push_back(rnd((-a + sqrt(a * a - 4 * b)) / 2)); ans.push_back(rnd((-a - sqrt(a * a - 4 * b)) / 2)); sort(ans.begin(), ans.end()); Loop(i, ans.size()) { if (i > 0 && ans[i] == ans[i - 1]) continue; cout << ans[i] << " "; } cout << endl; }