#include using namespace std; #define ll long long #define rep(i, n) for (int i = 0; i < (n); i++) #define P pair #define LP pair template void chmax(T& a, T b) { a = max(a, b); }; template void chmin(T& a, T b) { a = min(a, b); }; int main() { int n, k; cin >> n >> k; vector x(n+2),a(n+1); rep(i,n) cin >> x[i+1]; rep(i,n) cin >> a[i+1]; const ll INF = 1e18; x[0] = -INF, x[n+1] = INF; ll l = x[k]-a[k], r = x[k]+a[k]; int m = k, M = k; while (true) { int nxt1 = lower_bound(x.begin(),x.end(),l)-x.begin(); int nxt2 = upper_bound(x.begin(),x.end(),r)-x.begin(); nxt2--; if (nxt1==m&&nxt2==M) break; for (int i = m; i >= nxt1; i--) { chmin(l, x[i]-a[i]); chmin(r, x[i]+a[i]); } for (int i = M; i <= nxt2; i++) { chmin(l, x[i]-a[i]); chmax(r, x[i]+a[i]); } m = nxt1; M = nxt2; } int ans = M-m+1; cout << ans << endl; return 0; }