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

n, k = map(int, input().split())
H =[int(i) for i in input().split()]

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

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

Solution (Python):
import sys

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

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

a = sorted(monster, reverse=True)

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

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

print(sum(a))

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

print(sum(Hs[K:]))

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

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

h_sort = sorted(h, reverse = True)
n = int(sum(h_sort[k : n+1]))

print(n)

Solution (Python):


from queue import Queue
from queue import LifoQueue as Stack
from math import sqrt
from fractions import gcd
from itertools import permutations, combinations

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

def intinput():
    return int(input())

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

def lineinputs(func=intinput):
    datas = []
    while True:
        try:
            datas.append(func())
        except EOFError:
            break
    return datas



N, K = mulinputs()
Hs = list(mulinputs())


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


print(sum(Hs))

Solution (Python):

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

h = [int(x) for x in input().split()]
hh = 0
for i in sorted(h,reverse=True)[k:]:
    hh = hh + i

print(hh)

Solution (Python):
N, K = map(int, input().split())
Hs = sorted(list(map(int, input().split())))
if K >= N:
  print("0")
else:
  while K > 0:
    Hs.pop()
    K -= 1
  print(sum(Hs))

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

if N <= K:
    tot = 0
else:
    H.sort(reverse = False)
    for i in range(N - K):
        tot += H[i]
        
print(tot)

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

Solution (Python):
N, K = [int(num) for num in input().split(' ')]
Hs = sorted([int(H) for H in input().split(' ')], reverse=True)

times = sum(Hs[K:]) if len(Hs)>=K else 0
print(times)

Solution (Python):
N, K = map(int,input().split())
monsters = [int(i) for i in input().split()]
monsters.sort(reverse=True)
deleted_monsters = []
for i in range(N):
    if i < K:
        deleted_monsters.append(0)
    else:
        deleted_monsters.append(monsters[i])
print(sum(deleted_monsters))

Solution (Python):



n, k = [int(x) for x in input().split()]



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



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

h = sorted(h)

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

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

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

if N <= K:
    print(0)
else: 
    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()
  a=sum(H[0:N-K])
  print(a)

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

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

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





import numpy as np

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

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

H_sorted = sorted(H, reverse=True)

if K <= N:
    del H_sorted[:K]
    print(sum(H_sorted))
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 = [int(i) for i in input().split()]
H.sort()

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

print(count)

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

Solution (Python):

