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())
h = list(map(int, input().split()))
print(sum(sorted(h, reverse=True)[K:]))

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

H.sort(reverse=True)

k_count = 0
for h in H:
    if k_count < K:
        k_count += 1
    else:
        break
print(sum(H[k_count:]))

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

ans = 0
while n > k:
  ans += H[k]
  k += 1
else:
  print(ans)

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

H_S = sorted(H)

res = 0
for i in range(max(0, N-K)):
    res = res + H_S[i]
print(res)

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

Solution (Python):
N,K = list(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 = 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 = [h[i] for i in range(n-k)]
    print(sum(l))

Solution (Python):
num = list(map(int,input().split()))
num_list = list(map(int,input().split()))

num_list.sort()
sum = 0

if num[1] >= num[0]:
  ans = 0
elif num[1] < num[0]:
  for i in range(0,num[0]-num[1]):
    sum = sum + num_list[i]
    
  ans = sum

print(ans)

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

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

if n > k:
    del h[:k]
    print(sum(h))
else:
    print(0)

Solution (Python):
import math
from fractions import gcd

import numpy as np
import scipy as scp


n,k = map(int,input().split())
arrH = np.array(input().split(),dtype=np.int64)

arrH.sort()

ans = sum(arrH[::-1][k:])

print(ans)

Solution (Python):
[N,K] = list(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())
ans=0
if N<=K:
  pass
else:
  A=list(map(int,input().split()))
  A.sort()
  ans=sum(A[:N-K])
print(ans)

Solution (Python):
N,K=map(int,input().split())
H=input().split()
h=[]
for i in range(len(H)):
    a=int(H[i])
    h.append(a)
h.sort(reverse=True)
if K>=N:
  print(0)
else:
  print(sum(h[K:]))

Solution (Python):
hp, n = map(int, input().split())
li = [int(i) for i in input().split()]
li.sort(reverse=True)
if len(li) < n:
  print(0)
  exit()
for i in range(n):
  li[i] = 0
print(sum(li))

Solution (Python):

import sys
sys.setrecursionlimit(12345678)
import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop


def main():
    n, k = map(int, input().split())
    hl = list(map(int, input().split()))
    hl.sort()
    rest = max(0, n-k)
    hl = hl[:rest]
    print(sum(hl))
    return


if __name__ == '__main__':
    main()

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):
n,k = (map(int, input().split()))
h = sorted(map(int, input().split()))
ans = sum(h[:max((n - k),0)])
print(ans)

Solution (Python):
class Culuculation():
  N = 0
  K = 0
  H = []
  
  
  def __init__(self):
    self.N, self.K = ( int(x) for x in input().split(' '))
    self.H = [int(x) for x in input().split(' ')]

  
  def culc(self):
    self.H.sort(reverse=True)
    if self.N >= self.K:
      del self.H[0:self.K]
    else:
      self.H.clear()
    print(sum(self.H))

def main():
  tmp = Culuculation()
  tmp.culc()

if __name__=='__main__':
  main()

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

list.sort(H, reverse=True)

if N >= K:
  del H[0:K]
else:
  H.clear()

print(sum(H))

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

monsters.sort()

total_hp = 0
if(len(monsters) > k):
    for i in range(n-k):
        total_hp += monsters[i]
        
    print(total_hp)
else: print(0)

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

Solution (Python):
N,K,*H=map(int,open(0).read().split())
print(sum(sorted(H)[:N-min(N,K)]))

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 7)
read = sys.stdin.buffer.read 
input = sys.stdin.buffer.readline
def inputS(): return input().rstrip().decode()
readlines = sys.stdin.buffer.readlines 

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

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

Solution (Python):

import sys


def solve(N: int, K: int, H: "List[int]"):
    H = sorted(H, reverse=True)[K:]

    print(sum(H))



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    K = int(next(tokens))  
    H = [int(next(tokens)) for _ in range(N)]  
    solve(N, K, H)

if __name__ == '__main__':
    main()

Solution (Python):

