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()))
h = sorted(h)[::-1]
ans = 0
for i in range(k,n):
    ans += h[i]
print(ans)

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

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

Solution (Python):

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

H.sort()

ans=sum(H[:(N-K)])

if K>=N:
    ans=0

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):

import sys
input = sys.stdin.readline

n, k = [int(item) for item in input().split()]
h = [int(item) for item in input().split()]
h.sort(reverse=True)
h += [0] * (2 * 10**5)

print(sum(h[k:]))

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

Solution (Python):
import math
n,k = map(int,input().split())
als = list(map(int,input().split()))
als.sort(reverse=1)
ans = 0
for i in range(k,n):
    ans += als[i]
print(ans)

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

Solution (Python):
import math

def makelist(n, m):
    return [[0 for _ in range(m)] for _ in range(n)]





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

hoge = max(0, N - K)
ans = sum(H[:hoge])
print(ans)

Solution (Python):
import sys
input = sys.stdin.readline
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):
a , b = map(int,input().split())
l = list(map(int,input().split()))
l.sort()
if a<= b:
    print(0)
elif b == 0:
    print(sum(l))
else:
    print(sum(l[:-b]))

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

H_list.sort()
H_list.reverse()

H_list = H_list[K:]

print(sum(H_list))

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


ans = sum(H[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())
H = list(map(int, input().split()))
H.sort(reverse=True)
ans = 0
for i in range(min(N, K)):
    H[i] = 0
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(max(0,N-K)):
    ans += H[i]
print(ans)

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

Solution (Python):
n,k = [int(i) for i in input().split()]
data = [int(i) for i in input().split()]
data.sort(reverse=True)

if k>=n:
    print(0)
else:
    print(sum(data[k:]))

Solution (Python):
import sys

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

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

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

print(cnt)

Solution (Python):
n, k = map(int, input().split())
h = list(map(int, input().split()))
h = sorted(h)
if k >= n:
    print(0)
    exit()

sums = 0
for i in range(n-k):
    sums+=h[i]
print(sums)

Solution (Python):
n,k=map(int,input().split())
h=sorted(list(map(int,input().split())))
if n-k<=0:
    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()))
ans = 0
h.sort(reverse=True)
if n<=k:
    print(0)
    exit()
for i in range(k,n):
    ans += h[i]
print(ans)

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

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

Solution (Python):



def ri():
    return int(input())

def rl():
    return list(input().split())

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

def main():
    n, k = rli()
    lh = rli()
    lh.sort(reverse=True)
    ans = sum(lh[k:])
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):


iim = lambda: map(int, input().rstrip().split())

def resolve():
    N, K = iim()
    H = list(iim())
    H.sort(reverse=True)
    print(sum(H[K:]))

if __name__ == "__main__":
    resolve()

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

h = sorted(h)

left = n-k
ans = 0
if left >= 0:
	ans = sum(h[:left])
print(ans)

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

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

Hs.sort()
Hs.append(0)
print(sum(Hs[:-K-1]))

Solution (Python):
from sys import stdin
import math
n,k = [int(x) for x in stdin.readline().rstrip().split()]
li = list(map(int,stdin.readline().rstrip().split()))
li.sort()

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

n,k=MAP()
h=LIST()
h.sort()
if n-k<=0:
    print(0)
else:
    print(sum(h[: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)
print(sum(H[K:]))

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

H.sort(reverse=True)

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

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)
    exit()

for h in H[k:]:
    ans += h
print(ans)

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

Solution (Python):
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
 

def ii(): return int(sys.stdin.readline().rstrip()) 
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) 
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]

def ss(): return sys.stdin.readline().rstrip() 
def mss(): return sys.stdin.readline().rstrip()
def limss(): return list(mss()) 
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

n,k = mii()
arr = limii()
if k >= len(arr):
    print(0)
    exit()
arr.sort(reverse=True)

print(sum(arr[k:]))

Solution (Python):

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

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

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

Solution (Python):
def c_fennec_vs_monster():
    N, K = [int(i) for i in input().split()]
    H = [int(i) for i in input().split()]
    H.sort()
    for _ in range(K):
        if not H:
            break
        H.pop()
    return sum(H)

print(c_fennec_vs_monster())

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

main()

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

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

Solution (Python):
import sys
read = sys.stdin.read

n,k,*lst=map(int, read().split())
if k>=n:
  print(0)
  quit()
lst.sort(reverse=1)
s=sum(lst[k:])
print(s)

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

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

Solution (Python):

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

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

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

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

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):
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()
L = len(H)
ans = sum(H[:max(0,L-K)])
print(ans)

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

hs.sort()

while hs and k:
    hs.pop()
    k -= 1

print sum(hs)

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


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

    Hs.sort(reverse=True)
    remained = Hs[K:]

    print(sum(remained))


if __name__ == '__main__':
    main()

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):
def main():

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

if __name__ == '__main__':
    print(main())

Solution (Python):
import math
import itertools
import fractions
import heapq
import collections
import bisect
import sys
import copy

