#include using namespace std; using ll = long long; int main() { int n, k; cin >> n >> k; k--; vector x(n), a(n); for (int i = 0; i < n; i++) { cin >> x.at(i); } for (int i = 0; i < n; i++) { cin >> a.at(i); } ll d = a.at(k); int cnt = 1; for (int i = k + 1; i < n; i++) { if (x.at(i) - x.at(i - 1) <= d) { cnt++; d = max(d - (x.at(i) - x.at(i - 1)), a.at(i)); } else break; } d = a.at(k); for (int i = k - 1; i >= 0; i--) { if (x.at(i + 1) - x.at(i) <= d) { cnt++; d = max(d - (x.at(i + 1) - x.at(i)), a.at(i)); } else break; } cout << cnt << endl; }