#include #define rep(i, ss, ee) for (int i = ss; i < ee; ++i) using namespace std; void solve2() { int a, b, c, d; int ans = 0; cin >> a >> b >> c >> d; rep(i, 1, a + 1) { if (((i + i * c) > d) or (i * c > b)) break; ans++; } cout << ans << endl; } void solve() { int a, b, c, d; cin >> a >> b >> c >> d; cout << min(a, min(b / c, d / (c + 1))) << endl; } int main() { cin.tie(0); ios::sync_with_stdio(false); solve(); getchar(); }