Problem:
 Score : 300 points    Problem Statement Fennec is fighting with N monsters.  The health of the i -th monster is H_i .  Fennec can do the following two actions:   Attack: Fennec chooses one monster. That monster's health will decrease by 1 .  Special Move: Fennec chooses one monster. That monster's health will become 0 .   There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.      Constraints  1 \leq N \leq 2 \times 10^5  0 \leq K \leq 2 \times 10^5  1 \leq H_i \leq 10^9  All values in input are integers.         Input Input is given from Standard Input in the following format:  N  K  H_1  ...  H_N       Output Print the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning.        Sample Input 1 3 1
4 1 5      Sample Output 1 5  By using Special Move on the third monster, and doing Attack four times on the first monster and once on the second monster, Fennec can win with five Attacks.       Sample Input 2 8 9
7 9 3 2 3 8 4 6      Sample Output 2 0  She can use Special Move on all the monsters.       Sample Input 3 3 0
1000000000 1000000000 1000000000      Sample Output 3 3000000000  Watch out for overflow.

Solution (Python):
N,K = map(int,input().split()) 
A = list(map(int,input().split()))
B = sorted(A)
if N <= K:
    print(0)
else:
  print(sum(B[0:N-K]))

Solution (Python):
n,k=map(int,input().split())
lists=list(map(int,input().split()))
lists=sorted(lists)
if len(lists)<=k:
    print(0)
elif len(lists)>k:
    sub=lists[:len(lists)-k]
    print(sum(sub))

Solution (Python):
N,K = map(int,input().split())
H = list(map(int,input().split()))
H.sort(reverse=True)
l = len(H)
if K >= l:
    print (0)
else:
    print(sum(H[K:]))

Solution (Python):
N,K = map(int, input().split())
l = list(map(int, input().split()))

ld = sorted(l, reverse=True)

print(sum(ld[K:]))

Solution (Python):
N,K = map(int,input().split())
Hl = sorted(list(map(int,input().split())))

ans = sum(Hl[:-K]) if K!=0 else sum(Hl)
print(ans)

Solution (Python):
N,K=map(int,input().split())
H=list(map(int,input().split()))

H.sort(reverse=True)

if K>=len(H)+1:
    print(0)
else:
    print(sum(H[K:]))

Solution (Python):
import numpy as np

N, K = map(int, input().split())
H = list(map(int, input().split()))
H = np.array(H)
H = np.sort(H)[::-1]

H[:K] = 0

print(np.sum(H))

Solution (Python):
N,K=map(int,input().split())
H=list(map(int,input().split()))

E=sorted(H,reverse=True)

answer=0

if N<=K:
    print(0)
else:
    for i in range(N-K):
        answer+=E[K+i]
    print(answer)

Solution (Python):
n,k = list(map(int, input().split()))
h = list(map(int, input().split()))

h_sort = sorted(h)

if k>=len(h):
  print(0)
else:
  teki = len(h) - k
  
  h_teki = h_sort[:teki]
  print(sum(h_teki))

Solution (Python):
N,K=map(int, input().split()) 
H=list(map(int, input().split())) 

H.sort(reverse=True)

A = H[K:]
print(sum(A))

Solution (Python):
n, k = list(map(int, input().split()))
h = list(map(int, input().split()))
new = sorted(h)
sum = 0
for i in range(n-k):
  sum = sum + new[i]
print(sum)

Solution (Python):
N, K = map(int, input().split())
H = list(map(int, input().split()))
if len(H) <= K:
    print(0)
else:
    H = sorted(H, reverse=True)[K:]
    print(sum(H))

Solution (Python):
n, k = map(int,input().split())
h = list(map(int, input().split()))
h.sort(reverse=True)
del h[0:k]
print(sum(h))

Solution (Python):
N, K = map(int, input().split())
H_list = list(map(int, input().split()))

H_list_sort = sorted(H_list)


if (N - K) <= 0:
  print(0)
else:
  print(sum(H_list_sort[0:N - K]))

Solution (Python):
N, K = map(int, input().split())
H = list(map(int, input().split()))

if N > K:
    H.sort(reverse = True)
    ans = 0
    for i in range(K, N):
        ans += H[i]
    print(ans)
