#include using namespace std; typedef long long ll; typedef vector vi; typedef vector vvi; #define rep(i,n) for(ll i=0;i<(n);i++) #define pii pair #define piii pair #define mp make_pair #define pb push_back #define ALL(a) (a).begin(),(a).end() #define FST first #define SEC second const int INF = (INT_MAX/2); const ll LLINF = (LLONG_MAX/2); const double eps = 1e-5; const double PI = M_PI; #define DEB cout<<"!"< Array; typedef vector matrix; #define MAX 1000000005 const ll BigIntDig = 8; // BigIntDig*9-dig const ll Base = 1000000000; class BigInt{ public: int Num[BigIntDig]; bool sign; // 0 is positive,1 is negative - number int size; // how many using Num-Array BigInt(); BigInt(ll); BigInt(string); void Setstr(string); int Carry(int,int); void Deb(); }; BigInt operator-(BigInt x){ x.sign ^= 1; return x; } // you can use this func after setting "size" void BigInt::Setstr(string str){ if(str[0] == '-'){sign = 1; str = str.substr(1);} else sign = 0; int m = str.size() % 9; if(m == 0) m = 9; Num[size-1]=atoi(str.substr(0,m).c_str()); for(int i = size-2; i >= 0; i--) Num[i] = std::atoi(str.substr((size-i-1)*9-(9-m),9).c_str()); } ostream &operator<<(ostream &os, BigInt x) { if(x.sign) os << '-'; os << x.Num[x.size-1]; for (int i = x.size-2; i >= 0; --i) os << setw(9) << setfill('0') << x.Num[i]; return os; } BigInt::BigInt(){ memset(Num,0,sizeof(Num)); size = 1; sign = 1; } BigInt::BigInt(string str){ memset(Num,0,sizeof(Num)); size = (str.size()-1)/9 + 1; Setstr(str); } BigInt::BigInt(ll num){ memset(Num,0,sizeof(Num)); if(num < 0) sign = 1; else sign = 0; num = llabs(num); Num[0] = num % Base; Num[1] = num / Base; if(Num[1] != 0) size = 2; else size = 1; } bool operator < (BigInt x,BigInt y){ if(x.sign && y.sign) return ((-y)<(-x)); if(x.sign && y.sign == 0) return true; if(x.sign == 0 && y.sign) return false; if(x.size != y.size) return x.size < y.size; for(int i=x.size-1; i >= 0; i--) if(x.Num[i] != y.Num[i]) return x.Num[i] < y.Num[i]; return false; // x == y } bool operator > (BigInt x,BigInt y){return y= (BigInt x,BigInt y){return !(x= size){ size = index+1; Num[index] = value; }else{ int sum = Num[index] + value; if(sum >= Base){ Carry(index,sum/Base); sum %= Base; Num[index] = sum; }else{ Num[index] = sum; } } return 0; } BigInt operator-(BigInt x, BigInt y); BigInt operator+(BigInt x, BigInt y) { if(x.sign && y.sign) return (-(-x+(-y))); if(x.sign && y.sign == 0) return (y-(-x)); if(x.sign == 0 && y.sign) return (x-(-y)); if (x.size < y.size) x.size = y.size; for (int i = 0; i < y.size; ++i){ x.Num[i] += y.Num[i]; if(x.Num[i] >= Base){ x.Carry(i,x.Num[i]/Base); x.Num[i] %= Base; } } return x; } BigInt operator-(BigInt x, BigInt y) { if(x.sign && y.sign) return (-y)-(-x); if(x.sign == 0 && y.sign) return x+y; if(x.sign && y.sign == 0) return x+(-y); if (x < y) {swap(x,y); x.sign ^= 1;} for (int i = 0; i < y.size; ++i){ x.Num[i] -= y.Num[i]; if(x.Num[i] < 0){ x.Carry(i,-1); x.Num[i] += Base; } } return resize(x); } BigInt operator*(BigInt x,BigInt y){ int ys=y.size,xs = x.size; BigInt ret;ret.size = 1; ret.sign = (x.sign + y.sign)%2; for (int i = 0; i < xs; ++i){ for(int j = 0; j < ys; ++j){ ll mul = (ll)x.Num[i] * y.Num[j]; ret.Carry(i+j,mul/Base); ret.Carry(i+j-1,mul%Base); } } return ret; } void BigInt::Deb(){ for(int i = 0;i < size;i++) cout << Num[i] << " " << i << endl; } ll a,b,c; ll s = 1.0; bool func(ll x){ BigInt bx(x); if(resize(BigInt(s)*bx*bx*bx+BigInt(a)*bx*bx+BigInt(b)*bx+BigInt(c)) > BigInt((ll)0)) return true; else return false; } bool check(ll x){ BigInt bx(x); if(BigInt(s)*bx*bx*bx+BigInt(a)*bx*bx+BigInt(b)*bx+BigInt(c) == BigInt((ll)0)) return true; else return false; } int main(){ cin >> a >> b >> c; double B1 = (1.*(-a) + sqrt(1.*a*a-3.0*b))/3.0; double B2 = (1.*(-a) - sqrt(1.*a*a-3.0*b))/3.0; set ans; for(ll i = B1 - 10; i <= B1 + 10; i++) if(check(i)) ans.insert(i); for(ll i = B2 - 10; i <= B2 + 10; i++) if(check(i)) ans.insert(i); ll bottom = -1000000000; ll top = B2; while(llabs(top-bottom) > 1){ if(func((top+bottom)/2)) top = (top+bottom)/2; else bottom = (top+bottom)/2; } for(ll i = bottom - 10; i <= bottom + 10; i++) if(check(i)) ans.insert(i); bottom = B1; top = B2; while(llabs(top-bottom) > 1){ if(func((top+bottom)/2)) top = (top+bottom)/2; else bottom = (top+bottom)/2; } for(ll i = bottom - 10; i <= bottom + 10; i++) if(check(i)) ans.insert(i); bottom = B1; top = 1000000000; while(llabs(top-bottom) > 1){ if(func((top+bottom)/2)) top = (top+bottom)/2; else bottom = (top+bottom)/2; } for(ll i = bottom - 10; i <= bottom + 10; i++) if(check(i)) ans.insert(i); for(auto itr = ans.begin(); itr != ans.end();itr++){ if(itr != ans.end()) cout << *itr << " "; else cout << *itr << endl; } }