N, K = list(map(int, input().split()))

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

H.sort()

for i in range(K):

  if len(H) <= 0:

    break

  H.pop(-1)

print((sum(H) if len(H) > 0 else 0))
n,k = list(map(int, input().split()))

H = sorted(list(map(int, input().split())))[::-1]

ans = 0

for h in H:

    if k>0:

        k -= 1

        continue

    ans += h

print(ans)
N, K = list(map(int, input().split()))
H = list(map(int, input().split()))
H.sort()
for i in range(K):
    if len(H) <= 0:
        break
    H.pop(-1)
print((sum(H) if len(H) > 0 else 0))

n, k = list(map(int, input().split()))
H = sorted(list(map(int, input().split())))[::-1]
ans = 0
for h in H:
    if k > 0:
        k -= 1
        continue
    ans += h
print(ans)

-N, K = list(map(int, input().split())) -H = list(map(int, input().split())) -H.sort() -for i in range(K): -    if len(H) <= 0: -        break -    H.pop(-1) -print((sum(H) if len(H) > 0 else 0)) +n, k = list(map(int, input().split())) +H = sorted(list(map(int, input().split())))[::-1] +ans = 0 +for h in H: +    if k > 0: +        k -= 1 +        continue +    ans += h +print(ans)