#include int a, b, c, d; int main() { int i; int answer = 0; scanf("%d %d %d %d", &a, &b, &c, &d); for(i = 1;i <= a;i++) { if((i * c) <= b) { if((i + i * c) <= d) { answer = i; } } } printf("%d\n", answer); return (0); }