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

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

print(mH)

Solution (Python):
from sys import stdin, setrecursionlimit


def main():
    n, k = map(int, stdin.readline().split())
    h = list(map(int, stdin.readline().split()))
    h.sort()

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


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

Solution (Python):
def main():
    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:]))
    
if __name__ == '__main__':
    main()

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


if __name__ == '__main__':
    solve()

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

h = h[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):
import sys
input = sys.stdin.readline

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

a.sort(reverse = True)
ret = 0
for i in range(k, len(a)):
    ret += a[i]
print(ret)

Solution (Python):
import sys

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

a.sort(reverse = True)
ret = 0
for i in range(k, len(a)):
    ret += a[i]
print(ret)

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

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

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

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

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

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

cnt = 0
for h in sorted_h_list:
    if k > 0:
        k-=1
        continue
    cnt+=h
print(cnt)

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

Solution (Python):
il1 = [int(k) for k in input().split()]
N = il1[0]
K = il1[1]
H = [int(k) for k in input().split()]

H.sort(reverse=True)

if len(H) <= K:
    counter = len(H)
else:
    counter = K

for k in range(counter):
    H[k] = 0

S = sum(H)

print(S)

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

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

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

Solution (Python):


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

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

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):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from itertools import permutations, accumulate
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
import sys
def I(): return int(input())  
def Is(): return map(int, input().split())  
def LI(): return list(map(int, input().split()))  
def TI(): return tuple(map(int, input().split()))  
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()  
def LS(): return list(input())  
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(1000000)
MOD = 1000000007
INF = float('inf')

n, k = Is()
H = LI()
H.sort(reverse=True)
if n > k:
    print(sum(H[k:]))
else:
    print("0")

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

H = numpy.sort(H)
sum = 0

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

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())
a=sorted(list(map(int,input().split())),reverse=True)
if k>=len(a):
    print(0)
else:
    print(sum(a[k:]))

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

Solution (Python):


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


sort_H = sorted(H_list, reverse=True)
cnt = 0

for i in range(K, len(sort_H)):
    cnt += sort_H[i]

print(cnt)

Solution (Python):
def main():
    n, k = (int(x) for x in input().split())
    if n <= k:
        print(0)
        return
    hl = [int(x) for x in input().split()]
    hl = sorted(hl, reverse=1)[k:]
    print(sum(hl))


if __name__ == "__main__":
    main()

Solution (Python):
import math

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

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

ans = 0
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)
count = 0
while (k > count) and (n > count):
    h_sort[count] = 0
    count += 1
print(sum(h_sort))

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.sort()
for i in range(k):
  try:
    h.pop(-1)
  except IndexError:
    pass
print(sum(h))

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

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

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

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

ans = 0

if (n > k):
    hx = sorted(h)[0: n - k]
    """
    hx = h.sort(reverse=True)
    for i in range(k):
        hx.pop(0)
    """
    ans += sum(hx)

print(ans)

Solution (Python):
N, K = [int(_) for _ in input().split()]
H = [int(_) for _ in input().split()]
H.sort(reverse=True)
if 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()
if len(h) <= k:
    print(0)
else:
    for _ in range(k):
        h.pop()
    print(sum(h))

Solution (Python):

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

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

H_sorted = sorted(H, reverse = True)
cnt = 0

for i in range(K) :
    if i < N :
        H_sorted[i] = 0

for j in H_sorted :
    if j == 0 :
        continue
    else :
        cnt = cnt + j

print(cnt)

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

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

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

H_list.sort(reverse=True)
H_list2 = H_list[K:]

print(sum(H_list2))

Solution (Python):
def main():
    N, K = list(map(int, input().split(' ')))
    H = list(map(int, input().split(' ')))
    H.sort()
    m = max([N - K, 0])
    print(sum(H[:m]))


if __name__ == '__main__':
    main()

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

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

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

res = 0
for h in H:
    if K > 0:
        K -= 1
    else:
        res += h

print(res)

Solution (Python):
import heapq

n, k = map(int, input().split())
h = [-1 * int(i) for i in input().split()]
heapq.heapify(h)

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

for i in range(k):
    heapq.heappop(h)

print(-1*sum(h))

Solution (Python):
N, K = map(int, input().split(' '))
H = list(map(int, input().split()))
H.sort(reverse=True)
res = 0
for i in range(K, len(H)):
  res += H[i]

print(res)

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

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

h_sorted = sorted(h, reverse=True)

for i in range(k):
    if i>n-1:
        break
    h_sorted[i] = 0

