/** * author: TakeruOkuyama * created: 2020-04-09 14:53:46 **/ #include #define rep(i, n) for(int i = 0; i < (n); i++) using namespace std; using ll = long long; using P = pair; int main(){ int A, B, C, D; cin >> A >> B >> C >> D; int ans = 0; for(int i = 1; i <= A; i++){ if(i * C <= B && i + i * C <= D){ ans = i; } } cout << ans << endl; return 0;} /** **/