sys.setrecursionlimit(10**9)
mod = 998244353
inf = 10**20

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()

n,k = LI()
h = LI()

h.sort()
print(sum(h[:max(0,n-k)]))

Solution (Python):
import sys

n, k, *h = map(int, sys.stdin.read().split())

def main():
    h.sort(reverse=True)
    res = h[k:]
    return 0 if not res else sum(res)

if __name__ == '__main__':
    ans = main()
    print(ans)

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

Solution (Python):
n,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())
print(sum(sorted([int(a) for a in input().split()])[::-1][K:]))

Solution (Python):



from fractions import gcd
import math

from math import factorial as f

from math import ceil,floor,sqrt


import bisect
import re
import heapq


from copy import deepcopy
import itertools

from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))


def main():
    n,k = mi()
    a = li()
    a = list(reversed(sorted(a)))
    ans = 0
    for i in range(k,n):
        ans+=a[i]
    print(ans)



main()

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

H.sort(reverse=True)

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

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

h.sort(reverse=True)

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

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 = list(map(int, input().split()))

Hs = list(map(int, input().split()))
Hs.sort(reverse=True)
if K > N:
    print(0)
else:
    left = Hs[K:]
    print(sum(left))

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

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def main():
    n,k=MI()
    hh=LI()
    hh.sort()
    if k>=n:
        print(0)
        exit()
    if k==0:
        print(sum(hh))
        exit()
    print(sum(hh[:-k]))

main()

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


def read_values():
    return map(int, input().split())


def read_list():
    return list(read_values())


def read_lists(N):
    return [read_list() for n in range(N)]


def main():
    N, K = read_values()
    H = read_list()
    H.sort(reverse=True)
    print(sum(H[min(N, K):]))


if __name__ == "__main__":
    main()

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(map(int,input().split()))
h.sort()
ans = 0
for i in range(n-k):
    ans += h[i]
print(ans)

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

N, K = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
if N <= K:
    print(0)
else:
    print(sum(A[K:]))

Solution (Python):
N,K = map(int,input().split())
H = list(map(int,input().split()))
H.sort()
ans = sum(H[:max(0,N-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.sort(reverse=True)

ans = sum(H) - sum(H[:K])
print(ans)

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

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

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


if __name__ == '__main__':
    main()

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

Solution (Python):
def main():
    N, K = (int(i) for i in input().split())
    H = [int(i) for i in input().split()]
    ans = 0
    H.sort(reverse=True)
    if N <= K:
        return print(ans)
    for h in H[K:]:
        ans += h
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):

a,b = map(int,input().split())
l = list(map(int,input().split()))
l.sort()
if b >= a:
    print(0)
    exit()
ans = 0
for i in range(a-b):
    ans += l[i]

print(ans)

Solution (Python):
import sys, bisect, math, itertools, string, queue, copy


from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush

sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input()) 
def inpm(): return map(int,input().split()) 
def inpl(): return list(map(int, input().split())) 
def inpls(): return list(input().split())  
def inplm(n): return list(int(input()) for _ in range(n)) 
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return sorted([list(map(int, input().split())) for _ in range(n)]) 
def graph():
    n=inp()
    g=[[] for _ in range(n)]
    for i in range(n):
        a = inp()
        a -= 1
        g[i].append(a)
        g[a].append(i)
    return n,g

def main():
    n,k = inpm()
    a = inpl()
    a.sort()
    if n <= k:
        print(0)
        return
    ans = 0
    for i in range(n-k):
        ans += a[i]
    print(ans)    
    
if __name__ == "__main__":
    main()

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

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

l = sorted([int(i) for i in input().split()])

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

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

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()

for _ in range(min(K,len(H))):
    H.pop(-1)
    
print(sum(H))

Solution (Python):
import sys
input = sys.stdin.readline
n,k= map(int,input().split())
A = list(map(int,input().split()))

A.sort(reverse=True)

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

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

Solution (Python):
N,K = 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):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  n,k=LI()
  l=LI()

  l.sort(reverse=True)

  ans=0
  for x in l:
    if k>0:
      k-=1
    else:
      ans+=x

  return ans


print(main())

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

if len(H) <= K:
    print(0)
    exit()

H.sort(reverse=True)

print(sum(H[K:]))

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

Solution (Python):

import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

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

H.sort()
for i in range(n-k):
    count+=(H[i])
print(count)

Solution (Python):

N,K = 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):
def main():
    n, k = map(int, input().split())
    *h, = sorted(map(int, input().split()), reverse=True)
    print(sum(h[k:]))


if __name__ == '__main__':
    main()

Solution (Python):
def examA():
    H,A = LI()
    ans = (H-1)//A+1
    print(ans)
    return

def examB():
    H, N = LI()
    A = LI()
    if H>sum(A):
        print("No")
    else:
        print("Yes")
    return

def examC():
    N, K = LI()
    H = LI()
    H.sort()
    ans = sum(H[:max(0,N-K)])
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
alphabet = [chr(ord('a') + i) for i in range(26)]

