#include #include using namespace std; typedef long long ll; typedef double flt; const char eol = '\n'; int main() { /* freopen("tmp", "r", stdin); // */ ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int m, p, d, s; cin >> p >> d >> m >> s; int cur_cost = p, res = 0; while (cur_cost <= s) { ++res; s -= cur_cost; cur_cost = max(cur_cost - d, m); } cout << res << eol; return 0; }