#include using namespace std; int main(){ int m,p,d,s,cost=0,games=0; cin>>m>>p>>d>>s; while((cost+m)<=s){ cost+=m; if(m-p > d) m-=p; else m=d; //cout<