else:
    print("0")

Solution (Python):
n,k = list(map(int,input().split()))
h = list(map(int,input().split()))

h.sort()


total = 0

if k >= n:
    print(0)
    exit()


for i in range(n-k):
    total += h[i]

print(total)

Solution (Python):
n,k=map(int,input().split())
h=list(map(int,input().split()))
h.sort()
for i in range(k):
    if len(h)>0:
        h.pop()
print(sum(h))

Solution (Python):
first = input().split(' ')
skills_count = int(first[1])

second = input().split(' ')
healths = [int(s) for s in second]
healths.sort(reverse=True)

print(sum(healths[skills_count:]))

Solution (Python):
def read_int_n():
    return list(map(int, input().split()))
hn=read_int_n()
n=hn[0]
k=hn[1]
h=read_int_n()
H=sorted(h,reverse=True)
print(sum(H[k:]))

Solution (Python):
N,K = map(int,input().split())
H = list(map(int,input().split()))

H.sort(reverse = True)

print(sum(H[K:]))

Solution (Python):
N, K = map(int, input().split())
H = list(map(int, input().split()))
size=len(H)
if N<=K:
  ret=0
else: 
  H.sort()
  ret=max(0, sum(H)-sum(H[size-K:]))

print( ret )

Solution (Python):
n, k = map(int, input().split())
h = list(map(int, input().split()))
c = 0
h.sort(reverse=True)

del h[0:k]

print(sum(h))

Solution (Python):
N, K = map(int, input().split())
H = sorted(list(map(int, input().split())))
H.reverse()
if N <= K:
    print(0)
else:
    for i in range(K):
        H[i] = 0
    print(sum(H))

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

Solution (Python):
N, K = map(int, input().split())
H = sorted([int(x) for x in input().split()])[::-1]
if K >= len(H):
    print('0')
else:
    print(sum(H[K:]))

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

Solution (Python):
N,K = map(int,input().split())
Hlist = list(map(int,input().split()))
Hlist.sort()
if K>=N:
    print(0)
else:
    for i in range(K):
        Hlist.pop()
    print(sum(Hlist))

Solution (Python):
N, K = map(int, input().split())
H = list(map(int, input().split()))

H.sort(reverse=True)


print(sum(H[K:]))

Solution (Python):
n,k = map(int, input().split())
h = sorted(map(int, input().split()))

t = min(n, k)
ans = sum(h[0:(n-t)])
print(ans)

Solution (Python):
H,N=map(int,input().split())
A=list(map(int,input().split()))

Max=sum(A)
A.sort(reverse=True)
min=sum(A[:N])
print(Max-min)

Solution (Python):
n, k = map(int, input().split())
h = list(map(int, input().split()))

h.sort()
print(sum(h[:n-k]) if n >= k else 0)

Solution (Python):
N, K = map(int, input().split())
H = list(map(int, input().split()))
H = sorted(H)
if K < len(H):
    print(sum(H[0:len(H)-K]))
else:
    print(0)

Solution (Python):
N,K=map(int,input().split())
H=list(map(int,input().split()))
H=sorted(H)
for i in range(N-1,-1,-1):
  if K>0:
    H[i]=0
    K-=1
  else:
    break
print(sum(H))

Solution (Python):
import math

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

if N <= K:
  print(0)
elif K == 0:
  print(sum(H))
else:
  H.sort()
  h = H[:-K]
  print(sum(h))

Solution (Python):
N, K = map(int, input().split())
A = list(map(int, input().split()))

if K >= N:
  print(0)
else:
  A.sort()
  A = A[::-1]
  answer = sum(A[K:])
  print(answer)

Solution (Python):

class Solution:
    def solve(self, H, k, monsters):
        monsters.sort(reverse=True)

        return sum(monsters[k:])


sol = Solution()

[H, k] = list(map(int, input().strip().split()))
monsters = list(map(int, input().strip().split()))

print(sol.solve(H, k, monsters))

Solution (Python):
n, k = list(map(int, input().split()))
h = list(map(int, input().split()))

h.sort(reverse=True)
for i in range(k):
    if i >= n:
        break
    h[i]=0
hsum = sum(h)
print(hsum)

