#include #include #include using namespace std; int main() { int A, B, C, D; cin >> A >> B >> C >> D; int a = 0; for (a = 0; a <= A; a++) { bool g1 = a * C > B; bool g2 = a + a * C > D; if (g1 || g2) { break; } } cout << a -1<< endl; }