#include #include #include #include #include using namespace std; int main() { int p,d,m,s,sum=0,count=0; cin>>p>>d>>m>>s; while(1){ if(sum+p<=s) sum+=p; else break; if(p-d>m) p=p-d; else p=m; count++; } cout<