Solution (Python):
N,K = map(int, input().split())
H = list(map(int, input().split()))

H.sort(reverse=True)

K = min(K, len(H))
HH = H[K:]

print(sum(HH))

Solution (Python):
N,K=map(int,input().split())

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

H.sort(reverse=True)

if K>=len(H):
    print(0)
else:
    tmp=H[K:]
    print(sum(tmp))

Solution (Python):
n, k = map(int, input().split())
h = sorted(list(map(int, input().split())))

if k == 0:
    print(sum(h))
else:
    print(sum(h[:-k]))

Solution (Python):
n, k = map(int, input().split())
hList = sorted(list(map(int, input().split())))

if n <= k:
  print(0)
  exit()

cutList = hList[:n-k]
print(sum(cutList))

Solution (Python):
import sys
input = sys.stdin.readline


def main():
    n, k = map(int, input().split())

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

    h.sort()
    if k == 0:
        print(sum(h))
    else:
        print(sum(h[:-k]))


main()

Solution (Python):
n,k=map(int,input().split())
h=list(map(int,input().split()))
h.sort()
if k==0:
    pass
else:
    h=h[:-k]
print(sum(h))

Solution (Python):
N, K = map(int, input().split())
H = list(map(int, input().split()))
print(sum(sorted(H, reverse=True)[K:]))

Solution (Python):
N, K = (int(nk) for nk in input().split())
H = [int(h) for h in input().split()]

H = sorted(H, reverse=True)[K:]

print(sum(H))

Solution (Python):
n, k = map(int, input().split())
h = list(map(int, input().split()))

h.sort()
ans = 0

for i in range(n-k):
    ans += h[i]

print(ans)

Solution (Python):
def main():
    N,K = map(int, input().split())
    H = list(map(int, input().split()))
    H = sorted(H, reverse=True)
    if(len(H) < K):
        res = 0
    else:
        res = sum(H[K:])
    print(res)

if __name__ == "__main__":
    main()

Solution (Python):
import sys
 
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
 
 
H,A=map(int,input().split())

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

li=sorted(l)

for _ in range(min(H,A)):
	li.pop()
	
print(sum(li))

Solution (Python):
a,b = map(int,input().split())
l = sorted(list(map(int, input().split())),reverse=True)

if a<=b:
  print(0)
else:
  print(sum(l[b:]))

Solution (Python):

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

if n - k <= 0:
    print(0)
else:
    h.sort()
    cnt = sum(h[:n-k])
    print(cnt)

Solution (Python):
n, k = map(int, input().split())
h = list(map(int, input().split()))

h.sort()
if len(h) <= k:
    print(0)
else:
    print(sum(h[:(n - k)]))

Solution (Python):
import math

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

H.sort(reverse=True)

print(sum(H[K::]))

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from bisect import bisect_right, bisect_left
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from copy import deepcopy
from math import factorial, ceil, floor, gamma, log
from operator import mul
from functools import reduce


sys.setrecursionlimit(2147483647)
INF = float('INF')
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 10 ** 9 + 7


n, k = LI()
H = sorted(LI())
if k >= n:
    print(0)
else:
    print(sum(H[:n - k]))

Solution (Python):


N, K = list(map(int, input().split()))
h_list = list(map(int, input().split()))
h_list = sorted(h_list, reverse=True)

if K >= N:
    ans = 0
else:
    ans = sum(h_list[K:])

print(ans)

Solution (Python):
n, k = map(int, input().split())
h = sorted(list(map(int, input().split())), reverse=True)
print(sum(h[k:]))

Solution (Python):
N,K=map(int, input().split())
LH=list(map(int, input().split()))
sumH=sum(LH)
count=0
LH.sort()
LH.reverse()

sumH-=sum(LH[0:K])
count+=sumH
print(count)

Solution (Python):
n, k = map(int, input().split())
h = sorted(list(map(int, input().split())), reverse=True)

if len(h) <= k:
    print(0)
    exit(0)

print(sum(h[k:]))

Solution (Python):
def main():
    n, k = map(int, input().split())
    h_list = list(map(int, input().split()))
    h_list.sort()

    for i in range(k):
        h_list.pop()
        if not h_list:
            print(0)
            return
    ans = sum(h_list)
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
N, K = map(int, input().split())
M = list(map(int, input().split()))
SM = sorted(M, reverse=True)


