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 k: usize = itr.next().unwrap().parse::().unwrap() - 1; let x: Vec = (0..n) .map(|_| itr.next().unwrap().parse().unwrap()) .collect(); let a: Vec = (0..n) .map(|_| itr.next().unwrap().parse().unwrap()) .collect(); let mut left = k; let mut lv = x[k] - a[k]; let mut right = k; let mut rv = x[k] + a[k]; while left > 0 { if x[left - 1] >= lv { lv = std::cmp::min(lv, x[left - 1] - a[left - 1]); left -= 1; } else { break; } } while right < n - 1 { if x[right + 1] <= rv { rv = std::cmp::max(rv, x[right + 1] + a[right + 1]); right += 1; } else { break; } } println!("{}", right - left + 1); }