n, k = list(map(int, input().split()))

h = list(map(int, input().split()))



h.sort()

ans = 0



for i in range(n-k):

    ans += h[i]



print(ans)
n,k = list(map(int,input().split()))

h = list(map(int,input().split()))



h_sort = sorted(h, reverse=True)

ans = sum(h_sort[k:])



print(ans)
n, k = list(map(int, input().split()))
h = list(map(int, input().split()))
h.sort()
ans = 0
for i in range(n - k):
    ans += h[i]
print(ans)

n, k = list(map(int, input().split()))
h = list(map(int, input().split()))
h_sort = sorted(h, reverse=True)
ans = sum(h_sort[k:])
print(ans)

-h.sort() -ans = 0 -for i in range(n - k): -    ans += h[i] +h_sort = sorted(h, reverse=True) +ans = sum(h_sort[k:])