fn dfs(x: usize, y: usize, h: usize, depth: usize, result: &mut usize) { if x <= h && y <= h { *result = (*result).max(depth); return; } if x > h { dfs(x / 2 + x % 2, y, h * 2, depth+1, result); } if y > h { dfs(x, y / 2 + y % 2, h * 2, depth+1, result); } } fn main() { let mut xyh = String::new(); std::io::stdin().read_line(&mut xyh).ok(); let xyh: Vec = xyh.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let x = xyh[0] * 1000; let y = xyh[1] * 1000; let h = xyh[2]; let mut result = 0usize; dfs(x, y, h, 0, &mut result); println!("{}", result); }