import sys
n, k = map(int, sys.stdin.readline().split())
H = list(map(int, sys.stdin.readline().split()))
H.sort(reverse = True)


print(sum(H[k:]))

Solution (Python):
n,k=map(int,input().split())
h=sorted(list(map(int,input().split())))
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()))

if n <= k:
    print(0)
else:
    print(sum(sorted(h,reverse=True)[k:]))

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

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

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

Solution (Python):
n,k=map(int,input().split())
h=sorted(list(map(int,input().split())))
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 = sorted(list(map(int,input().split())))
print(sum(H[:max(N-K,0)]))

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

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

Solution (Python):
n,k=map(int,input().split())
h=list(map(int,input().split()))
h.sort()
h=h[::-1]
k=min(n,k)
ans=0
for i,x in enumerate(h):
  if i>=k:
    ans+=x
print(ans)

Solution (Python):

N, K = map(int, input().strip().split(' '))
N_list = list(map(int, input().strip().split(' ')))
sorted_N = sorted(N_list, reverse=True)


del sorted_N[:K]

if sorted_N ==[]:
  print(0)
else:
  print(sum(sorted_N))

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

Solution (Python):
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n, k = list(map(int, readline().split()))
    h = list(map(int, readline().split()))
    h.sort(reverse=True)
    print(sum(h[k:n]))


if __name__ == '__main__':
    solve()

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

H.sort()

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

print(ans)

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

print(sum(h[:n - k]))

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

count = 0
ans = 0
for i in sorted(h, reverse = True):
  if count < k:
    count += 1
    continue
  ans += i
print(ans)

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

h.sort(reverse = True)

ans = 0
for i in range(n):
    if i < k:
        continue
    ans += h[i] 

print(ans)

Solution (Python):

monsterCount, specialAttacks = map(int, input().split())
monsters = sorted(list(map(int, input().split())), reverse=True)



if len(monsters) <= specialAttacks:
    print(0)
else:
    EntireMonsters = sum(monsters)
    destroyed = sum(monsters[:specialAttacks])
    print(EntireMonsters - destroyed)

Solution (Python):

monsterCount, specialAttacks = map(int, input().split())
monsters = sorted(list(map(int, input().split())), reverse=True)



if len(monsters) <= specialAttacks:
    print(0)
else:
    EntireMonsters = sum(monsters)
    destroyed = sum(monsters[:specialAttacks])
    print(EntireMonsters - destroyed)

Solution (Python):
from collections import deque

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

D = deque(H)

for _ in range(K):
    if N == 0:
        break
    D.pop()
    N -= 1

print(sum(D))

Solution (Python):
H,K=map(int,input().split())
A=list(map(int,input().split()))
B=sorted(A)
if len(B)<=K:
	print(0)
else:
	for i in range(1,K+1):
		B[-i]=0
	print(sum(B))

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()
if n-k <= 0:
    print(0)
    exit()
else:
    ans = sum(H[:n-k])
print(ans)

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

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

Solution (Python):



from math import *
from copy import *
from string import *                
from random import *                
from sys import stdin
from sys import maxsize
from operator import *                
from itertools import *
from collections import Counter        
from collections import defaultdict 

'''

'''

def solve(l,k):
	n = len(l)
	l = sorted(l)
	if(k != 0):
		l = l[:-k]
	
	ans = sum(l)
	return ans
	

N,K = map(int, stdin.readline().rstrip().split())
l = list(map(int, stdin.readline().rstrip().split()))
ans = solve(l,K)
print(ans)

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

Solution (Python):
n, k = map(int, input().split())
h = [int(i) for i in input().split(" ")]
h = sorted(h)
print(sum(h[:n-min(n,k)]))

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

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

Solution (Python):
NK = list(map(int, input().split()))
Hi = list(map(int, input().split()))

N = NK[0]
K = NK[1]
Hi.sort()
reversed_Hi = list(reversed(Hi))

for i in range(len(reversed_Hi)):
    if not reversed_Hi:
        break

    if K == 0:
        break
    else:
        K -= 1
        reversed_Hi[i] = 0

count = 0
for i in reversed_Hi:
    count += i