SkillKill = len(SM[:K])

remain = N - SkillKill
if remain > 0:
  print(sum(SM[K:]))
else:
  print(0)

Solution (Python):
N,K = map(int,input().split())
H = list(map(int,input().split()))

if N <= K:
    print(0)
else:
    H.sort()
    if K == 0:
        print(sum(H))
    else:
        print(sum(H[:-K]))

Solution (Python):
d = input().split(" ")
n = int(d[0])
k = int(d[1])
h = input().split(" ")
for i in range(n):
	h[i] = int(h[i])
if k >= n:
	print(0)
else:
	s = 0
	h.sort()
	for i in range(n-k):
		s += h[i]
	print(s)

Solution (Python):
N,K=map(int,input().split())
H=list(map(int,input().split()))
H.sort()
ans=0
if K>N:
  print(0)
else:
  for i in range(N-K):
    ans+=H[i]
  print(ans)

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

Solution (Python):
n, k = map(int, input().split())
h = list(map(int, input().split()))
a = sorted(h)
if n <= k:
    print(0)
else:
    b = a[:n-k]
    print(sum(b))

Solution (Python):
n, k = map(int, input().split())
h = list(map(int, input().split()))

count = 0
h.sort(reverse=True)

for i in range(k, n, 1):
    count += h[i]

print(count)

Solution (Python):
data = list(map(int, input().split()))
lst = sorted(list(map(int, input().split())), reverse=True)

N = data[0]
K = data[1]

if N <= K:
  a = 0
else:
  a = sum(lst[K:])

print(a)

Solution (Python):
a,b=map(int,input().split())
monster=list(map(int,input().split()))
monster.sort()

while b>0 and len(monster)>0:
    monster.pop()
    b-=1
print (sum(monster))

Solution (Python):
n, k = list(map(int, input().split()))
h = list(map(int, input().split()))
h.sort(reverse=True)

atack_num = 0
for hp in h:
    if k > 0:
        k -= 1
    else:
        atack_num += hp

print(atack_num)

Solution (Python):
H, K = map(int, input().split())

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

mylist = sorted(mylist, reverse=True)

print(sum(mylist[K:]))

Solution (Python):
N, K = map(int, input().split())
H = list(map(int, input().split()))
H = sorted(H, reverse=True)
if K >= N:
  print(0)
else:
  print(sum(H[K:]))

Solution (Python):
N,K = map(int,input().split())
H = sorted(list(map(int,input().split())),reverse=True)
ans = sum(H[K:])
print(ans)

Solution (Python):
N,K = map(int, input().split())
li = list(map(int, input().split()))

new = sorted(li, reverse=True)

count = 0

for i in new:
  if K > 0:
    K -= 1
  else:
    count += i

print(count)

Solution (Python):
N,K = map(int,input().split())
H = list(map(int,input().split()))

H = sorted(H)
sum = 0
for i in range(N-K):
    sum += H[i]

print(sum)

Solution (Python):
n,k=map(int,input().split())
h=list(map(int,input().split()))
if n<=k:
    print(0)
else:
    h.sort()
    print(sum(h[0:(n-k)]))

Solution (Python):
N,K=map(int,input().split())
H=list(map(int,input().split()))

if K >= N:
    print('0')
else:
    H.sort(reverse=True)
    H=H[K:]

    ans = sum(H)
    print(ans)

Solution (Python):
N, K = map(int, input().split())
H = map(int, input().split())
H = sorted(H)
if K == 0:
  print(sum(H))
else:
  print(sum(H[:-K]))

Solution (Python):

n, k = [int(i) for i in input().split()]
t=[int(i) for i in input().split()]
t = sorted(t)
a = 0
for i in range(n-k):
	a+=t[i]
print(a)

Solution (Python):
n, k = map(int, input().split())
 
h = list(map(int, input().split()))
sum = 0
h.sort()

if n <= k:
  print(0)
else:
   for i in range(0, k):
    h[n-i-1] = 0
  
   for i in range(0, n):
    sum += h[i]
   
   print(sum)

Solution (Python):
n, k = map(int, input().split())
h = list(map(int, input().split()))

