#include using namespace std; int howManyGames(int p, int d, int m, int s) { long long int ans=0; long long int temp=s; long long int price=p; while(price>m) { temp = temp-price; if(temp<0) break; price-=d; ans++; } if(temp>=0) ans+=temp/m; return ans; // Return the number of games you can buy } int main() { int p; int d; int m; int s; cin >> p >> d >> m >> s; int answer = howManyGames(p, d, m, s); cout << answer << endl; return 0; }