fn main() { let mut buf = String::new(); let mut input = { use std::io::Read; std::io::stdin().read_to_string(&mut buf).unwrap(); buf.split_whitespace() }; let n: usize = input.next().unwrap().parse().unwrap(); let a: usize = input.next().unwrap().parse().unwrap(); let b: usize = input.next().unwrap().parse().unwrap(); let x: i64 = input.next().unwrap().parse().unwrap(); let y: i64 = input.next().unwrap().parse().unwrap(); let mut h: Vec = (0..n) .map(|_| input.next().unwrap().parse().unwrap()) .collect(); for _ in 0..a { let i = max_hp_index(&h); h[i] -= x; } for _ in 0..b { let mut p = y; for i in 0..n { if h[i] > 0 { if h[i] < p { p -= h[i]; h[i] = 0; } else { h[i] -= p; p = 0; } } if p == 0 { break; } } } let output = if h .iter() .fold(true, |acc, &hp| if hp > 0 { false } else { acc }) { "Yes" } else { "No" }; println!("{}", output); } fn max_hp_index(h: &Vec) -> usize { let mut index = 0; let mut hp = h[0]; for i in 0..h.len() { if h[i] > hp { index = i; hp = h[i]; } } index }