#include #include using namespace std; #define fastScan ios_base::sync_with_stdio(0); cin.tie(NULL); #define ABS(x) ((x) < 0 ? -1*(x) : (x)) #define MAX(x,y) ((x) > (y) ? (x) : (y)) #define MIN(x,y) ((x) < (y) ? (x) : (y)) #define mp make_pair #define pb push_back #define MOD 1000000007 #define INF 2000000000 #define BINF 20000000000000000LL #define trace(x) cerr << #x << ": " << x << endl; #define trace1(x) cerr << #x << ": " << x << endl; #define trace2(x, y) cerr << #x << ": " << x << " | " << #y << ": " << y << endl; #define trace3(x, y, z) cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl; #define trace4(a, b, c, d) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl; #define trace5(a, b, c, d, e) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl; #define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl; typedef long long ll; typedef long double ld; typedef pair pl; const ld PI = acos(-1.0); int main() { fastScan; ll P,D,M,S,i; cin >> P >> D >> M >> S; for(i = 0; S ; ) { if(P <= S){ ++i; S -= P; P -= D; P = MAX(M,P); } else break; } cout << i; return 0; }