#include using namespace std; #define PI atan(1)*4 int main() { // freopen("output.txt", "w", stdout); ios_base::sync_with_stdio(0); int p, d, m, s; cin >> p >> d >> m >> s; int currentPrice = 0; int totalPrice = 0; int i = 0; for ( i = 0; currentPrice+p <=s;i++) { currentPrice += p; p -= d; if (p <= m)p = m; } cout << i << endl; return 0; }