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

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

H = sorted(H)[::-1]

del H [0:K]

print((str(sum(H))))
N,K = list(map(int,input().split()))

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

H = sorted(H)[::-1]

H = H[K:N]

print((str(sum(H))))
N, K = list(map(int, input().split()))
H = list(map(int, input().split()))
H = sorted(H)[::-1]
del H[0:K]
print((str(sum(H))))

N, K = list(map(int, input().split()))
H = list(map(int, input().split()))
H = sorted(H)[::-1]
H = H[K:N]
print((str(sum(H))))

-del H[0:K] +H = H[K:N]