#include #include #include #include #include #include #include int howManyGames(int p, int d, int m, int s) { int c=0; while(s>=p){ s=s-p; c++; if((p-d)>m ) p=p-d; else p=m; } return c; } int main() { int p; int d; int m; int s; scanf("%i %i %i %i", &p, &d, &m, &s); int answer = howManyGames(p, d, m, s); printf("%d\n", answer); return 0; }