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.sort()
h.reverse()
if k>n:
  k=n
for i in range (k):
  h[i] = 0
print(sum(h))

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)
print(sum(H[k:]))

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

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

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

Solution (Python):
nn, kk = list(map(int,input().split()))
hh = list(map(int,input().split()))
hh.sort()
if nn <= kk:
    print(0)
else:
    print(sum(hh[0:nn-kk]))

Solution (Python):
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 6)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")
al = "abcdefghijklmnopqrstuvwxyz"
AL = al.upper()

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

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

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

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

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

Solution (Python):
N,K=map(int,input().split())
H=sorted(map(int,input().split()))
if K==0:
    print(sum(H))
elif N<K:
    K=N
    del H[-K:]
    print(sum(H))
else:
    del 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 = 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()))
if K>=N: exit(print(0))
import heapq
H=[-i for i in H]
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()))

h.sort(reverse=True)

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

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

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

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

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

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

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

Solution (Python):
import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

from  collections import defaultdict
from collections import Counter
import bisect
from functools import reduce

def main():
    N, K = MI()
    H = LI()
    H.sort(reverse=True)
    ans = sum(H[K:])
    print(ans)


if __name__ == "__main__":
    main()

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

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

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

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

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

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

del h[:k]
print(sum(h))

Solution (Python):
num, deathblow = map(int, input().split())
enemy_table = list(map(int, input().split()))
list.sort(enemy_table, reverse=True)
sum = 0
if num <= deathblow:
    print(0)
else:
    for i in range(deathblow):
        enemy_table[i] = 0
    for j in range(num):
        sum += enemy_table[j]
    print(sum)

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

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

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

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

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())
health = list(map(int,input().split()))
s_health = sorted(health)
if n <= k:
    print(0)
    exit()

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

Solution (Python):
N,K = map(int,input().split())
H = [int(x) for x in input().split()]
H_sort = sorted(H,reverse=True)
print(sum(H_sort[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_ls = list(map(int, input().split(' ')))
H_ls.sort(reverse=True)
print(sum(H_ls[K:]))

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

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

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N,K=MI()
    h=LI()
    
    h.sort()
    
    if K>=N:
        print(0)
        exit()
        
    for i in range(K):
        h[-1-i]=0
        
    ans=sum(h)
    print(ans)

main()

Solution (Python):

N, K = map(int, input().split())
H = list(map(int, input().split()))
H = sorted(H, reverse=True)
total = 0
for i in range(K, N):
  total += H[i]
print(total)

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

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

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

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):
N, K = map(int, input().split())
H = list(map(int, input().split()))
if K >= N:
  print(0)
else:
  H = sorted(H)
  count = 0
  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()))


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

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

a = 0

if K > N:
  a = K - N

for _ in range(a):
  H.append(0)

H.sort(reverse = True)
sum = 0

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

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

list.sort()
if N>=K:
    while K>=1:
        del list[-1]
        K=K-1
else:
    list.clear()

x=0
for i in list:
    x=x+i

print(str(x))

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

h = sorted(h,reverse=True)

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

print(ans)

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

enemy.sort(reverse=True)

if k >= n :
  print(0)

else:
  

  for x in range(k):
    enemy[x] = 0
  
  print(sum(enemy))

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






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

Solution (Python):

def main():
    N, K = map(int, input().split())
    H = sorted([int(x) for x in input().split()])

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


if __name__ == '__main__':
    main()

Solution (Python):
import sys
import heapq

n, k = map(int, input().split())
h = []
heapq.heapify(h)
for x in map(int, input().split()):
  heapq.heappush(h, x)

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

ans = 0
for x in range(n - k):
  ans += heapq.heappop(h)

print(ans)

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

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

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

H.sort(reverse=True)

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

Solution (Python):
import sys

input = sys.stdin.readline


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


if __name__ == '__main__':
    main()

