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

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



ans = 0

Hn.sort()

try:

    for _ in range(K):

        Hn.pop(-1)

except:

    print((0))

    exit()

ans = sum(Hn)

print(ans)

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

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



ans = 0

Hn.sort()

K = min(H, K)

print((sum(Hn[:H-K])))
H, K = list(map(int, input().split()))
Hn = list(map(int, input().split()))
ans = 0
Hn.sort()
try:
    for _ in range(K):
        Hn.pop(-1)
except:
    print((0))
    exit()
ans = sum(Hn)
print(ans)

H, K = list(map(int, input().split()))
Hn = list(map(int, input().split()))
ans = 0
Hn.sort()
K = min(H, K)
print((sum(Hn[: H - K])))

-try: -    for _ in range(K): -        Hn.pop(-1) -except: -    print((0)) -    exit() -ans = sum(Hn) -print(ans) +K = min(H, K) +print((sum(Hn[: H - K])))