if k == 0:
	print(sum(h))
else:
	print(sum(sorted(h)[:-k]))

Solution (Python):
N, K = map(int, input().split())
H = list(map(int, input().split()))

if N <= K:
    print(0)
else:
    H.sort()
    ans = sum(H[: N - K])
    print(ans)

Solution (Python):


import sys

N, K = [int(x) for x in input().split()]

H = [int(x) for x in input().split()]

H.sort()

if K >= N:
	print(0)
	sys.exit()

del H[len(H) - K :]

print(sum(H))

Solution (Python):
n, k = map(int, input().split(' '))
H = sorted(map(int, input().split(' ')))

if len(H) <= k:
    print(0)
else:
    print(sum(H[0:n - k]))

Solution (Python):
import heapq

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

print(sum(heapq.nsmallest(max(0, N - K), H)))

Solution (Python):
n, k = map(int, input().split())
h = sorted(list(map(int, input().split())), reverse=True)
print(sum(h[k:n]))

Solution (Python):
n, k = map(int, input().split())
h = list(map(int, input().split()))

h.sort(reverse=True)
sum = 0
if len(h) <= k:
    print(0)
else:
    for item in h[k:]:
        sum += item
    print(sum)

Solution (Python):
N, K = map(int, input().split())
H = list(map(int, input().split()))

H.sort(reverse = True)

if N < K:
  print(0)
else:
  print(sum(H[K:]))

Solution (Python):
n,k=map(int,input().split())
H=sorted(list(map(int,input().split())))
print(sum(H[:n-k]) if k<n else 0)

Solution (Python):

n,k=(int(x) for x in input().split())
h=list(map(int,input().split()))
h.sort()
count=0
for i in range(len(h)-k):
    count+=h[i]
print(count)

Solution (Python):
def acinput():
    return list(map(int, input().split(" ")))

N,K=acinput()
H=sorted(acinput(),reverse=True)

res=0
for i in range(N):
    if i>=K:
        res+=H[i]

print(res)

Solution (Python):
import heapq

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

ans = 0
heapq.heapify(H)
for _ in range(N - K):
    ans += heapq.heappop(H)

print(ans)

Solution (Python):


import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        
        
        lines.append(input())
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]


    (n, k) = [int(e) for e in lines[0].split(' ')]
    h = [int(e) for e in lines[1].split(' ')]

    return (n, k, h)


def solve(n, k, h):

    h.sort(reverse=True)
    
    remained = h[k:]

    return sum(remained)


def main():
    
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()

Solution (Python):
N, K = map(int, input().split())
H_i = list(map(int, input().split()))

H_i.sort(reverse = True)

sum = 0

for i in range(K, N):
    sum += H_i[i]

print(sum)

Solution (Python):


[N, K] = [int(i) for i in input().split()]
H = [int(i) for i in input().split()]


sorted_H = sorted(H, reverse=True)


new_H = sorted_H[K:]

print(sum(new_H))

Solution (Python):
N, K = map(int, input().split())
H = list(map(int, input().split()))
sH = sorted(H, reverse=True)
sH = sH[K:]
print(sum(sH))

Solution (Python):
n, k = map(int,input().split())
li = list(map(int,input().split()))
li.sort()
for i in range(k):
    if li != []:
        li.pop()
print(sum(li))

Solution (Python):
n, k = list(map(int, input().split()))
hs = list(map(int, input().split()))

hs.sort(reverse = True)
print(sum(hs[k:]))

Solution (Python):
N, K = map(int, input().split())
K = min(N, K)
H =list(map(lambda x: - int(x), input().split()))

import heapq
heapq.heapify(H)
for i in range(K):
  heapq.heappop(H)
ans = 0
for i in range(N - K):
  ans += - heapq.heappop(H)
print(ans)

Solution (Python):
N,K = map(int, input().split())
H = list(map(int, input().split()))

H.sort(reverse=True)

K = min(K, len(H))
HH = H[K:]

print(sum(HH))

Solution (Python):
import sys

N, K = map(int, sys.stdin.readline().split())
H =list(map(int, sys.stdin.readline().split()))

sH = sorted(H, reverse = True)

sum = 0
if K > N:
    print(0)
