#include using namespace std; int main() { int p,d,m,i,n,sum=0,c,x,y,z; long long int s; cin >> p >> d >> m >> s; sum=sum+p; while(p>=m&&sum<=s) { p=p-d; sum=sum+p; c++; if((p-d)==m) { while(p>=m&&sum<=s) { p=p-d; sum=sum+p; c++; } } } cout<