#define _USE_MATH_DEFINES #include using namespace std; signed main() { ios::sync_with_stdio(false); cin.tie(0); int n, k; cin >> n >> k; vector x(n); for (int i = 0; i < n; i++) { cin >> x[i]; } vector a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } k--; long long cur = x[k] - a[k]; int ans = 1; for (int i = k - 1; i >= 0; i--) { if (x[i] >= cur) ans++, cur = x[i] - a[i]; else break; } cur = x[k] + a[k]; for (int i = k + 1; i < n; i++) { if (x[i] <= cur) ans++, cur = x[i] + a[i]; else break; } cout << ans << endl; return 0; }