#include #include #include #include #include #include #include int howManyGames(int p, int d, int m, int s) { // Return the number of games you can buy int q,n=0,count=0; while(p=m) { n=n+p; p=p-d; count++; } if(p==m) { n=n+m; } if(n<=s) { printf("%d",count); } return 0; } 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; }