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):
a,c=map(int,input().split())
b=list(map(int,input().split()))
b.sort(reverse=True)
if a>c:
    print(sum(int(i) for i in b[c:]))
else:
    print(0)

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

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

h = sorted(h)

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

Solution (Python):


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




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

print(rh)

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

hissatsu = n-k

if hissatsu <= 0:
  print(0)
else:
  monsters.sort(reverse=True)
  print(sum(monsters[-hissatsu:]))

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

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

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

Solution (Python):
a, b = input().split()
c = list(map(int, input().split()))
d = int(b)
e = sorted(c,reverse=True)
ans = 0

if d >= len(e):
  print("0")
else:
  if d == 0:
    for j in e:
      ans += j
    print(str(ans))
  else:
    for i in range(d):
      e[i] = 0
    for j in e:
      ans += j
    print(str(ans))

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

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

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

Solution (Python):
import sys
input = sys.stdin.readline
N,K = [int(i) for i in input().split()]
H = [int(i) for i in input().split()]
H.sort()
ans = 0
for i in range(N - K) :
    ans += H[i]
print(ans)

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

if b >= sum(attack_list): print(0)

attack_list.sort()
if(b == 0):
    print(sum(attack_list))
else:
    print(sum(attack_list[:-b]))

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

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


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

Solution (Python):
numbers = input().split(" ")
enemy_num = int(numbers[0])
kill_num = int(numbers[1])

enemy_hp_list = input().split(" ")
for i, hp in enumerate(enemy_hp_list):
  enemy_hp_list[i] = int(hp)

enemy_hp_list.sort(reverse=True)
target = enemy_hp_list[kill_num:]
count = 0
for i in target:
  count += i
print(count)

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


lst = input().split(" ")
hps = []
for l in lst:
  hps.append(int(l))

hps.sort(reverse=True)

if len(hps) < K:
  hps = [0]
else:
  hps = hps[K:]

sum_hps = sum(hps)
print(sum_hps)

Solution (Python):
n,k=(int(i) for i in input().split())
h=[]
for i in input().split():
  h.append(int(i))
h.sort()
if k!=0:
	for i in range(min(n,k)):
 	  h.pop(-1)
print(sum(h))

Solution (Python):
n,k=(int(i) for i in input().split())
h=[]
for i in input().split():
  h.append(int(i))
h.sort()
if k!=0:
	for i in range(min(n,k)):
 	  h.pop(-1)
print(sum(h))

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

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

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

data.sort()

for _ in range(k):
  if data.__len__() > 0:
    data.pop()
  else:
    break

print(sum(data))

Solution (Python):

def sRaw():
    return input().rstrip("\r")


def iRaw():
    return int(input())


def ssRaw():
    return input().split()


def isRaw():
    return list(map(int, ssRaw()))

INF = 1 << 29

DIV = (10**9) + 7

def mod_inv_prime(a, mod=DIV):
    return pow(a, mod-2, mod)

def mod_inv(a, b):
    r = a
    w = b
    u = 1
    v = 0
    while w != 0:
        t = r//w
        r -= t*w
        r, w = w, r
        u -= t*v
        u, v = v, u
    return (u % b+b) % b