rest = sum(h_sorted)

print(rest)

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

print(solve())

Solution (Python):

"""
from sys import stdin
n = int(stdin.readline().rstrip())
data = [stdin.readline().rstrip().split() for _ in range(n)]
print(data)
print(*data, sep='\n')
"""


"""
s =input()
s=list(input())
a=int(input())
x,y = map(int,input().split())	
li = input().split()	
li = list(map(int,input().split()))	
li = input().split('T')	
"""

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

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

Solution (Python):

"""
from sys import stdin
n = int(stdin.readline().rstrip())
data = [stdin.readline().rstrip().split() for _ in range(n)]
print(data)
print(*data, sep='\n')
"""


"""
s =input()
s=list(input())
a=int(input())
x,y = map(int,input().split())	
li = input().split()	
li = list(map(int,input().split()))	
li = input().split('T')	
"""

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

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

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

H.sort(reverse=True)

ans = 0
for i in H[K:N]:
    ans += i

print(ans)

Solution (Python):
H, N = list(map(int, input().split()))
a = list(map(int, input().split()))
a.sort(reverse=True)
minus = 0 
if N >= H:
  num = H
else:
  num = N


for i in range(num):
  minus+= a[i]
print(sum(a)-minus)

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

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

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

Solution (Python):
INT_MAX=10**11+7
MOD=10**9+7
def INPUT():return list(int(i) for i in input().split())
def LIST_1D_ARRAY(n):return [0 for _ in range(n)]
def LIST_2D_ARRAY(m,n):return [[0 for _ in range(n)]for _ in range(m)]

import math as M
n,k=INPUT()
A=INPUT()
A.sort()
sum=0
for i in range(n-k):
    sum+=A[i]
print(sum)

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

Solution (Python):
N, K = list(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()))
print([0,sum(sorted(h)[0:n-k])][n>k])

Solution (Python):
n,k = map(int,input().split())
ls = list(map(int,input().split()))
ls.sort()
a = ls[::-1]
if len(a) >0:
    ans = sum(a[k:])
else:
    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):
N, K = [int(x) for x in input().split()]
H = sorted([int(x) for x in input().split()], 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)
count = 0
for i in range(K, N):
    Hi = H[i]
    count += Hi
print(count)

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

H.sort() 


if K <N:
    for i in range(1,K+1):
        H[-i] = 0
    print(sum(H))
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.sort()

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

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

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

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

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

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

print(H_sum)

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

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

if K >= N:
    print(0)
else:
    A = sorted([int(i) for i in input().split()])
    print(sum(A[:N-K]))

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

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

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

if k >= len(h):
  print(0)
else:
  h_sorted = sorted(h, reverse=True)
  print(sum(h_sorted[k:]))

Solution (Python):
import sys
import os
import math
import string
import collections

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

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


if __name__ == '__main__':
    main()

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

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

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

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

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

print(sum(H))

Solution (Python):
from collections import deque

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

d=deque(sorted(Monsters,reverse=True))

for k in range(K):
    if len(d)!=0:
        d.popleft()

print(sum(d))

Solution (Python):
n,k=[int(x) for x in input().split()]
arr=[int(x) for x in input().split()]
s=0
arr.sort()
if(n>k):
    for i in range(n-k):
        s+=arr[i]
    print(s)
else:
  print(0)

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[0:N-K]))

Solution (Python):
n,k = map(int,input().split())
a = list(map(int,input().split()))
b = sorted(a)
if n <= k:
  print(0)
else:
  c = 0
  t = 0
  while t < n-k:
    c += b[t]
    t += 1
  print(c)

Solution (Python):
import numpy as np
n, k = map(int,input().split())
h = np.array(input().split(),dtype=int)

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

Solution (Python):
import sys
n, k = map(int, sys.stdin.readline().split())
li = list(map(int, sys.stdin.readline().split()))
l = len(li)
t = 0
if l > k:
  li.sort()
  li.reverse()
  t = sum(li[k:])
print(t)

Solution (Python):

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

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

s.sort()

for i in range(min(len(s),k)):
    s.pop()

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

print(ans)

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

attack = 0

if k>=n:
  print(attack)

elif k<n:
  print(sum(hn[0:n-k]))

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

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

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

if K == 0: print(sum(H))
elif len(H) <= K: print(0)
else: print(sum(H[:-K]))

Solution (Python):
import sys

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

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

h.sort()

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

h = h[:n-k]

print(sum(h))

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

Solution (Python):
N,K=map(int,input().split())
H=map(int,input().split())
H=sorted(H,reverse=True)
H=H[K:]
if K>=N:
    print(0)
