#include using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ ios_base::sync_with_stdio(false); int p,d,m,s; cin>>p>>d>>m>>s; int t=0; while(s>=p){ t+=1; s-=p; if(p-d>m) p-=d; else p=m; } cout<