import heapq N,K = map(int, input().split()) A = list(map(int, input().split())) H = [] heapSum = 0 ans = 0 for i in reversed(range(N)): if len(H)