else:
    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(reverse=True)
    for i in range(K):
        H[i] = 0
        i = i + 1
    
    print(sum(H))

Solution (Python):

def inputlist(): return [int(k) for k in input().split()]

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

Solution (Python):
a, b = map(int,input().split())
c = list(map(int,input().split()))
d = []

i = a - b

d = sorted(c)

e = sum(d[:i])



if a <= b:
	print("0")
else:
  	print(e)

Solution (Python):

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



h.sort(reverse = True)

if n <= k:
    print(0)

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

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

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

Solution (Python):


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

Solution (Python):
n, k = list(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()
sum = 0
if n-k <= 0:
  print(0)
  exit()
else:
  for i in range(n-k):
    sum += h[i]
print(sum)

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

H.sort(reverse = True)
SUM = 0
for i,v in enumerate(H):
    if i >= K:
        SUM+= v
print(SUM)

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

Solution (Python):
N,K = map(int,input().split())
alist = list(map(int,input().split()))
alist.sort(reverse=True)
p = 0
for i in range(K,N):
    p = p + alist[i]
print(p)

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

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

h_list.sort()

ans = sum(h_list[0:n-k])
print(ans)

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

Solution (Python):


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

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

for i in range(K):
    H.pop(-1)

print(sum(H))

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

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

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

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

Solution (Python):
import math
import itertools

n,k=map(int,input().split())
l = list(map(int,input().split()))[:n]

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

l.sort()

if k > 0:
    print(sum(l[:-k]))
else:
    print(sum(l))

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

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

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


h=sorted(h,reverse=True)



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

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


h.sort()


if k >= len(h):
    print('0')


else:
    new_h = h[:len(h)-k]
    print(sum(new_h))

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

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

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

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

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

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

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

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

    print(sum(H_new))

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

Solution (Python):
H=[int(y) for y in input().split()]
A=[int(y) for y in input().split()]
A.sort(reverse=True)
if H[1]>len(A):
    A=[]
else:
    for x in range(H[1]):
          A[x]=0

print(sum(A))

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

h.sort()
for i in range(k):
    if len(h) == 0:
        break
    else:
        h.pop(-1)
print(sum(h))

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

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

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

def calculate(n,k,arr):
    result = 0
    arr = sorted(arr)
    for i in range(n-k):
        result = result + arr[i]

    print(result)

calculate(N,K,ARR)

Solution (Python):
def main():
    N, K = map(int, input().split())
    H = [int(h) for h in input().split()]
    H = sorted(H, reverse=True)
    if len(H) <= K:
        print(0)
    else:
        print(sum(H[K:]))
if __name__ == "__main__":
    main()

Solution (Python):
import numpy as np
N, K = map(int, input().split())
H_list = np.array(list(map(int, input().split())))

if K >= N:
    print(0)
else:
    H_list_sorted = np.sort(H_list)
    print(sum(H_list_sorted[:N-K]))

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

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

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

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

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

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

ans = 0
for n, i in enumerate(list_h):
    if k > 0:
        k = k - 1
        list_h[n] = 0
    else:
        break

ans = ans + sum(list_h)
print(ans)

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

    for i in range(k):
        if i >= len(monsters):
            break
        monsters[i] = 0
    print(sum(monsters))

if __name__ == '__main__':
    main2()

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

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

Solution (Python):
stdin = open(0).read().split('\n')
N, K = map(int,stdin[0].split())
A = list(map(int,stdin[1].split()))
B = sorted(A)
ans = 0
for i in range(max(0,N-K)):
    ans += B[i]
print(ans)

Solution (Python):
n,k,*h=map(int,open(0).read().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()))
if len(h)<=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()))

h.sort()

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

Solution (Python):

import sys


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



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)]  
    print(solve(N, K, H))

if __name__ == '__main__':
    main()

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

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

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

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

Solution (Python):

n,k = map(int,input().split())
tairyoku = list(map(int,input().split()))
tairyoku.sort(reverse=True)

if k == 0:
    print(sum(tairyoku))
    
else:
    del tairyoku[:k]
    print(sum(tairyoku))

Solution (Python):
N, K = map(int, input().split())
H = [int(x) for x in 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:
    print(0)
    exit()
else:
    for i in range(k):
        h.pop(-1)
print(sum(h))

Solution (Python):
def Main(N, K, H):
    H.sort()
    if N <= K:
        return 0
    else:
        return sum(H[:N-K])

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

if __name__ == '__main__':
    main()