if __name__ == '__main__':
    examC()

"""

"""

Solution (Python):
N,K = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
A.sort(reverse=True)
B = 0
ans = 0
for a in A:
    if B<K:
        B+=1
    else:
        ans += a

print(ans)

Solution (Python):
n,k,*h=map(int,open(0).read().split())
h=sorted(h)[::-1]
for i in range(min(k,n)):h[i]=0
print(sum(h))

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

h.sort(reverse=True)

ans = sum(h[k:])
print(ans)

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):
H, K = map(int, input().split())
H = sorted(list(map(int, input().split())), reverse = True)

print(sum(H[K:]))

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:
  su = 0
  for i in H[K:]:
    su += i
  print(su)

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

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

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

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

print(res)

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

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

Solution (Python):
import sys, math
def input():
    return sys.stdin.readline()[:-1]
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial
from fractions import gcd
e = enumerate

sys.setrecursionlimit(10**7)
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)
print(sum(H[K:]))

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

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

need = sum(h[:n - k])

print(need)

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

Solution (Python):
N, K = map(int, input().split())
*H, = map(int, 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(reverse=True)
ans = 0
for h in H:
    if K:
        K -= 1
    else:
        ans += h
print(ans)

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

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

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

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

Solution (Python):
n, k = [ int(v) for v in input().split() ]
monster = [ int(v) for v in input().split() ]
monster.sort(reverse = True)
k = min(k, n)

for i in range(k):
    monster[i] = 0
print(sum(monster))

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

Solution (Python):
def main():
    N, K = map( int, input().split())
    H = list( map( int, input().split()))
    if N <= K:
        print("0")
        return
    H.sort( reverse=True)
    print( sum( H[K:]))
if __name__ == '__main__':
    main()

Solution (Python):
n, k = map(int, input().split())
h = list(map(int, input().split()))
h.sort()
h = h[::-1]
for i in range(k):
    if i >= n:
        break
    h[i] = 0
print(sum(h))

Solution (Python):


from collections import deque, defaultdict
import itertools as ite
import sys
import math
from decimal import *

sys.setrecursionlimit(1000000)

INF = 10 ** 18
MOD = 10 ** 9 + 7

N, K = map(int, raw_input().split())
A = sorted(map(int, raw_input().split()))
ans = 0
for i in range(N - K):
    ans += A[i]
print ans

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

h = sorted(h)

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

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

if k >= n:
    print(0)
else:
    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 = sorted([int(i) for i in input().split()], reverse=True)

print(sum(H[K:]))

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())
lst1 = list(map(int,input().split()))

lst1.sort(reverse=True)

del lst1[:k]

print(sum(lst1))

Solution (Python):
import sys
input = sys.stdin.readline
N, K = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
if N <= K: print(0)
else:
  print(sum(a[: N - K]))

Solution (Python):
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  

n, k = na()
k = min(k, n)
h = na()
h.sort()
print(sum(h[0:n-k]))

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

h.sort()
h.reverse()

for i in range(min(k,n)):
    h[i] = 0
print(sum(h))

Solution (Python):
import sys

input = sys.stdin.readline


def main():
    N, K = [int(x) for x in input().split()]
    H = [int(x) for x in input().split()]
    H.sort(reverse=True)

    print(sum(H[K:]))

    
    
    

if __name__ == '__main__':
    main()

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

a = sorted(a, reverse = True)
cnt = 0
for i in range(n):
    if i < k:
        continue
    else:
        cnt += a[i]
print(cnt)

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 sys
INF = float("inf")


def solve(N: int, K: int, H: "List[int]"):
    H.sort(reverse=True)
    if N > K:
        tot = sum(H[K:])
    else:
        tot = 0
    print(tot)
    return


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):
N, K = map(int, raw_input().split())
H = map(int, raw_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()))
h.sort()
k = min(k, n)
print(sum(h[:n-k]))

Solution (Python):
import sys
from collections import defaultdict, deque
import bisect
from heapq import *
from math import factorial, ceil, floor
from collections import defaultdict
import itertools
sys.setrecursionlimit(200000)
input = sys.stdin.readline









H, N, = map(int, input().split())
L = [int(v) * -1 for v in input().split()]

L.sort()

ans = 0
for i in range(N, H):
    ans += L[i] * -1

print(ans)

Solution (Python):
import sys
import fractions
import math
MAX_INT = int(10e12)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

H, K = IL()
a = IL()
a.sort(reverse=True)
num = sum(a[K:])

print(num)

Solution (Python):



def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10 ** 6)

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


if __name__ == '__main__':
    main()

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):
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):
n,k = map(int,input().split())
h = list(map(int,input().split()))
h.sort(reverse=True)
if n<=k:print(0)
else:
    ans = 0
    for i in range(k,n):
        ans += h[i]
    print(ans)

Solution (Python):
N, 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())
arr = sorted(list(map(int, input().split())))[::-1]
if k >= n:
    print(0)
    exit()
print(sum(arr[k:]))