Problem:
 Score : 300 points    Problem Statement Fennec is fighting with N monsters.  The health of the i -th monster is H_i .  Fennec can do the following two actions:   Attack: Fennec chooses one monster. That monster's health will decrease by 1 .  Special Move: Fennec chooses one monster. That monster's health will become 0 .   There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.      Constraints  1 \leq N \leq 2 \times 10^5  0 \leq K \leq 2 \times 10^5  1 \leq H_i \leq 10^9  All values in input are integers.         Input Input is given from Standard Input in the following format:  N  K  H_1  ...  H_N       Output Print the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning.        Sample Input 1 3 1
4 1 5      Sample Output 1 5  By using Special Move on the third monster, and doing Attack four times on the first monster and once on the second monster, Fennec can win with five Attacks.       Sample Input 2 8 9
7 9 3 2 3 8 4 6      Sample Output 2 0  She can use Special Move on all the monsters.       Sample Input 3 3 0
1000000000 1000000000 1000000000      Sample Output 3 3000000000  Watch out for overflow.

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

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

Solution (Python):

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

Solution (Python):

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

Solution (Python):

import sys
N, K = map(int, input().split())
H = sorted(list(map(int, input().split())), reverse=True)
l = len(H)
if K != 0:
    if len(H) <= K:
        print(0)
    else:
        print(sum(H[K:]))
else:
    print(sum(H))

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

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

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

h = sorted(h)

if k > len(h):
    print(0)
else:
    if k != 0:
        del h[-k:]
    print(sum(h))

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

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

if n <= k:
    print(0)
else:
    hh = sorted(h,reverse=True)
    del hh[0:k]
    print(sum(hh))

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

H.sort(reverse=True)



print(sum(H[K:]))

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

Solution (Python):
import sys
input = sys.stdin.readline
N, K = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
for _ in range(min(K, N)): a.pop()
print(sum(a))

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

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

n, k = na()
h = na()
for i in range(n):
    h[i] *= -1
heapq.heapify(h)
for i in range(min(len(h), k)):
    heapq.heappop(h)
print(-1 * sum(h))

Solution (Python):



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

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


hp_list.sort()


for i in range(k):
    hp_list.pop()

sum_hp = 0
for hp in hp_list:
    sum_hp += hp

print(sum_hp)

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

list = sorted(listh,reverse = True)
list1 = list[:k]

print(sum(listh)-sum(list1))

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

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

print(ans)

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

H.sort()
ans=0
for i in range(0,max(0,N-K)):
    ans+=H[i]
print(ans)

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

h=sorted(list(map(int,input().split())))
for _ in range(k):
    h.pop()
print(sum(h))

Solution (Python):








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

    if K>=N:
        print(0)
    else:
        cnt=0


        H=H[K:]

        cnt+=sum(H)

        print(cnt)


resolve()

Solution (Python):

def main():
    
    h,k = map(int, input().split())

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

    h_list.sort(reverse=True)
    ans = 0
    for i in range(len(h_list)):
        if k > 0:
            k -= 1
        else:
            ans += h_list[i]

    print(ans)


if __name__ == '__main__':
    main()

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

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

Solution (Python):

import sys
sys.setrecursionlimit(10000000)
INF = 1<<32


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

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

Solution (Python):
n,k = map(int, input().split())
h = list(map(int, input().split()))
if k >= n:
    print(0)
    exit()
q = 0
y = sorted(h, reverse=True)
for a in range(n-k):
    q += y[k+a]

print(q)

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

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

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

Solution (Python):
h, 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())
hlist = list(map(int,input().split()))

hlist.sort(reverse=True)

if n<k:
    k = n
for i in range(0,k):
    hlist[i] = 0

print(sum(hlist))

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

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

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

print(sum(H))

Solution (Python):
list = input().split(" ")
N = int(list[0])
K = int(list[1])
list_hp = input().split(" ")
list_hp = [int(i) for i in list_hp]
list_hp = sorted(list_hp)

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

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