n,k = map(int, input().split())
h = [int(i) for i in 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()
if K != 0:
    H = H[:-K]
print(sum(H))

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')


def solve():
    n, k = LI()
    h = LI()
    h.sort(reverse=True)
    print(sum(h[k:]))
    return



if __name__ == '__main__':
    solve()

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

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

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

h.sort()
for _ in range(k):
    h.pop()
    if not h:
        break
ans = sum(h)
print(ans)

Solution (Python):
s = input().rstrip().split(' ')
N = int(s[0])
K= int(s[1])
Hs = list(map(int, input().rstrip().split(' ')))

Hs = sorted(Hs, reverse=True)
count = 0

for h in Hs:
    if K == 0:
        count = count + h
    else:
        K = K - 1
print(count)

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

Solution (Python):


import numpy as np

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

Hn = np.array(input().split(" "), dtype=np.int)

Hn = np.sort(Hn)[::-1]

if N >= K:
    out = np.sum(Hn[K:])
else:
    out = 0

print(out)

Solution (Python):
[N,K] = [int(s) for s in input().rstrip().split(' ')] 
H = [int(s) for s in input().rstrip().split(' ')] 
S = 0 
if K >= N:
    print(0)
else:
    H_0 = sorted(H, reverse = True)
    h_0 = H_0[K:]
    print(sum(h_0))

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

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

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

Solution (Python):
line = input().rstrip().split(' ')
n = int(line[0])
k = int(line[1])

line = input().rstrip().split(' ')
h = [0] * n
for i in range(n):
    h[i] = int(line[i])

h.sort(reverse=True)
ans = 0
for i in range(k, n):
    ans += h[i]

print(ans)

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

if N <= K:
  print(0)
else:
  N = N - K
  H = H[:N]
  s = np.array(H).sum()
  print(int(s))

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


if __name__ == "__main__":
    main()

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

n = a[0]
k = a[1]

b.sort()

total = 0
for i in range(n - k - 1, -1, -1):
  total += b[i]

print(total)

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

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

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

if n < k:
    k = n

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

ans = sum(h)

print(ans)

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

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

h = sorted(map(int, input().split()))
if K > 0:
    h = h[:-K]
print(sum(h))

Solution (Python):
nk = input().split()
h_tmp  = input().split()
n=int(nk[0])
k=int(nk[1])
h = [0]*n
for i in range(n):
 h[i] = int(h_tmp[i])
h.sort(reverse=True)
print(sum(h[k:n]))

Solution (Python):
N,K=map(int, input().split())
H=list(map(int, input().split()))
for i in range(N):
    H[i]=-H[i]
import heapq as hq
hq.heapify(H)
if K>N:
    K=len(H)
for i in range(K):
    a=hq.heappop(H)

total=0
for i in range(len(H)):
    total-=H[i]
print(total)

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

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

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

answer = 0
H.sort()
ll = len(H)
k = ll - K
if k < 0:
    answer = 0
else:
    answer = sum(H[:k])

print(answer)

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

i=K

while i<len(H):
    count=count+H[i]
    i=i+1
    

print(count)

Solution (Python):

"""
Created on Sun Jan 19 20:52:57 2020

@author: over-
"""

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

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

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

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

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

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

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(reverse=True)
print(sum(H[K:]))

Solution (Python):

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

Solution (Python):
import numpy as np

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

Hs = np.sort(H)[::-1]

times = 0
for i in range(K,len(Hs)):
    times += Hs[i]

print(times)

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

Solution (Python):


import sys
import math
import time
import numpy as np
import collections
from collections import deque
import queue
import copy


def gcd(m,n):
  x = max(m,n)
  y = min(m,n)
  if x%y == 0:
    return y
  else:
    while x%y != 0:
      z = x%y
      x = y
      y = z
    else:
      return z


def bfs(SS, x, y, H, W):
  x_next = [0, 0, -1, 1]
  y_next = [1, -1, 0, 0]
  tempx = x
  tempy = y
  mlength = 0
  q = deque()
  xytuple = (x, y, 0)
  q.append(xytuple)


  while q:
    xytuple = q.popleft()
    SS[xytuple[0]][xytuple[1]] = "x" 
    for i in range(4): 
      tempx = xytuple[0] + x_next[i]
      tempy = xytuple[1] + y_next[i]
      
      
      if(0 <= tempx and tempx < H and 0 <= tempy and tempy < W and SS[tempx][tempy] == "."):
        temptuple = (tempx, tempy, xytuple[2]+1)
        SS[temptuple[0]][temptuple[1]] = "x" 
        mlength = max(mlength, xytuple[2] +1)
        q.append(temptuple)
      
  return mlength

def brick(a,n,m,N):
  
  if not m in a[n:]:
    print(N-(m-1))
  else:
    
    brick(a,a[n:].index(m),m+1,N)



HA = str(input()).split()
H = int(HA[0])
A = int(HA[1])
a = [int(x) for x in input().split()]

count = 0

if(H<A):
    print(0)
else:
    a.sort()
    for i in range(H-A):
        count += a[i]
    print(count)

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

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

H.sort(reverse = True)
if S >= N:
    S = N

print(sum(H[S:]))

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

Solution (Python):
N, K = map(int, input().split())
H_list_ = input().split()
H_list = [int(s) for s in H_list_]

sorted_H_list = sorted(H_list, reverse=True)

print(sum(sorted_H_list[K:]))

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


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

j = i

for j in range(j, n):
    kaisuu = kaisuu + h[j]

print(kaisuu)

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

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

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

H.sort()

if K >= N:
    print(0)
else:
    for _ in range(K):
        H.pop()
    print(sum(H))

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

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

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

Solution (Python):
N,K = map(int,input().split())
H = list(map(int,input().split()))
H.sort()
T = 0
for i in range(N-K):

    T += H[i]
print(T)

Solution (Python):

from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip


def main():
    n, k = map(int, input().split())
    h = [int(hi) for hi in input().split()]
    h.sort()
    for _ in range(k):
        if h:
            h.pop()

    print(sum(h))




BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")



if __name__ == "__main__":
    main()

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

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

Hs = sorted(H)

if K>=N :
  K=N

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

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

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

Solution (Python):
n,k,*h=map(int,open(0).read().split())
h.sort()
for i in range(k):
  if len(h)!=0:
    h.pop()
print(sum(h))

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

H.sort(reverse=True)

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

Solution (Python):
from math import ceil

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

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

Solution (Python):
N,K = map(int,input().split()) 
Monsters = [_ for _ in map(int,input().split())]
res = 0

Monsters.sort(reverse = True) 
res += sum(Monsters[K:N+1])
print(res)

Solution (Python):

import sys


def solve(N: int, K: int, H: "List[int]"):
    print(sum(sorted(H, reverse=True)[K:len(H)]))
    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, 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()))
if n <= k:
  print("0")
else:
  h.sort(reverse=True)
  h_new = h[k:]
  print(sum(h_new))

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

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

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

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

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

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

k = N if N <= K else K
T = A[k:]
print(sum(T))

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

H.sort(reverse=True)

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

Solution (Python):
a,b=list(map(int,input().split(' ')))
c=list(map(int,input().split(' ')))
if (b>=len(c)):
    print(0)
