/* * If you're not willing to make sacrifices yourself, you'll never be * able to change anything. In order to overcome monsters, you must * be willing to abandon your own humanity. * ~ Arlert */ #include using namespace std; typedef pair II; typedef vector VII; typedef vector VI; typedef vector VVI; typedef long long int LL; #define PB push_back #define MP make_pair #define F first #define S second #define SZ(a) (int)(a.size()) #define ALL(a) a.begin(), a.end() #define SET(a, b) memset(a, b, sizeof(a)) #define si(n) scanf("%d", &n) #define dout(n) printf("%d\n", n) #define sll(n) scanf("%lld", &n) #define lldout(n) printf("%lld\n", n) #define TRACE #ifdef TRACE #define trace(...) __f(#__VA_ARGS__, __VA_ARGS__) template void __f(const char *name, Arg1 &&arg1) { cerr << name << " : " << arg1 << std::endl; } template void __f(const char *names, Arg1 &&arg1, Args &&... args) { const char *comma = strchr(names + 1, ','); cerr.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...); } #else #define trace(...) #endif #define fast_io \ ios_base::sync_with_stdio(false); \ cin.tie(NULL) #define endl '\n' int main() { fast_io; int p, d, m, s; cin >> p >> d >> m >> s; int tot = 0; while (s >= p) { tot++; s -= p; p = max(p - d, m); } cout << tot << endl; return 0; }