N,K = map(int,input().split()) frogs = [] cnt = 1 for p,v in zip(input().split(),input().split()): frogs.append((int(p),int(v))) #K番目が鳴いた時、声が響く区間 section = [frogs[K-1][0] - frogs[K-1][1], frogs[K-1][0] + frogs[K-1][1]] #K番目の蛙の前後の集団 frogs_before_K = frogs[:K-1] frogs_after_K = frogs[K:] flg = True while flg: flg = False if len(frogs_before_K) > 0: if frogs_before_K[-1][0] in range(section[0],section[1]+1): cnt +=1 if frogs_before_K[-1][0]-frogs_before_K[-1][1] < section[0]: section[0] = frogs_before_K[-1][0]-frogs_before_K[-1][1] if frogs_before_K[-1][0]+frogs_before_K[-1][1] > section[1]: section[1] = frogs_before_K[-1][0]+frogs_before_K[-1][1] frogs_before_K.pop(-1) flg = True if len(frogs_after_K) >0: if frogs_after_K[0][0] in range(section[0],section[1]+1): cnt +=1 if frogs_after_K[0][0]-frogs_after_K[0][1] < section[0]: section[0] = frogs_after_K[0][0]-frogs_after_K[0][1] if frogs_after_K[0][0]+frogs_after_K[0][1] > section[1]: section[1] = frogs_after_K[0][0]+frogs_after_K[0][1] frogs_after_K.pop(0) flg = True print(cnt)