#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 nxt = lower_bound(x.begin(),x.end(),l)-x.begin(); if (nxt == m) break; for (int i = m; i >= nxt; i--) { chmin(l, x[i]-a[i]); } m = nxt; } while (true) { int nxt = upper_bound(x.begin(),x.end(),r)-x.begin(); nxt--; if (nxt == M) break; for (int i = M; i <= nxt; i++) { chmax(r,x[i]-a[i]); } M = nxt; } int ans = M-m+1; cout << ans << endl; return 0; }