use std::io::*; fn main() { let mut s: String = String::new(); std::io::stdin().read_to_string(&mut s).ok(); let mut itr = s.trim().split_whitespace(); let n: usize = itr.next().unwrap().parse().unwrap(); let d: usize = itr.next().unwrap().parse().unwrap(); let _x: Vec = (0..n) .map(|_| itr.next().unwrap().parse().unwrap()) .collect(); let v: Vec = (0..n) .map(|_| itr.next().unwrap().parse().unwrap()) .collect(); let mut ok = 1 << 30; let mut ng = 0; while ok - ng > 1 { let mid = (ok + ng) >> 1; let mut tmp = 0; for i in 0..n { tmp += v[i] * mid; } if tmp >= d { ok = mid; } else { ng = mid; } } println!("{}", ok); }