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