print(count)

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

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

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


main()

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

if n <= k:
  print(0)
else:
  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()))
if k>=n:
    print(0)
    exit()
h = sorted(h,reverse=True)
f = h[k:]
print(sum(f))

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

H.sort(reverse=True)

if K >= len(H):
    print(0)
    exit()
for i in range(K):
    H[i] = 0

ans = sum(H)

print(ans)

Solution (Python):
kazu1 = list(map(int, input().split()))
kazu2 = list(map(int, input().split()))
n = 0
kazu2.sort(reverse=True)

kazu2[:kazu1[1]] = [0]

n += sum(kazu2)

print(n)

Solution (Python):
import math

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

h.sort(reverse=True)

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

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

h.sort(reverse=True)

h = h[k:]

print(sum(h))

Solution (Python):


a = [int(s) for s in input().split()]
b = [int(s) for s in input().split()]

c = sorted(b)

d = c[:-a[1]] if a[1] != 0 else c

ans = sum(d)

print(ans)

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

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

H.sort()
count = 0
try:
    for _ in range(K):
        H.pop()
        count += 1

except:
    pass

ans = sum(H)
print(ans)

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

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

sort_H=sorted(H)

for i in range(K):
    if(sort_H==[]):
        print('0')
        sys.exit()
    sort_H.pop()


print(sum(sort_H))

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N,K,*H = map(int,read().split())
N -= K
if N <= 0:
    print(0)
    exit()
    
H.sort()
    
print(sum(H[: N]))

Solution (Python):
N, K = list(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 = map(int,input().split())
H = list(map(int,input().split()))

H.sort()

if K>=N:
  print(0)
else:
  h = H[:N-K]
  ans = 0
  for i in h:
    ans += i
  print(ans)

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

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

h = sorted(h)
sum_of_k = 0
if k >= n:
    print(0)
    exit()
for i in range(k):
    sum_of_k += h[len(h)-i-1]
ans = sum(h)-sum_of_k
print(ans if ans >=0 else 0)

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

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

A.sort(reverse=True)

print(sum(A[K:]))

Solution (Python):
import sys
input = sys.stdin.buffer.readline
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getlist():
    return list(map(int, input().split()))
import math
import heapq
from collections import defaultdict, Counter, deque
MOD = 10**9 + 7
INF = 10**15


def main():
    n, k = getlist()
    nums = getlist()
    nums.sort()
    if n <= k:
        print(0)
        return
    if k == 0:
        print(sum(nums))
        return
    print(sum(nums[:-k]))

if __name__ == '__main__':
    main()

"""
9999
3

2916
"""

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

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

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

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

lisH.sort()
lisH = lisH[::-1]

lisH = lisH[K:]

if len(lisH) == 0:
    print(0)
else:
    print(sum(lisH))

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

for i in range(k):
	if i <= (n-1):
		h[i] = 0
	else:
		break
	

print(sum(h))

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

for i in range(k,n):
	sum1+=ans[i]

print(sum1)

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

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

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

a = list(map(int,input().split()))
a.sort(reverse=True)
cnt = 0
for i in range(N):
    if K > 0:
        K -= 1
    else:
        cnt += a[i]

print(cnt)

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

H_list.sort()

if K >= len(H_list):
  print(0)
  
else:
  for i in range(K):
    H_list[-i - 1] = 0

  print(sum(H_list))

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

h2=sorted(h)

if n<=k:
    ans=0
else:
    ans=sum(h2[0:n-k:1])
print(ans)

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

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

Solution (Python):
import math

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

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

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

hs.sort()

print(sum(hs[:len(hs)-k]))

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


new_h = sorted(h,reverse=True)


ans = 0
for i in range(n):
    if i <= k-1:
        ans += 0
    else:
        ans += new_h[i]

print(ans)

Solution (Python):
import sys
n,k = map(int,input().split())
a = list(map(int,sys.stdin.readline().split()))
a.sort(reverse=True)
ans = 0
for i in range(n):
  if i >= k:
    ans += a[i]
print(ans)

Solution (Python):

l = list(map(int, input().split()))
h = list(map(int, input().split()))
h.sort(reverse=True)
if l[1]>=l[0]:
    print(0)
else:
    for i in range(l[1]):
        h[i]=0
    print(sum(h))

Solution (Python):
attack = 0
monster, critical = map(int, input().split())
monster_life = list(map(int, input().split()))
monster_life.sort()
for i in range(monster - critical):
    attack = attack + monster_life[i]
print(attack)

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

ans = 0
del H[0:K]
for i in H:
    ans += i
print(ans)

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

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

print(ans)

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 = sorted(h, reverse=True)
if k >= len(H):
    print(0)
if k<len(H):
    del H[:k]
    print(sum(H))

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

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

Solution (Python):
n, k = map(int, input().split())
teki_list = [i for i in map(int, input().split())]


teki_list.sort()

if k != 0:
    
    if k <= len(teki_list):
        del teki_list[-k:]
    else:
        del teki_list[:]

print(sum(teki_list))

Solution (Python):
n,k = 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):
n,k = map(int, input().split())
h = list(map(int, input().split()))

