fn main() { let nums: Vec = read_vec(); if about_half(nums) { println!("Yes") } else { println!("No") } } fn about_half(nums: Vec) -> bool { let (a, b) = (nums[0],nums[1]); a.max(b) <= 2 * a.min(b) } fn read() -> T { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); s.trim().parse().ok().unwrap() } fn read_vec() -> Vec { read::() .split_whitespace() .map(|e| e.parse().ok().unwrap()) .collect() } fn read_vec2(n: u32) -> Vec> { (0..n).map(|_| read_vec()).collect() } #[cfg(test)] mod test { use crate::about_half; #[test] fn testcases() { assert_eq!(about_half(vec![6, 6]), true); assert_eq!(about_half(vec![4, 8]), true); assert_eq!(about_half(vec![4, 9]), false); assert_eq!(about_half(vec![500, 250]), true); } }