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

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



for i in range(min(n, k)):

        del h[n - i - 1]



HP = sum(h)

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

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

h.sort(reverse = True)



HP = sum(h[min(n,k):n])

print(HP)
n, k = list(map(int, input().split()))
h = sorted(list(map(int, input().split())))
for i in range(min(n, k)):
    del h[n - i - 1]
HP = sum(h)
print(HP)

n, k = list(map(int, input().split()))
h = list(map(int, input().split()))
h.sort(reverse=True)
HP = sum(h[min(n, k) : n])
print(HP)

-h = sorted(list(map(int, input().split()))) -for i in range(min(n, k)): -    del h[n - i - 1] -HP = sum(h) +h = list(map(int, input().split())) +h.sort(reverse=True) +HP = sum(h[min(n, k) : n])