Solution (Python):
n,k = [int(x) for x in input().split()]
h = [int(x) for x in 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.sort(reverse=True)
print(sum(H[K:]))

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

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

import sys
from itertools import chain


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


def main():
    tokens = chain(*(line.split() for line in sys.stdin))
    N = int(next(tokens))  
    K = int(next(tokens))  
    H = [int(next(tokens)) for _ in range(N)]  
    answer = solve(N, K, H)
    print(answer)


if __name__ == "__main__":
    main()

Solution (Python):


n,k = map(int,input().split())
h = list(map(int,input().split()))
h.sort(reverse=True)
if k >= n:
    k = n
h2 = h[k:]

print(sum(h2))

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

Solution (Python):

"""
Created on Tue Sep  8 01:07:55 2020

@author: liang
"""

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

if N > K :
    ans = sum(H[:N-K])
else:
    ans = 0
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(k,n):
    ans += h[i]

print(ans)

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

print(x)

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

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

Solution (Python):

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

if __name__ == "__main__":
    main()

Solution (Python):
N,K = list(map(int, input().split(" ")))
H = sorted(list(map(int, input().split(" "))), reverse=True)
Z = 0
R = 0
for n,e in enumerate(H):
  if (n == K):
    Z = n
    break
  elif (K >= len(H)):
    Z = len(H)
    break
for i in H[Z:]:
  R += i
print(R)

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

if len(b) <= a[1]:
    print("0")
elif a[1]==0:
    print(sum(b))
else:
    b.sort(reverse=True)
    print(sum(b[a[1]:]))

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

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

if N <= K:
    print(0)
else:
    h = list(sorted(H))
    t = sum(h[0:N-K])
    print(t)

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

Solution (Python):
N, K = map(int, input().split())
A = list(map(int, input().split()))
A = sorted(A, reverse = True)
for i in range(min(K, N)):
  A[i] = 0
ans = sum(A)
print(ans)

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

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

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


    
for i in range(len(H)-K):
    SUM = SUM + H[i]


print(SUM)

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

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

    h.sort()
    ans = sum(h[:n-k])
    print(ans)

Solution (Python):
z=list(map(int,input().split()))
x=list(map(int,input().split()))
x.sort(reverse=True)
d=0
c=0
for i in x:
       if c>=z[1]:
              d+=i
       c+=1
print(d)

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

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

Solution (Python):
from sys import exit
import math
import collections
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

n,k = mi()
h = li()
h.sort()
h.reverse()
sum = 0
for i in range(k,n,1):
    sum += h[i]
print(sum)

Solution (Python):
n,k=map(int,input().split())
h=map(int,input().split())
s=0
if n <= k:
    print("0")
else:
    if k==0:
        s=sum(h)
        print(s)
    else: 
        x=sorted(h)
        for i in range (0, k):
            x.pop()
        s=sum(x)
        print(s)

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

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

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

for i in range(min(k,n)):
    H[i] = 0

print(sum(H))

Solution (Python):
n,d=list(map(int,input().split()))
s=list(map(int,input().split()))
s=sorted(s)
s.reverse()
if d>=n:
    print(0)
else:
    c=0
    s=s[d:n]
    for i in s:
        c+=int(i)
    print(c)

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

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

H_list_min = sorted(H_list)
H_list_sum = 0

for i in range(len(H_list_min)-K):
    H_list_sum += H_list_min[i]

print(H_list_sum)

Solution (Python):
import heapq
(N,K) = map(int,input().split())
h = [int(x)*-1 for x in input().split()]
ans = 0
heapq.heapify(h)
if K <= N:
    for i in range(K):
        heapq.heappop(h)

    while h != []:
        ans -= heapq.heappop(h)

print(ans)

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

Solution (Python):
import heapq
N,K = map(int,input().split())
Hlist = list(map(int,input().split()))
for i in range(len(Hlist)):
    Hlist[i] *= -1
heapq.heapify(Hlist)
for _ in range(min(K,N)):
    heapq.heappop(Hlist)
print(-sum(Hlist))

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

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

cnt = 0
H.sort(reverse=True)

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

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

if k == 0:
  print(sum(h))
  sys.exit()

for i in h[:-k]:
  ans += i
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

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


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

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


if __name__ == '__main__':
    main()

Solution (Python):


import sys

n,k=map(int,input().split())
H=list(map(int,input().split()))
H.sort()
if n>k:
    for i in range(k):
        H[n-1-i]=0
else:
    print(0)
    sys.exit()
    
sum_H=sum(H)
print(sum_H)

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

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

h.sort(reverse=True)

if len(h)<=k:
    print('0')
    sys.exit()
else:
    del h[0:k]

a=sum(h)

print(a)

Solution (Python):
a,b=input().split()
a=int(a)
b=int(b)
c=list(map(int,input().split()))
c.sort()
d=sum(c)
e=0
if a<=b:
  print(0)
else:
  for i in range(1,b+1):
    e=e+c[-i]
  print(d-e)

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

H_sort = sorted(H)



if K > N:
  print(0)
else:
  ans = sum(H_sort[0:N-K])
  print(ans)

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

q = sum(m[k:n])
print(q)

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

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

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

ans =sum(H)
print(ans)

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

    if n <= k:
        ans = 0
    else:
        ans = sum(h_list[k:])

    print(ans)


if __name__ == "__main__":
    main()

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

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

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

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

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

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

Solution (Python):
N, K=input().split()
hp=input().split()
j = sorted([int(x) for x in hp])
print(sum([j[x] for x in range(int(N) - int(K))])) if int(K) < int(N) else print(0)

Solution (Python):
n, k =map(int, input().split())
hitpoint=list(map(int,input().split()))
hitpoint.sort()
exe=[0]*k
if k!=0:
  hitpoint[-k:]=exe
  print(sum(hitpoint))
  exit(0)
else:
  print(sum(hitpoint))

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

H.sort()
remain = max(0, N-K)
H = H[:remain]

print(sum(H))

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

print(str(ans))

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

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

if N <= K:
  print(0)
  
else:
  H = list(map(int, input().split()))
  H.sort()
  H.reverse()
  
  c = 0
  for i in range(K, N):
    c += H[i]
  print(c)

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

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())
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=sorted(H,reverse=True)
sum_damage=0
for i in range(K,N):
    sum_damage+=H[i]