enamy1 = sorted(enamy, reverse=True)
if len(enamy) <= k:
  print(0)
else:
  del enamy1[0:k]
  print(sum(enamy1))

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

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

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

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

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

H.sort()

sum = 0

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

Solution (Python):
from collections import deque 
num, K = map(int, input().split())
monster = list(map(int, input().split()))
monster.sort(reverse=True)
ans = deque(monster)
for i in range(K):
  if len(ans)==0:
    print(0)
    exit()
  ans.popleft()
  
print(sum(ans))

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

for i in range(K):
  del li[-1]
  if len(li) < 1:
    print(0)
    exit()

print(sum(li))

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

Solution (Python):


def submit():
    n, k = map(int, input().split())
    hlist = list(map(int, input().split()))

    if k >= n:
        print(0)
        return

    if k == 0:
        print(sum(hlist))
        return

    hlist.sort()
    print(sum(hlist[:-k]))


if __name__ == "__main__":
    submit()

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):
H,N = map(int,input().split())
A = list(map(int,input().split()))
A.sort(reverse = True)
cnt = 0

if H <= N:
    A.clear()
else:
    for i in range(N):
        A[cnt]= 0
        cnt += 1
        
print(sum(A))

Solution (Python):


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

    Hs.sort(reverse=True)

    ans = 0
    for h in Hs:
        if K > 0:
            K -= 1
            continue
        ans += h
    print(ans)


if __name__ == "__main__":
    solve()

Solution (Python):
import numpy as np
from collections import Counter


def mode(list):
    c = Counter(list)
    freq_scores = c.most_common()
    max_count = freq_scores[0][1]
    modes = []
    for num in freq_scores:
        if num[1] == max_count:
            modes.append(num[0])
    return(modes)

n, k = map(int, input().split())
h_list = list(map(int, input().split()))
h_list.sort()
h_list.reverse()
del h_list[0:k]
print(sum(h_list))

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

if k>n:
  k=n
  
for i in range (k):
  l[i]=0

c+=sum(l)

print(c)

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

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

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

Solution (Python):
n, k = map(int, input().split())
h = list(map(int, input().split()))
h.sort()
use_sp = min(k, len(h))
for _ in range(use_sp): h.pop()
print(sum(h))

Solution (Python):
from math import ceil

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

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

Solution (Python):
from sys import stdin
import math

n, k = [int(x) for x in stdin.readline().rstrip().split()]
h = [int(x) for x in stdin.readline().rstrip().split()]

list.sort(h, reverse=True)

cnt = 0
for i in h:
    if k > 0:
        k -= 1
        continue
    cnt += i

print(cnt)

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

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

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

Solution (Python):
n,k = map(int, input().split())
a = sorted(list(map(int, input().split())))
res = 0
if k >= n:
  print(0)
else:
  a = a[:n-k]
  for i in a:
    res += i
  print(res)

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

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

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

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




if __name__ == "__main__":
    main()

Solution (Python):
import math
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:]))

Solution (Python):

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


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

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

Solution (Python):
import sys 

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

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

q_lis = H[0:len(H)-K]

print(sum(q_lis))

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

Solution (Python):
def solve():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    A.sort(reverse=True)
    ans = 0
    for i, a in enumerate(A):
        if i < K: continue
        ans += a
    return ans

print(solve())

Solution (Python):
def solve():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    A.sort()
    A = reversed(A)
    ans = 0
    for i, a in enumerate(A):
        if i < K: continue
        ans += a
    return ans

print(solve())

Solution (Python):
def solve():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    A.sort()
    if K >= N:
        return 0
    if K == 0:
        return sum(A)
    l = A[:-K]
    return sum(l)

print(solve())

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

b.sort()
x=a[1]
y=a[0]
if x>=y:
	print(0)
else:
	z=y-x
	b=b[0:z]
	print(sum(b))

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

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

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

