//let's do it #include #include using namespace std; #define ll long long int #define inf 1000000000000 #define mod 1000000007 #define pb push_back #define mp make_pair #define all(v) v.begin(),v.end() #define S second #define F first #define boost1 ios::sync_with_stdio(false); #define boost2 cin.tie(0); #define mem(a,val) memset(a,val,sizeof a) #define endl "\n" #define maxn 100001 ll a[maxn]; int main() { boost1;boost2; ll i,j,n,x,y,f=0,ans=0,p,d,m,s,cost; char ch; //string s; cin>>p>>d>>m>>s; if(p>s) { cout<<"0"; return 0; } ans=1; s=s-p; cost=p-d; while(1) { if(s<=0) break; if(cost>s) break; if(cost<=m) { f=1; cost=m; } if(cost>s) break; ans++; s-=cost; if(f) continue; cost=cost-d; } cout<