else:
    for i in range(K, N):
        sum += sH[i]
    print(sum)

Solution (Python):
N, K = map(int, input().split())
H = list(map(int, input().split()))

ans = 0

if len(H) <= K:
    print(0)
else:
    H.sort(reverse=True)
    for i in range(K):
        H[i] = 0
    
    print(sum(H))

Solution (Python):
N, K = map(int, input().split())
H = [int(x) for x in input().split()]

H.sort(reverse = True)
H = sum(H[K:])
print(H)

Solution (Python):
n, k = map(int, input().split())
h = list(map(int , input().split()))
h.sort(reverse=True)

print(sum(h[k:]))

Solution (Python):
N,K = map(int,input().split())
H = list(map(int,input().split()))
if N <= K:
    print(0)
else:
    H.sort()
    L = N - K
    cnt = 0
    for i in range(L):
        cnt += H[i]
    print(cnt)

Solution (Python):
H, K = 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)

Solution (Python):
n, k = map(int, input().split())

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

h.sort(reverse=True)

if len(h) >= k:
    ans = sum(h[k:])
else:
    ans = 0

print(ans)

Solution (Python):
N,K = list(map(int, input().split()))
H = list(map(int, input().split()))

H.sort(reverse=True)

if len(H) <= K:
    print('0')
else:
    del H[:K]
    print(sum(H))

Solution (Python):



test = ""

"""
3 1
4 1 5
ans 5
"""

"""
8 9
7 9 3 2 3 8 4 6
ans 0
"""

"""
3 0
1000000000 1000000000 1000000000
ans 3000000000
"""

test = list(reversed(test.strip().splitlines()))
if test:
    def input2():
        return test.pop()
else:
    def input2():
        return input()


n, k = map(int, input2().split())
h = list(map(int, input2().split()))

sorth = sorted(h)

for i in range(min(n, k)):
    sorth.pop()

print(sum(sorth))

Solution (Python):
n, k  = map(int, input().split())
h = sorted(map(int, input().split()))

if k >= len(h):
    k = len(h)
for _ in range(k):
    h.pop(-1)

answer = sum(h)
print(answer)

Solution (Python):


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

if N <= K:
    print(0)
    exit()
H.sort(reverse=True)
for i in range(K):
    H[i] = 0

print(sum(H))

Solution (Python):
n, k = map(int, input().split())
h = list(map(int, input().split()))

h.sort(reverse = True)

if k > n:
  k = n

for i in range(k):
  h[i] = 0

ans = 0
for i in range(n):
  ans += h[i]
  
print(ans)

Solution (Python):
n, k = map(int, input().split())
h = list(map(int, input().split()))

h.sort()
if k != 0:
  h=h[:-k]

print(sum(h))

Solution (Python):
N, K = map(int, input().split())
H = list(map(int, input().split()))
H.sort(reverse=True)
print(sum(H[K:]))

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

Solution (Python):
N, K = map(int, input().split())
H = map(int, input().split())

if K >= N:
    print(0)
else:
    H = sorted(H, reverse=True)
    rest_H = sum(H[K:])
    print(rest_H)

Solution (Python):
N,K=map(int,input().split())
H=[int(i) for i in input().split()]
s=sorted(H)[::-1]
ans=s[K:]
print(sum(ans))

Solution (Python):
N, K = map(int, input().split())
H = list(map(int, input().split()))
H.sort()

if N <= K:
    ans = 0
else:
    num = N - K
    ans = sum(H[:num])

print(ans)

Solution (Python):
f = lambda:map(int,input().split())
n, k = f()
l = sorted(list(f()))
print(sum(l[:n-k]) if n>k else 0)

Solution (Python):
n, k = map(int, input().split())
h = list(map(int, input().split()))
h = sorted(h, reverse=True)
ans = 0

for i in h:
    if k > 0:
        k -= 1
    else:
        ans += i

print(ans)

Solution (Python):
n, k = map(int, input().split())
h_list = list(map(int, input().split()))
h_list.sort(reverse=True)
if k >= len(h_list):
  res = 0
else:
  use_k = k-1
  res = sum(h_list[k:])
print(res)

