import sys input=lambda: sys.stdin.readline().rstrip() n,k=map(int,input().split()) X=[int(i) for i in input().split()] A=[int(i) for i in input().split()] l,r=X[k-1]-A[k-1],X[k-1]+A[k-1] ll,rr=k-1,k-1 while True: if ll-1>=0 and X[ll-1]>=l: l=min(l,X[ll-1]-A[ll-1]) r=max(r,X[ll-1]+A[ll-1]) ll-=1 elif rr+1