h = sorted(h, reverse = True)

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

a = 0
for i in h:
  a += i
print(a)

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

res = 0
for a in A[k:] :
    res += a

print(res)

Solution (Python):
N, K = [int(x) for x in input().strip().split()]
H = sorted([int(x) for x in input().strip().split()])
print(sum(H[:max(0, N-K)]))

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

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

Solution (Python):
N,K = list(map(int,input().split()))
A = list(map(int,input().split()))
B = sorted(A)
if N <= K:
    print(0)
else:
    for i in range(K):
        B.pop(-1)

    print(sum(B))

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

Solution (Python):
n, k = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]

h = sorted(h)
h[-1:-k-1:-1] = [0,] * min(n, k)

print(sum(h))

Solution (Python):
import heapq

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

h = list(map(lambda x:-x,h))

if n<=k:
    print("0")
else:
    heapq.heapify(h)
    for i in range(k):
        heapq.heappop(h)
    print(-sum(h))

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

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

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

Solution (Python):
feneck = input().split()
H = input().split()
H_i = [int(h) for h in H]

N = int(feneck[0])
K = int(feneck[1])

list.sort(H_i, reverse=True)

if K < len(H_i):
  sum = 0
  H_i = H_i[K:]
  for hp in H_i:
    hp = int(hp)
    sum += hp
  print(sum)
else:
  print(0)

Solution (Python):
line1 = input()
line2 = input()
n, k = line1.split(" ")
h = line2.split(" ")
h = [int(i) for i in h]
h.sort()
if int(k) >= int(n):
    print(0)
else:
    for i in range(int(k)):
        h.pop(-1)
    print(sum(h))

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

H.sort()
if K > 0:
    print(sum(H[:-K]))
else:
    print(sum(H))

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

print(sum(h[k:]))

Solution (Python):
n,k=map(int,input().split())
arr=list(map(int,input().split()))
arr=sorted(arr,reverse=True)
for i in range(min(n,k)):
  arr[i]=0
print(sum(arr))

Solution (Python):
h, n = list(map(int,(input().split())))
a = list(map(int,(input().split())))
import sys
sys.setrecursionlimit(10 ** 9) 

a.sort(reverse=True)

if h >= n and n !=0 :
  a = a[n:]
  ans = sum(a)
elif n ==0:
  ans = sum(a)
else:
  ans = 0
  
print(ans)

Solution (Python):
N, K = list(map(int, input().split(' ')))
H_list = list(map(int, input().split(' ')))
H_list.sort()
count = 0
for i in range(N - K):
    count += H_list[i]
print(count)

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

h = sorted(h, reverse=True)
del h[0:k]

attack_total = sum(h)

print(attack_total)

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

mon = list(map(int,input().split()))
mon.sort()
    
count = 0

if N > K:
  for i in range(N-K):
    count += mon[i]
else:
  pass
    

print(count)

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

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

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

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


print(sum(h[min(k,n):]))

Solution (Python):
from fractions import gcd


