use std::io::Read; fn solve(abcd: Vec) { let limit = std::cmp::min(abcd[0], abcd[1] / abcd[2]); println!("{}", std::cmp::min(limit, abcd[3] / (1 + abcd[2]))); } fn main() { let mut abcd = String::new(); std::io::stdin().read_to_string(&mut abcd).ok(); let abcd: Vec = abcd.trim().split('\n').next().unwrap().trim().split_whitespace().map(|s| s.parse::().unwrap()).collect(); solve(abcd); }