#define _USE_MATH_DEFINES #include "bits/stdc++.h" using namespace std; #define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i)) #define rep(i,j) FOR(i,0,j) #define each(x,y) for(auto &(x):(y)) #define mp make_pair #define MT make_tuple #define all(x) (x).begin(),(x).end() #define debug(x) cout<<#x<<": "<<(x)<; using vi = vector; using vll = vector; void solve() { int N, K; cin >> N >> K; --K; vll X(N), A(N); rep(i, N)cin >> X[i]; rep(i, N)cin >> A[i]; map xa; rep(i, N) { if (i != K)xa[X[i]] = A[i]; } ll ub = X[K] + A[K], lb = X[K] - A[K]; while (true) { auto it = xa.lower_bound(lb); if (it != xa.end() && it->first <= ub) { smax(ub, it->first + it->second); smin(lb, it->first - it->second); xa.erase(it); } else { break; } } int ans = N - sz(xa); cout << ans << endl; } int main() { ios::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(15); solve(); return 0; }