Solution (Python):
N,K = list(map(int,input().split()))
H = list(map(int,input().split()))
H.sort()
if N >= K:
    print(sum(H[:N - K]))
else:
    print(0)

Solution (Python):
n, k = list(map(int, input().split()))
h = list(map(int, input().split()))
h.sort(reverse=True)
if(len(h) <= k):
  print(0)
else:
  print(sum(h[k:]))

Solution (Python):
import numpy as np
def resolve():
    n, k = map(int, input().split())
    h = list(map(int, input().split()))
    h = np.sort(h)[::-1]
    total = 0
    for i in range(n):
        if i < k:
            continue
        else:
            total += h[i]
    print(total)
resolve()

Solution (Python):
N, K = map(int, input().split())
H = list(map(int,input().split()))

H.sort()

if K == 0:
    ans = sum(H)
else:
    ans = sum(H[:(-1 * K)])
    
print(ans)

Solution (Python):
def quick_sort(list):
    stand=list[0]
    over=[]
    same=[]
    under=[]
    for i in list:
        if(i>stand):
            over.append(i)
        elif(i<stand):
            under.append(i)
        else:
            same.append(i)
    if(len(over)>1):
        over=quick_sort(over)
    else:
        pass
    if(len(under)>1):
        under=quick_sort(under)
    else:
        pass

    return over+same+under

N,K=map(int,input().split())
H=list(map(int,input().split()))
H=quick_sort(H)
if(N<=K):
    print(0)
else:
    print(sum(H[K:N]))

Solution (Python):
def solve(N, K, healths):
  healths_sorted = sorted(healths, reverse=True)
  print(sum(healths_sorted[K:]))


def iln(): return list(map(int, input().split()))


N, K = iln()
healths = iln()
solve(N, K, healths)

Solution (Python):
N, K = map(int, input().split())
H = tuple(sorted(map(int, input().split()), reverse=True))

print(sum(H[min(N,K):]))

Solution (Python):
import sys
n,k = map(int, input().split())
hlist = list(map(int, input().split()))
hlist.sort(reverse=True)
total = 0
if k >= n:
    print(0)
    sys.exit()
else:
    for i in range(k,n):
       total += hlist[i]
    print(total)

Solution (Python):
N, Hissatsu = map(int, input().split())
HP = list(map(int, input().split()))
HP.sort()
count = max(N-Hissatsu, 0)

if (count > 0):
    count = sum(HP[:count])

print(count)

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

len_h = len(H)
if K >= len_h:
  print(0)
else:
  H.sort(reverse = True)
  H = H[K:]
  print(sum(H))

Solution (Python):
n = input()    
m = n.split()
p = [int(i) for i in m] 
n = input()    
m = n.split()
q = [int(i) for i in m] 
q.sort(reverse=True)
A = 0
for i, value in enumerate(q):
    if i < p[1]:
        pass
    else:
        A = A + value
print(A)

Solution (Python):
import math

h,k = map(int,input().split(" "))
h=[int(i) for i in input().split(" ")]

h.sort(reverse=True)

print(sum(h[k:]))

Solution (Python):
n,k = map(int,input().split())
h_list = list(map(int,input().split()))

h_list.sort(reverse=True)

print(sum(h_list[k:n+1]))

Solution (Python):
N, K = map(int, input().split())
H = list(map(int, input().split()))

H.sort()
print(sum(H[0:max(0, N - K)]))

Solution (Python):
n,k = map(int,input().split())
h = list(map(int,input().split()))

if n <= k:
  print(0)
else:
  h.sort()
  ans = 0
  for i in range(n-k):
    ans += h[i]
  print(ans)

Solution (Python):
N,K = map(int,input().split())
h = list(map(int,input().split()))
H = sorted(h)
a = 0
for i in range(0,N-K):
    a = a + H[i]
print(a)

Solution (Python):
N, K = [int(i) for i in input().split()]
Hs = [int(i) for i in input().split()]
Hs.sort(reverse=True)
print(sum(Hs[K:]))

Solution (Python):
N,K=map(int,input().split())
H=list(map(int,input().split()))
H.sort(reverse=True)
ans = 0
if K < N:
  ans = sum(H[K:])
print(ans)

