fun main(){ var (n, k) = readLine()!!.split(" ").map{it.toInt()} val x = readLine()!!.split(" ").map{it.toInt()} val a = readLine()!!.split(" ").map{it.toInt()} k-- var lindex = k var rindex = k var lpos = x[lindex]-a[lindex] var rpos = x[rindex]+a[rindex] while(true){ if(lindex > 0 && lpos <= x[lindex-1]){ lindex-- lpos = Math.min(lpos, x[lindex]-a[lindex]) rpos = Math.max(rpos, x[lindex]+a[lindex]) }else if(rindex+1 < n && x[rindex+1] <= rpos){ rindex++ lpos = Math.min(lpos, x[rindex]-a[rindex]) rpos = Math.max(rpos, x[rindex]+a[rindex]) }else{ break } } println(rindex-lindex+1) }