import heapq
import math
from collections import defaultdict, Counter, deque
from bisect import *
import itertools
import fractions
import sys
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7



def lcm(a, b):
    return a * b / fractions.gcd(a, b)


def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    
    return divisors


def factorize(n):
    fct = []  
    b, e = 2, 0  
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


def is_prime(n):
    if n == 1:
        return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True


def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

def modpow(a, n, mod):
    res = 1
    while n > 0:
        if n & 1:
            res = res * a % mod
        a = a * a % mod
        n >>= 1
    return res


def modinv(a, mod):
    return modpow(a, mod - 2, mod)


def cnk(a, b):
    MOD = 10**9+7
    ret = 1
    for i in range(b):
        ret *= (a-i)
        ret %= MOD
        ret = ret * modinv(i+1, MOD) % MOD
    return ret


class UnionFind:
    def __init__(self, n):
        self.sz = [-1 for i in range(n)]

    
    def find(self, x):
        if self.sz[x] < 0:
            return x
        else:
            self.sz[x] = self.find(self.sz[x])
            return self.sz[x]

    
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return False
        if self.sz[x] > self.sz[y]:
            x, y = y, x
        self.sz[x] += self.sz[y]
        self.sz[y] = x

    
    def same(self, x, y):
        return self.find(x) == self.find(y)

    
    def size(self, x):
        return -self.sz[self.find(x)]


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




            


    




    


if __name__ == '__main__':
    main()

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

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

Solution (Python):
x = [int(i) for i in input().split(" ")]
s = x[1]
m = [int(i) for i in input().split(" ")]
if s == 0:
  print(sum(m))
else:
  m = sorted(m)[0:-s:1]
  print(sum(m))

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

list.sort(h, reverse=True)
if k > len(h):
    print(0)
else:
    re_en = h[k:]
    print(sum(re_en))

Solution (Python):
x=input().split()
n=int(x[0])
k=int(x[1])
x=input().split()
h=[]
for i in range(len(x)):
  h.append(int(x[i]))
h=sorted(h)
if k<=n:
  print(sum(h[0:n-k]))
else:
  print(0)

Solution (Python):
def get(text,n):
    ans = [""]*n
    i = 0
    for x in text:
        if x==" ":
            i = i + 1
        ans[i] = ans[i]+x
    return ans

nk = input()
N = int(get(nk,2)[0])
K = int(get(nk,2)[1])

H = get(input(),N)
for i in range(N):
    H[i]= int(H[i])

H.sort()

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

print(s)

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

print(sum(h))

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

h=sorted(h,reverse=True)

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

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

Solution (Python):
n,k=map(int,input().split())
h=[int(i) for i in input().split()]
h.sort()
a=0
if n>k:
  for j in range(n-k):
    a+=h[j]
  print(a)
else:
  print(0)

Solution (Python):
import sys
import math
import itertools as it
def i():return int(sys.stdin.readline().replace("\n",""))
def i2():return map(int,sys.stdin.readline().replace("\n","").split())
def s():return str(sys.stdin.readline().replace("\n",""))
def l():return list(sys.stdin.readline().replace("\n",""))
def intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def lx():return list(map(lambda x:int(x)*-1,sys.stdin.readline().replace("\n","").split()))
def t():return tuple(map(int,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":pass
n, k = i2()
h = intl()
h.sort()
cnt = 0
if n > k:
    for i in range(n-k):
        cnt += h[i]
    print(cnt)
else:
    print(0)

Solution (Python):
import sys
import math
import itertools as it
def i():return int(sys.stdin.readline().replace("\n",""))
def i2():return map(int,sys.stdin.readline().replace("\n","").split())
def s():return str(sys.stdin.readline().replace("\n",""))
def l():return list(sys.stdin.readline().replace("\n",""))
def intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def lx():return list(map(lambda x:int(x)*-1,sys.stdin.readline().replace("\n","").split()))
def t():return tuple(map(int,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":pass
n, k = i2()
h = intl()
h.sort()
if n > k:
    print(sum(h[:n-k]))
else:
    print(0)