/* * eat_code * IIIT Allahabad */ #include //#include "pretty_print.h" using namespace std; #define mp make_pair #define mt make_tuple #define pb push_back #define CONTAINS(a, x) (a.find(x) != a.end()) #define ALL(x) x.begin(), x.end() #define SZ(x) (int)x.size() #define nl cout << endl #define F first #define S second #define what_is(x) cout << #x << " = " << x << endl #define boost ios::sync_with_stdio(false);cin.tie(NULL) #define CASET int ___T, case_n = 1; cin >> ___T; while (___T-- > 0) #define rep(it, st, en) for(ll it = st; it < en; it++) #define rep1(it, st, en) for(ll it = st; it <= en; it++) #define per(it, st, en) for(ll it = en - 1; it >= st; it--) typedef long long ll; typedef pair ii; typedef pair pll; typedef vector vi; typedef vector vll; typedef vector vb; typedef vector vii; typedef vector vvi; ll INF = 1E9; ll M = 1E9 + 7; inline ll power (ll a,ll p){ ll res = 1, x = a; while ( p ) { if ( p & 1 ) res = ( res * x ); x = ( x * x ); p >>= 1; } return res; } template ostream& operator<<(ostream& os, const vector &p){os << "[ "; for (T x: p) os << x << " "; os << "]" << endl; return os;} template ostream& operator<<(ostream& os, const set &p){os << "{ "; for (T x: p) os << x << " "; os << "}" << endl; return os;} template ostream& operator<<(ostream& os, const map &p){os << "{ "; for (pair x: p) os << x << " "; os << "}" << endl; return os;} template ostream& operator<<(ostream& os, const pair &p){os << "{" << p.first << ',' << p.second << "}";return os;} int main() { boost; ll p, d, m, s; cin >> p >> d >> m >> s; ll cost = p; ll ans = 0; while(1){ if(s >= cost){ s -= cost; ans++; } else break; cost -= d; if(cost <= m)cost = m; } cout << ans << "\n"; return 0; } // Train Insane or Remain the same