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