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

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

a.sort(reverse=1)

ans = 0

for i in range(k,n):

    ans += a[i]

print(ans)

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

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

a.sort()

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

n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
a.sort()
print((sum(a[: max(n - k, 0)])))

-a.sort(reverse=1) -ans = 0 -for i in range(k, n): -    ans += a[i] -print(ans) +a.sort() +print((sum(a[: max(n - k, 0)])))