import std.stdio, std.array, std.string, std.conv, std.algorithm; import std.typecons, std.range, std.random, std.math, std.container; import std.numeric, std.bigint, core.bitop, core.stdc.stdio; void main() { auto s = readln.split.map!(to!int); auto n = s[0]; auto k = s[1] - 1; auto X = readln.split.map!(to!long).array; auto A = readln.split.map!(to!long).array; auto B = n.iota.map!(i => tuple(X[i], A[i], i)).array; B.sort!"a[0] < b[0]"; int idx = -1; foreach (i; 0..n) if (B[i][2] == k) idx = i; int ans = 1; long mx = B[idx][0] + B[idx][1]; foreach (i; idx+1..n) { if (B[i][0] <= mx) { ans += 1; mx = max(mx, B[i][0] + B[i][1]); } } mx = B[idx][0] - B[idx][1]; foreach_reverse (i; 0..idx) { if (B[i][0] >= mx) { ans += 1; mx = min(mx, B[i][0] - B[i][1]); } } ans.writeln; }