#include #include #include #include #include #include #include #include #include using std::cerr; using std::cin; using std::cout; using std::endl; void OutputError(std::string s) { cerr << "\033[93m" << s << "\033[m" << endl; return; } int main(void) { cout << std::fixed << std::setprecision(10); cin.tie(0); std::ios::sync_with_stdio(false); int a, b, c, d; cin >> a >> b >> c >> d; int set = 1 + c; int ate = 0; int result = 0; while (a >= 0 && b >= 0) { if (ate + set <= d) { ate += set; result++; a--; b -= c; } else break; } cout << result << endl; return 0; }