#include using namespace std; int main() { long N, K; cin >> N >> K; K--; vector X(N), A(N); for (long i = 0; i < N; i++) cin >> X.at(i); for (long i = 0; i < N; i++) cin >> A.at(i); long L = X.at(K) - A.at(K); long R = X.at(K) + A.at(K); long l = K, r = K; while (true) { bool b = 1; l--; if (l < 0) l++; else { if (X.at(l) < L) l++; else { L = min(L, X.at(l) - A.at(l)); R = max(R, X.at(l) + A.at(l)); b = 0; } } r++; if (r >= N) r--; else { if (X.at(r) > R) r--; else { R = max(R, X.at(r) + A.at(r)); L = min(L, X.at(r) - A.at(r)); b = 0; } } if (b) break; } cout << r - l + 1 << "\n"; }