#include using namespace std; int main() { int a, b, c, d, ans = 0; cin >> a >> b >> c >> d; int prev = 0; for (int i = 0; i < a; i++) { ans++; if ((i + 1) * c > b || ans * (c + 1) > d) { cout << ans - 1 << endl; return 0; } } cout << ans << endl; return 0; }