def CONV_TBL(max,mod=DIV):
    fac,finv,inv = [0]*max, [0]*max, [0]*max
    fac[0]=fac[1]=1
    finv[0]=finv[1]=1
    inv[1]=1
    for i in range(2,max):
        fac[i] = fac[i-1]*i % mod
        inv[i] = mod -inv[mod%i] * (mod//i)%mod
        finv[i] = finv[i-1]*inv[i]%mod
    class CONV:
        def __init__(self):
            pass
        def ncr(self,n,k):
            if(n<k):
                return 0
            if(n<0 or k<0 ):
                return 0
            return fac[n]*(finv[k]*finv[n-k]%mod)%mod
    return CONV()



def main():
    N,K = isRaw()
    Hs = isRaw()
    Hs.sort()
    ans = 0
    for eidx in range(0,N-K):
        ans+=Hs[eidx]
    return ans


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

Solution (Python):


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

if N <= K:
    print('0')
else:
    print(sum(list(sorted(H, reverse=True))[K:N]))

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

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random

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

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    n,m = LI()
    a = sorted(LI())
    if n <= m:
        return 0

    return sum(a[:n-m])


print(main())

Solution (Python):



N, K = [int(s) for s in input().split()]
H_list = [int(s) for s in input().split()]
H_list.sort(reverse=True)

if N < K:
    K = N

for i in range(int(K)):
    H_list[i] = 0

print(sum(H_list))

Solution (Python):


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

if n<=k:
    print(0)
else:
    h = sorted(h, reverse=True)
    ans = sum(h)
    for i in range(k):
        ans -= h[i]
    print(ans)

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

sorted_H = sorted(H)
sum = 0

for i in range(N-K):
    sum += sorted_H[i]

print(sum)

Solution (Python):
N,K=[int(thing) for thing in input().split(" ")]
H_list=[int(thing) for thing in input().split(" ")]
H_list=sorted(H_list,reverse=True)
fuckable=sum(H_list[0:K])
health_sum=sum(H_list)
need_attack=health_sum-fuckable
print(need_attack)

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

Solution (Python):
a,b = map(int,input().split(" "))
ar = list(map(int,input().split(" ")))
count = 0
if a <= b:
    print(0)
else:
    ar.sort()
    for i in range(a-b):
        count += ar[i]
    print(count)

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

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

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

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

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

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

e.sort()
if k < len(e):
    print(sum(e[0:len(e)-k]))
else:
    print(0)

Solution (Python):
import heapq

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

heapq.heapify(h)
if n-k >= 0:
    print(sum(heapq.nsmallest(n-k, h)))
else:
    print(0)

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

atackTimes = 0

monsterList.sort()
if K != 0:
    for hp in monsterList[:-K]:
        atackTimes += hp
else:
    for hp in monsterList:
        atackTimes += hp

print(atackTimes)

Solution (Python):

import sys
import math

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

l.sort(reverse=True)
if len(l)-K<=0:
  print(0)
else:  
  cnt=l[-(len(l)-K):]
  print(sum(cnt))

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

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

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

Solution (Python):
def wczytaj_liste():
    ciag = input()
    rozdzielona_lista = ciag.split()
    odp = []
    for wyraz in rozdzielona_lista:
        liczba = int(wyraz)
        odp.append(liczba)
    return odp

def C():
    N, K = wczytaj_liste()
    zycie_monsterow = wczytaj_liste()
    zycie_monsterow.sort()
    ilosc_monsterow = N-K
    if ilosc_monsterow <= 0:
        print(0)
    else:
        print(sum(zycie_monsterow[:ilosc_monsterow]))

C()

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

if N <= K:
    attack = 0
else:
    sorted_H = sorted(H, reverse=True)
    attack = sum(sorted_H[K:])
print(attack)

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

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

Solution (Python):


n,m = map(int,input().split())
da = list(map(int,input().split()))

da = sorted(da)

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

Solution (Python):
n, k = (int(x) for x in input().split())
h = (int(x) for x in input().split())
h = sorted(h, reverse=True)
cnt = 0
res = 0
for i in h:
    if cnt >= k:
        res += i
    cnt += 1
print(res)

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

Solution (Python):
S1 = list(map(int, input().split()))
S2 = list(map(int, input().split()))

H = S1[0]
K = S1[1]
S2.sort()

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

Solution (Python):
N, K = input().split()
H = input().split()
if int(K) >= int(N):
    print(0)
else:
    attack = 0
    H = list(map(int, H))
    H.sort(reverse = True)
    del H[0:int(K)]
    for x in H:
        attack += x
    print(attack)

Solution (Python):
import sys
n, k = map(int, sys.stdin.readline().split())
h = []
h.extend(sorted(map(int, sys.stdin.readline().split())))

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

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

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

ans = 0

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

print(ans)

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

N = int(N)
K = int(K)

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

Solution (Python):



def main():
    N, K = map(int, input().split())
    H = sorted([int(i) for i in input().split()], reverse=True)
    if K >= len(H):
        print(0)
    else:
        print(sum(H[K:]))


if __name__ == "__main__":
    main()

Solution (Python):
import math
import string
import itertools
import fractions
import heapq
import collections
import re
import array
import bisect
import sys
import random
import time
inf = 10**9


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

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

atk=sum(H)
print(atk)

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

Solution (Python):
import heapq

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

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

print(sum(heapq.nsmallest(n-k,h)))

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

H_list.sort(reverse=True)

ans = 0

for i in range(N):
  if K<=0:
    ans += H_list[i]
  else:
    K -= 1
    
print(ans)

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

Solution (Python):
monster_num, special_num = map(int ,input().split())
monster_list = list(map(int, input().split()))
 
monster_list = sorted(monster_list)[::-1]
 
monster_list = monster_list[special_num:]
  
print(sum(monster_list))

Solution (Python):
en_num, sp_atk_num = map(int, input().split())
en_list = sorted(list(map(int, input().split())), reverse=True)[sp_atk_num:]

if len(en_list) == 0:
	print(0)
else:
	res = 0
	for e in en_list:
		res += e
	print(res)

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

if N < K:
  print(0)
else:
  H = list(map(int, input().split()))
  H.sort()
  for _ in range(K):
    del H[-1]
  print(sum(H))

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

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

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N, K = LI()
    H = LI()
    H = sorted(H)
    while K > 0 and len(H) > 0:
        H.pop()
        K -= 1
    print(sum(H))
main()

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

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

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

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

Solution (Python):
h,n = map(int,input().split())
g = input().split()
G = sorted([int(j) for j in g])
if n != 0:
    del G[-n::]
print(sum(G))

Solution (Python):
import sys
import socket

hostname = socket.gethostname()

if hostname == 'F451C':
    sys.stdin = open('c1.in')


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


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


def main():
    N, K = read_int_list()
    H = read_int_list()
    res = 0
    if K < N:
      H0 = sorted(H, reverse=True)
      del H0[0:K]
      res = sum(H0)
    print(res)

main()

Solution (Python):
import sys
import socket

hostname = socket.gethostname()

if hostname == 'F451C':
    sys.stdin = open('c1.in')


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


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


def main():
    N, K = read_int_list()
    H = read_int_list()
    res = 0
    if K < N:
      H = sorted(H, reverse=True)
      del H[0:K]
      res = sum(H)
    print(res)

main()

Solution (Python):
import sys
import socket

hostname = socket.gethostname()

if hostname == 'F451C':
    sys.stdin = open('c1.in')


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


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


def main():
    N, K = read_int_list()
    H = read_int_list()
    res = 0
    if K < N:
      H.sort(reverse=True)
      del H[0:K]
      res = sum(H)
    print(res)

main()

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

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

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

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

Solution (Python):
line=input()
data=input()
line=line.split()
data=data.split()
num=0
if int(line[0])<=int(line[1]):
    print(0)
else:
    data=[int(s) for s in data]
    data_sorted=data.sort()
    for i in range(len(data)-int(line[1])):
        num+=data[i]
    print(num)

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

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

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

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

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

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

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

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


if __name__ == "__main__":
    main()

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

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

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

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

ans = 0
Hn.sort()
K = min(H, K)
print(sum(Hn[:H-K]))

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

H = sorted(H, reverse=True)

del H[:K]
if H:
  total = sum(H)
else:
  total = 0

print(total)

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

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

    H.sort()

    if N <= K:
        print(0)
        return

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

    print(point)


solve()

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

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

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

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

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

print(ans)

Solution (Python):
N,K = map(int,input().split())
H = list(map(int,input().split()))
H.sort(reverse=True)
attack = 0
i=0
for h in H:
    if i >= K:
        attack += h
    i += 1
print(attack)

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

Solution (Python):


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

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

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

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

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

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

if k >= n:
    print(0)
else:
    h_des = sorted(h_list,reverse=True)
    print(sum(h_des[k:]))

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

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

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

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

Solution (Python):
import numpy as np
n, k = map(int, input().split())
a_list = np.array(list(map(int, input().split())))
a_list_sorted = np.sort(a_list)[::-1]
print(a_list_sorted[k:].sum())

Solution (Python):
_, K = map(int, input().split())
print(sum(sorted(map(int, input().split()), reverse=True)[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):
tmp = input().split(" ")
N = int(tmp[0])
K = int(tmp[1])
tmp = input().split(" ")
A = [int(i) for i in tmp]
A.sort(reverse = True)
print(sum(A[K:]))

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

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

Solution (Python):
if __name__ == '__main__':
    n, k = list(map(int, input().split()))
    h = list(map(int, input().split()))
    if k == 0:
        print(sum(h))
        exit()
    h.sort()
    print(sum(h[:-k]))

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

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

h_i = input().split()
h_i = [int(N) for N in h_i]
h_i.sort()
if N < K:
    print("0")
else :
    newh_i = h_i[0:N-K]
    print(sum(newh_i))

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

h_list.sort()
print(sum(h_list[:n-k]) if n>k else 0)

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

n = int(n)
k = int(k)

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

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

Solution (Python):
def main():
  n, k = input().split(" ")
  enemies = list(map(int, input().split(" ")))
  n, k = int(n), int(k)
  count = 0

  if n > k:
    enemies.sort()
    count = sum(enemies[:n-k])
  print(count)

if __name__ == "__main__":
   main()

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:
        pass
    else:
        sum += H[i]

print(sum)

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

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

print(ans)

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

if K >= len(H):
  print(0)
elif K == 0:
  print(sum(H))
else:
  H_sort = sorted(H, reverse=True)
  print(sum(H_sort[K:]))

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

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

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

Solution (Python):
NK = input().split(' ')
N = int(NK[0])
K = int(NK[1])
H = input().split(' ')

H = [int(s) for s in H]

H.sort(reverse=True)
sum = 0
for i in range(K,N,1):
  sum += int(H[i])
  
print(sum)

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

if __name__=="__main__":
    main()

Solution (Python):

import sys


def solve(N: int, K: int, H: "List[int]"):
    H.sort()
    H.reverse()
    return sum(h for h in H[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):
arr1 = str(input())
arr = arr1.split()
n = int( arr[0] )
k = int( arr[1] )

if k >= n :
    print(0)
else:
    totalMonster1 = str( input() )
    totalMonster  = totalMonster1.split()
    tMonster = []
    for i in totalMonster:
        tMonster.append(int(i))
    tM1 = sorted(tMonster)
    tM = tM1[::-1]
    tM = tM[k:]
    
    print(sum(tM))

Solution (Python):
import numpy as np

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 = 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 = list(map(int,input().split()))
A.sort()
count = 0
for i in range(N-K):
	count += A[i]
print(count)

Solution (Python):

n, k = map(int, input().split())
monsters = sorted(list(map(int, input().split())), reverse=True)




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

Solution (Python):

import sys


def solve(N: int, K: int, H: "List[int]"):
    print(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)]  
    solve(N, K, H)

if __name__ == '__main__':
    main()

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

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

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

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

Solution (Python):
import math

EnemyCount, slayeCount = map(int, input().split())
enemyHealths = list(map(int, input().split(" ")))
enemyHealths.sort()

if EnemyCount < slayeCount:
    slayeCount = EnemyCount

for _ in range(slayeCount):
    del enemyHealths[-1]

print(sum(enemyHealths))

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

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

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

del hlis[0:k]
print(sum(hlis))

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

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

Solution (Python):
a,b = map(int,input().split())
c = list(map(int,input().split()))
if len(c) <= b:
    b = len(c) 
c.sort(reverse=True)
for i in range(0,b):
    c[i] = 0
print(sum(c))

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

print(sum(H))