monsters.sort(reverse=True)
for i in range(K) :
    if (i < len(monsters)) :
        monsters[i] = 0

print(sum(monsters))

Solution (Python):
N,K=(int(x) for x in input().split())
a=list(int(y) for y in input().split())
b=sorted(a)
if N<=K:
    print('0')
else:
    print(sum(b[0:N-K]))

Solution (Python):
N,K=(int(x) for x in input().split())
a=list(int(y) for y in input().split())
b=sorted(a)
if K<N:
    print(sum(b[0:N-K]))
else:
    print(0)

Solution (Python):
nk = [int(s) for s in input().split()]
n = nk[0]
k = nk[1]

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

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

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

print(ans)

Solution (Python):
N,K=map(int,input().split())
H=list(map(int,input().split()))
if K >= len(H):
    print(0)
    exit()
need = max(len(H) - K,0)
H.sort()
ans=0
for n in range(need):
    ans += H[n]
print(ans)

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

h.sort(reverse=False)

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

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

    if k==0:
        print(sum(i))
        exit()
    else:
        j = i[k:]
        print(sum(j))
resolve()

Solution (Python):


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

l = h[:n-k]


if n <= k:
    print(0)
else:
    print(sum(l))

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

hps = sorted(hps,reverse=True)
hps = hps[k:]
hpsum = int(sum(hps))

print(hpsum)

Solution (Python):
def solve():
    _, k = map(int, input().split())
    h = map(int, input().split())
    h = list(reversed(sorted(h)))

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

    print(sum(h))
if __name__ == "__main__":
    solve()

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


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


A.sort(reverse=True)


print(sum(A[k:]))

Solution (Python):
from collections import deque




h, k, *a = map(int, open(0).read().split())
k = min(h,k)

a.sort()
for _ in range(k):
    a.pop()

print(sum(a))

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

if __name__ == '__main__':
    main()

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

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

Solution (Python):
from sys import stdin

N,K = [int(x) for x in stdin.readline().rstrip().split()]
H = list(map(int,input().split()))
H.sort()
if K==0:
  print(sum(H))
else :
  print(sum(H[:-K]))

Solution (Python):
n,k=map(int,input().split())
H=list(map(int,input().split()))
H.sort()
if n>k:
    for i in range(k):
        H.pop(n-i-1)
    ans=sum(H)
else:
    ans=0
print(ans)

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

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

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

h = sorted(h, reverse = True)

s = 0
t = 0
for i in h:
  if t < k:
    t += 1
    continue
  s += i
print(s)

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

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

print(hit_count)

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

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

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

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

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

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

if k >= n:
	print(0)
else:
	Hsum=0
	for i in range(n-k):
		Hsum += Hlist[i]
	print(Hsum)

Solution (Python):

import sys,os
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in os.environ else lambda *x: 0
def main(given=sys.stdin.readline):
    input = lambda: given().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    XLMIIS = lambda x: [LMIIS() for _ in range(x)]
    YN = lambda c : print('Yes') if c else print('No')
    MOD = 10**9+7

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

    

if __name__ == '__main__':
    main()

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

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

ans = 0

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

print(ans)

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

Solution (Python):
N,K = map(int,input().split())
mons = list(int(i) for i in input().split())
mons.sort(reverse= True)

if N>K:
    for x in range(K):
        mons[x] = 0
    atSum = sum(mons)
    print(atSum)
else:
    print(0)

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

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

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

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=sorted(h,reverse=True)
if n>=k:
 for i in range(k):
  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()
cnt=0
for i in range(N-K):
    cnt+=H[i]
print(cnt)

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

h.sort(reverse = True)

for i in range(n):
  if k > 0:
    k -= 1
  else:
    count += h[i]
print(count)

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

Solution (Python):

import numpy as np
n, k = map(int, input().split())
h = list(map(int, input().split()))
h = np.array(h)
h = np.sort(h)
if k >= n:
    print(0)
else:
    if k>0:
        print(np.sum(h[:-k]))
    else:
        print(np.sum(h))

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