else:
    print(sum(sorted(c)[:len(c)-b]))

Solution (Python):
import os
import statistics
def quickSort(arr):
   
    left = []

    
    right = []

    
    
    if len(arr) <= 1:
        return arr

    
    median = int(statistics.median(arr))

    
    medianFlg = 0

    for element in arr:
        
        
        if element < median:
            left.append(element)
        
        
        elif element > median:
            right.append(element)
        else:
        
        
            medianFlg += 1

    
    

    
    
    left = quickSort(left)
    right = quickSort(right)

    
    return left + [median] * medianFlg + right

N,K=map(int,input().split())
h=map(int,input().split())
H=list(h)
M=quickSort(H)
c=0
if N-K==0:
 print(c)
else:
 for i in range(N-K):
  c+=M[i]
 print(c)

Solution (Python):
R = lambda: map(int, input().split())
n, k = R()
print(sum(sorted(R())[:n - min(k,n)]))

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

if k >= len(h):
    print("0")
    exit(0)

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

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

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

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

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

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

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

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

Solution (Python):
a,b = map(int,input().split())
N = list(map(int,input().split()))
N.sort()
for i in range(b):
    if N:
        N.pop()
print(sum(N))

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





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

print(s)

Solution (Python):
def values():
  return [int(x) for x in input().split()]

n,k=values()
h=values()
h.sort(reverse=True)
if n < k:
  print(0)
else:
  for i in range(0,k):
  	h[i]=0
  print(sum(h))

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

    if N <= K:
        print(0)
        return

    H.sort()
    H = H[: N - K]
    print(sum(H))


if __name__ == "__main__":
    main()

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

print(sum(h))

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 = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
A  =sorted(A,reverse=True)
for i in range(min(K,N)):
  A[i]=0
print(sum(A))

Solution (Python):
import sys

stdin = sys.stdin

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

n,k = nm()
h = nl()
h.sort(reverse=True)
print(sum(h[k:] + [0]))

Solution (Python):
import numpy as np

E, H = list(map(int, input().split()))
A = np.array(list(map(int, input().split())))

if H>=E:
  print("0")
else:
  A = np.sort(A)
  if H>0:
    Ans = A[:-H].sum()
  else:
    Ans = A[:].sum()
  print(Ans)

Solution (Python):
import numpy as np

if __name__ == "__main__":
  _n, _k = map(int, input().split())
  h_list = np.array([int(i) for i in input().split()])
  if _n <= _k:
    print("0")
    exit(0)

  h_list = np.sort(h_list)[::-1]
  h_list = h_list[_k:]
  sum = np.sum(h_list)
  print(sum)

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

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

Solution (Python):



import pdb
import sys
sys.setrecursionlimit(10**7)
F = sys.stdin

N,K = map(int,F.readline().split())
H_list = list(map(int,F.readline().rstrip().split()))
attack = 0

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

H_list.sort(reverse=True)

for i in range(N):
    if i >= K:
        attack += H_list[i]


print(attack)

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

H = sorted(H, reverse=True)

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

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

h = [int(h) for h in input().split()]
h.sort()  

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

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

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

ans = H_total

print(ans)

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

h1 = sorted(h,reverse=True)
del h1[:k]
print(sum(h1))

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

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

Solution (Python):

import numpy as np


DEBUG = True
dprint = print if DEBUG else lambda *x : x

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

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

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

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

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

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

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

H = sorted(H,reverse=True)

del H[:nk[1]]

import numpy as np
print(int(np.array(H).sum()))

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

Solution (Python):
N, k = [int(item) for item in input().split()]
H_list = [int(item) for item in input().split()]
H_list.sort()

if N <= k:
    print(0)
else:
    mob_num = N - k
    print(sum(H_list[:mob_num]))

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

print(sum(sorted(h, reverse=True)[k:]))

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

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

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

Solution (Python):
import math
import calendar
import fractions
import itertools

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

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

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

ls.sort()

if k == 0:
    print(sum(ls))
else:
    print(sum(ls[:(-1) * k]))

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

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

else:
    H_s = sorted(H)
    print(sum(H_s[:len(H)-K]))

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

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

Solution (Python):
import math 
n, k = map(int, input().split())
yes = 'Yes'
no = 'No'
h = list( map(int, input().split()))
h = sorted(h, reverse=True)
if len(h) <= k:
  print(0)
else:
  print(sum(h[k:]))

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

if n <=k:
    print(0)

else:
    H.sort()
    fin = sum(H[0:n-k])
    print(fin)

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

Solution (Python):
n,k = map(lambda x:int(x),input().split())
hunter_list = list(map(lambda x:int(x),input().split()))

def sum(list,k):
    s = 0
    for i in range(len(list)-k):
        s = s+ list[i]
    return s


hunter_list.sort()

print(sum(hunter_list,k))