Solution (Python):
a,b=map(int,input().split())
l=list(map(int,input().split()))
l.sort()
c=0
for i in range(a-b):
    c+=l[i]
print(c)

Solution (Python):
import math 

def main():
    N, K = list(map(int, input().split()))
    H = list(map(int, input().split()))

    H.sort(reverse=True)
    H = H[K:]

    count = 0
    for h in H:
        count += h
    
    print(count)

if __name__ == "__main__":
    main()

Solution (Python):
n,k=map(int,input().split())
h=list(map(int,input().split()))
if k>=n:
    ans=0
else:
    h.sort(reverse=True)
    for i in range(k):
        h[i]=0
    ans=sum(h)

print(ans)

Solution (Python):
N, K = map(int,input().split())
H = sorted(list(map(int,input().split())))
    
if K >= N:
    print(0)
else:
    print(sum(H[:(N-K)]))

Solution (Python):
s=list(map(int,input().split()))
t=list(map(int,input().split()))
t.sort(reverse=True)
a=s[1]
b=0
if s[0]<=s[1]:
  print(0)
else:
  for i in range(s[1],s[0]):
    b+=t[i]
  print(b)

Solution (Python):

N,K = map(int,input().split())
H = list(map(int, input().split()))
ans = 0
H.sort(reverse=True)

for i in range(K,N):
    ans += H[i]

print(ans)

Solution (Python):
from functools import reduce


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


H.sort()
if N <= K: ans = 0
else: ans = reduce(lambda x, y: x+y, H[0:N-K])


print(ans)

Solution (Python):
N, K = map(int, input().split())
H = list(map(int, input().split()))
H.sort()
print(sum(H[:-K]) if K != 0 else sum(H))

Solution (Python):
n, k = [int(i) for i in input().split()]
tmp = sum(sorted([int(i) for i in input().split()])[:n-k])
if k >= n:
    print(0)
else:
    print(tmp)

Solution (Python):
def main():
    n, k = map(int, input().split(" "))
    monster = [int(s) for s in input().split(" ")]
    monster.sort(reverse=True)
    attack = 0
    for i in range(k, n):
        attack += monster[i]
    print(attack)


if __name__ == '__main__':
    main()

Solution (Python):
n,k= map(int, input().split())
h = list(map(int,input().split()))
h = sorted(h,reverse = True)
print(sum(h[k:]))

Solution (Python):
N, K = map(int,input().split())
H = list(map(int,input().split()))
         
H.sort(reverse=True)

print(sum(H[K:]))

Solution (Python):
import numpy as np
N, K = (int(i) for i in input().split())  
H = [int(i) for i in input().split()]

if K >= N:
  print(0)
else:
  print(sum(sorted(H)[:N-K]))

Solution (Python):
n,k = map(int,input().split())
h = list(map(int,input().split()))
h = sorted(h,reverse=True)

if len(h) < k:
    print(0)
else:
    total = sum(h[k:])
    print(total)

Solution (Python):
a, b = map(int, input().split())
l = [int(x) for x in input().split()]

l.sort()
i = a - 1

for x in range(b):
    l[i] = 0
    i -= 1

    if i < 0:
        break

print(sum(l))

Solution (Python):
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N, K = lr()
H = lr()
H.sort(reverse=True)
answer = sum(H[K:])
print(answer)

Solution (Python):

N,K=map(int,input().split())
H=[int(a) for a in input().split()]
H.sort(reverse=True)

K=min(N,K)
tmp=H[K:]

print(sum(tmp))

Solution (Python):
n, k = map(int, input().split())
h = sorted(list(map(int, input().split())))

if n <= k:
  print(0)
else:
  print(sum(h[0:n-k]))

Solution (Python):




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


h.sort()
h.reverse()

if k >= n:
    ans = 0
else:
    sum = 0
    for i in range(k, n):
        sum = sum + h[i]
    
    ans = sum


print(ans)

Solution (Python):
def main():
    n, k = [int(x) for x in input().split()]
    hps = [int(x) for x in input().split()]

    ct = 0

    hps = sorted(hps)
    hps.reverse()

    if len(hps) <= k:
        print(0)
        return

    hps = hps[k:]

    remain = sum(hps)

    print(remain)




if __name__ == "__main__":
    main()