Solution (Python):
n,k=map(int, input().split())
h=list(map(int,input().split()))
H=sorted(h,reverse=True)
if n>=k:
	for i in range(k):
		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):
def fennec(n, k):
    if n <= k:
        print("0")
    else:
        hp_list = list(map(int, input().split()))
        hp_list.sort()
        attack = 0
        for i in range(int(n) - int(k)):
            attack += hp_list[i]
        print(attack)
        
        
n, k = map(int, input().split())
fennec(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 h:
    if k != 0:
        k -= 1

    else:
        count += i
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.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(reverse = True)

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

print(ans)

Solution (Python):
import heapq

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

minus_H = [i * (-1) for i in H]
heapq.heapify(minus_H)

for i in range(min(N, K)):
    heapq.heappop(minus_H)

ans = - sum(minus_H)

print(ans)

Solution (Python):
n, k = (int(x) for x in input().split())
h = list(int(x) for x in input().split())

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

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

c.sort(reverse=True)
cntAtk = 0
for i in range(a - b):
    cntAtk = cntAtk + c[i + b]

print(cntAtk)

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

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

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

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

list_score.sort()
if h > n:
    print(0)
else:
    ans = sum(list_score[:n-h])
    print(ans)

Solution (Python):

"""
Created on Wed Mar  4 17:43:32 2020

@author: Kanaru Sato
"""

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

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

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

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

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

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

Solution (Python):
import sys

N,K = list(map(lambda x: int(x), input().split()))
monsters=list(map(lambda x: int(x), input().split()))


monsters.sort(reverse=True)


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


monsters = monsters[K:N]


print(sum(monsters))

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

    sorted_H = sorted(H,reverse=True)

    for i in range(K):
        if(i < len(sorted_H)):
            sorted_H[i] = 0

    '''
    for _ in range(K):
        if(len(H) > 0):
            maximum = max(H)
            H.remove(maximum)
            '''

    print(sum(sorted_H))

if __name__ == "__main__":
    main()

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

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

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

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

if n <= k:
    print(0)
else:
    for i in range(k):
        h_s.pop()
    print(sum(h_s))

Solution (Python):

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

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

Solution (Python):
def fenec(k, h_list):
  h_list.sort()
  if k >= len(h_list):
    return 0
  else:
    ans = 0
    for i in range(len(h_list)-k):
      ans += h_list[i]
    return ans
    
n, k = [int(i) for i in input().split()]
h_list = [int(i) for i in input().split()]

print(fenec(k, h_list))

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

def check(N,K,H):
    count = 0
    H = sorted(H)
    if K >= len(H):
        return 0
    H = H[0:len(H)-K]
    return sum(H)

ans = check(N,K,H)
print(ans)

Solution (Python):

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

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

Solution (Python):
from sys import stdin

def main():
    input = stdin.readline

    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):
h,a = [int(x) for x in input().rstrip().split()]
l=[int(x) for x in input().rstrip().split()]
l.sort(reverse = True)

ans=0

del l[0:a]
ans = a
print(sum(l))

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

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

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

Solution (Python):
n,k = input().strip().split()
n,k = [int(n), int(k)]
h = list(map(int, input().strip().split()))
h.sort()
count = 0

if k >= n:
  print("0")
else:
  for v in range(n-k):
    count += h[v]
  print(count)

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

damage.sort(reverse=True)
sum=0
for i in range(N):
    if i>=K:
        sum+=damage[i]
        
        
print(sum)

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

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

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

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

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

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_n = [int(i) for i in input().split()]

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

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

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

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

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

if n <= k:
    print(0)
else:
    lst = sorted(lst, reverse=True)
    print(sum(lst[k:]))

Solution (Python):
N = list(map(int,input().rstrip().split()))
n = N[0]
k = N[1]

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

m = 0
hit = 0
if k >= n :
  m = 0
else:
  for i in range(k,n):
    hit += h[i]
  
  m = hit
print(m)