local n, k = io.read("*n", "*n") local x, a = {}, {} for i = 1, n do x[i] = 0LL + io.read("*n") end for i = 1, n do a[i] = 0LL + io.read("*n") end local tasks = {k} local l, r = k, k while 0 < #tasks do local idx = tasks[#tasks] table.remove(tasks) for ir = r + 1, n do if x[ir] <= x[idx] + a[idx] then table.insert(tasks, ir) else r = ir - 1 break end end for il = l - 1, 1, -1 do if x[idx] - a[idx] <= x[il] then table.insert(tasks, il) else l = il + 1 break end end end print(r - l + 1)