print(sum_damage)

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

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

Solution (Python):
import os, sys, re, math

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

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

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

Solution (Python):
teki, hissatsu = list(map(int, input().split(' ')))
l = sorted(list(map(int, input().split(' '))))[:max(0, teki-hissatsu)]
print(sum(l))

Solution (Python):
n,k = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)
b = [0]*(k-n)
a.extend(b)
print(sum(a[k:]))

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

Solution (Python):
n,k = map(int,input().split())
h = list(map(int,input().split()))
h.sort(reverse=True)
ans = 0
if(k>=n):
  ans = 0
else:
  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()))

if N <= K:
  print("0")
  exit()

ans = 0

def quicksort(a):
  if len(set(a)) < 2:
    return a
  left = []
  center = a.pop(0)
  right = []
  for i in a:
    if i > center:
      right.append(i)
    else:
      left.append(i)
  left = quicksort(left)
  right = quicksort(right)
  left.append(center)
  left.extend(right)
  return left

H = quicksort(H)

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

print(ans)

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

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

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

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

Solution (Python):

from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


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

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


def main():
    solve()


if __name__ == '__main__':
    main()

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

H.sort(reverse=True)

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

print(s)

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

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-K):
    ans+=H[K+i]
print(ans)

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

hitpoints.sort(reverse=True)
del hitpoints[:k]

ans = 0
for i in hitpoints:
    ans += i

print(ans)

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

print(sum(H[K:]))

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

I = sorted(H,reverse=True)

if len(H) <= K:
    print(0)
elif K == 0:
    print(sum(H))
else:
    for i in range(K):
        I[i] = 0
    print(sum(I))

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

Solution (Python):








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

main()

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(int, input().split()) 
h = [int(x) for x in input().split()]

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

h.sort()

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

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

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

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

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