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


def solve(N: int, K: int, H: "List[int]"):
    H.sort()
    if K>=len(H):
        print(0)
    else:
        for i in range(K):
            del H[-1]
        print(sum(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)

print(sum(h[:max(0, n-k)]))

Solution (Python):
import sys
import itertools
read = sys.stdin.buffer.read 
readline = sys.stdin.buffer.readline 
readlines = sys.stdin.buffer.readlines 
N,K = map(int, readline().split())
H = list(map(int, readline().split()))
N -= K
if N <= 0 :
  print(0)
  exit()

H.sort()

count=0
for i in range(N):
  count+=H[i]
print(count)
exit()

Solution (Python):
t = []
t = list(map(int, input().split()))

k = t.pop()
n = t.pop()

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

h.sort()

for i in range(k):
    if len(h)>0:
        h.pop()

total = sum(h)
print(total)

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

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

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

if k >= len(a):
    print(0)
else:
    res = a[k:]
    print(sum(res))

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

input2 = input().split()
Monster_list = list(map(int,input2))


Monster_list.sort(reverse=True)


del Monster_list[0:K]


print(sum(Monster_list))

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

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

ls = sorted(ls)


if len(ls)<k+1:
  print(0)
else:
  print(sum(ls[:-k]) if k>0 else sum(ls))

Solution (Python):

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

n2 = sorted(n, reverse=True)
ans = sum(n2[k:])

print(ans)

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

H.sort()

count = N - K

ans = 0
for i in range(count):
    ans = ans + H[i]



print(ans)

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

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

if k >= len(h):
    print(0)
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 heapq
n,k=map(int,input().split())
a=[int(x) for x in input().split()]
if k>n:
    print(0)
else:
    f=heapq.nsmallest(n-k,a)
    print(sum(f))

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

Solution (Python):

import heapq

N, K = map(int, input().split())
H = list(map(int, input().split()))
H = list(map(lambda x: x*(-1), H))
heapq.heapify(H)

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

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

if N <= K:
    print(0)
    exit
else:
    del listh[:K]
    
    ans = sum(listh)
    print(ans)

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

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

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

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

Solution (Python):
N, K = [int(x) for x in input().split()]
H = [int(x) for x in input().split()]
H.sort(reverse=True)
hits = 0
for x in H:
    if K != 0:
        K -= 1
        continue
    else:
        hits += x
print(hits)

Solution (Python):
import heapq
n,k=list(map(int,input().split()))
h=list(map(lambda x:int(x)*(-1),input().split()))
heapq.heapify(h)
if k>len(h):k=len(h)
for i in range(k):
  heapq.heappop(h)
print(-sum(h))

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

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

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

h.sort()

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

print(sum)

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

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

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

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

Solution (Python):
N, MP = map(int, input().split())
lists = list(map(int, input().split()))
if len(lists) <= MP:
    print(0)
else:
    lists.sort()
    for i in range(0,MP):
        del lists[-1]
    ans = sum(lists)
    print(ans)

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):
A = list(map(int , input().split()))
B = list(map(int , input().split()))
if A[0] < A[1]:
    print(0)
else:
    B.sort(reverse=True)
    del B[0:A[1]]
    print(sum(B))

Solution (Python):

import sys


def solve(N: int, K: int, H: "List[int]"):
    H = sorted(H, reverse=True)
    H = H[K:]
    result = sum(H)
    print(result)
    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()

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

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

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

Solution (Python):


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

count = 0

health = sorted(health,reverse=True)

print(sum(health[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):
import sys
import math

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

li.sort(reverse=True)

atk = 0

for i in range(len(li)):
    if i>=k:
        atk += li[i]
        
print(atk)

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

nums.sort()
if k != 0:
    ans = sum(nums[:-k])
else:
    ans = sum(nums)
print(ans)

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(sorted(h)[:n-k]))

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

import math




import sys
if N>=len(l):
    print(0)
    sys.exit()

    
sort_l=sorted(l)
delete_l=sort_l[:len(l)-N]
print(sum(delete_l))

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

sorted_h = sorted(h)

num = 0
if k >= len(sorted_h):
    print('0')
elif k == 0:
    print(sum(sorted_h))
else:
    del sorted_h[-k:]
    print(sum(sorted_h))

Solution (Python):


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

H.sort()
x=0
for i in range(len(H)-K):
    x+=H[i]
print(x)

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

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

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


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

Solution (Python):


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

cnt = 0
for i in range(N):
    if K > 0:
        K -= 1
        continue
    cnt += H[i]
print(cnt)

Solution (Python):
import heapq

ans=0
n,k=map(int,input().split())
enemy=list(map(int,input().split()))
if k>=len(enemy):
    print(0)
else:
    for  i in range(len(enemy)):
        enemy[i]*=(-1)
    heapq.heapify(enemy)

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


    while len(enemy)>0:
        ans += heapq.heappop(enemy)*(-1)

    print(ans)

Solution (Python):


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

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

Solution (Python):

n,k=map(int, input().split())
h=list(map(int, input().split()))
b =sorted(h)
if k != 0:
    b = b[:-k]

print(sum(b))

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

sort_h_list = sorted(h_list, reverse=True)
sort_h_list_length = len(sort_h_list)

print(sum(sort_h_list[K:]))

Solution (Python):
a, b = map(int, input().split())
table = list(map(int, input().split()))
table.sort(reverse=True)
if b < len(table):
    del table[0:b]
    print(sum(table))
else:
    print(0)

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

print(sum(sort[k:n]))

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


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

enemy.sort()

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

Solution (Python):
import numpy as np

N, K = map(int, input().split())
H = np.array([int(h) for h in input().split()])

H = np.sort(H)[::-1]
res = np.sum(H[K:])
print(res)

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

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


print(sum(H[K:]))

Solution (Python):

n,k=map(int,input().split())
a=[int(i) for i in input().split()]
a.sort(reverse=True)
x=[]
if(k>=n):
	print(0)
else:
	for i in range(k):
		x.append(a[i])
	print(abs(sum(a)-sum(x)))

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

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

hd = sorted(h, reverse=True)
tmp = 0

if n < k:
    print(0)
else:
    for i in range(k): 
        tmp = tmp + hd[i]

    result = sum(h) - tmp
    print(result)

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

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

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

for i in range(K):
    
    if len(H):
        H.pop()
    
print(sum(H))

Solution (Python):
import math as m
n,k = map(int,input().split())
a = list(map(int,input().split()))
a.sort(reverse=True)

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

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

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

list = list(map(int,list(input().split())))
ld = sorted(list, reverse=True)
print(sum(ld[K:]))

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

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

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

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

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

print(a)

Solution (Python):
def main(n, k, h):

    h.sort()

    for i in range(k):
        try:
            h.pop()
        except IndexError:
            pass

    print(sum(h))


if __name__ == "__main__":
    n, k = map(int, input().split())
    h = list(map(int, input().split()))

    main(n, k, h)

Solution (Python):
from functools import reduce
from operator import add

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

sortedHList = sorted(hList, reverse=True)
restHList = sortedHList[k:]
if len(restHList) == 0:
  print(0)
else:
  print(reduce(add, restHList))

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

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

li.sort()

for i in range(N-K):
    h=li[i]+h

print(h)

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

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

Solution (Python):
N, K = map(int, input().split())          
H = [i for i in 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()
count = sum(H[:max(N - K, 0)])
print(count)

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

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

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

sorted_Hs = sorted(Hs, reverse=True)

del sorted_Hs[0:k]

print(sum(sorted_Hs))

Solution (Python):
n, k = map(int, input().split())
h_list = [int(i) for i in input().split()]
if k >= len(h_list):
    print (0)
    exit (0)
h_list.sort(reverse=True)
del h_list[0:k]
print (sum(h_list))

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

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

H.sort()
if K !=0:
    c = K if N>K else 0
    H = H[0:-c]
else:
    c =-1

ans = sum(H) if c!=0 else 0


print(ans)

Solution (Python):
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 += h[i]
    print(sum)

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

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

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

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

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

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

if K >= len(H):
    ans = 0
else:
    H.sort()
    for i in range(0, len(H)-K):
        ans += H[i]

print(ans)

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

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

main()

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

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

Solution (Python):
from __future__ import print_function

import sys
input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return










import fractions

from fractions import gcd












from queue import Queue






from operator import mul
from functools import reduce





def coprimize(p, q):
    common = fractions.gcd(p, q)
    return (p // common, q // common)


def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom





n, k = map(int, input().strip().split())
h = list(map(int, input().strip().split()))
h.sort()
if k > n:
    print(0)
    sys.exit()
else:
    for i in range(k):
        h.pop()
        
print(sum(h))

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

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

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

h=sorted(h)

if len(h) <= k:
    print(0)
else:
    buf=h[0:len(h)-k]
    """for i in range(k):
       del h[-1]"""
    print(sum(buf))

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

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

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

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

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

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

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

list_score.sort()

if h >= len(list_score):
    h = len(list_score)

for i in range(h):
    list_score.pop(-1)

ans = sum(list_score)

print(ans)

Solution (Python):



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

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

h.sort()

if n - k <= 0:
    print("0")
else:
    rh = h[:n - k]
    ans = 0
    for i in rh:
        ans += i
    
    print(ans)

Solution (Python):

from heapq import heappop, heapify, heappush
N, K = map(int, input().split())
H = list(map(int, input().split()))

heap = []
for h in H:
  heappush(heap, -h)

cnt = 0
while heap:
  if K > 0:
    heappop(heap)
    K -= 1
    continue

  h = -heappop(heap)
  if h > 0:
    cnt += h

print(cnt)

Solution (Python):
import collections
import itertools as it
import math
import numpy as np








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

H.sort()

rest = sum(H[::-1][K:])

print(rest)

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


print(sum(h))

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

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

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

N, K = int(N), int(K)
Hs = [int(H) for H in Hs]
if N <= K: 
    print(0)
else:
    sorted_Hs = sorted(Hs) 
    if K == 0: 
        attack_Hs_count = sum(sorted_Hs)
    else: 
        attack_Hs_count = sum(sorted_Hs[:-K])
    print(attack_Hs_count)

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

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

if len(h) < k:
    print('0')
else:
    for _ in range(k):
        h.pop()

    print(sum(h))

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

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

h.sort()

for i in range(k):
    if(len(h) > 0):
        h.pop()
    else:
        break

print(sum(h))

Solution (Python):
import math
P = [int(p) for p in input().split()]
N = P[0]
K = P[1]

H = [int(a) for a in input().split()]
H.sort()
if(K>0):
  A = H[:-K]
else:
  A = H
print(sum(A))

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

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

for _ in range(K):
    if hit_points == []:
        break
    hit_points.pop()

print(sum(hit_points))

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

for i in range(K):
  if not not H:
    H.pop(-1)
print(sum(H))

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

kai = 0
H = input().split(" ")
H =[int(i) for i in H]
H.sort(reverse=True)

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

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

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

h_list = sorted(list(map(int, input().split())),reverse = True)

print(sum(h_list[k:]))

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

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

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

a_list.sort(reverse=True)

sum_d = 0

for i, x in enumerate(a_list):
    if(b != 0):
        b -= 1 
    else:
        sum_d += x

print(sum_d)

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

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

Solution (Python):
monster_num,k = map(int,input().split(" "))
hp = list(map(int,input().split(" ")))
hp = sorted(hp, reverse = True)

total = 0
for i in hp:
    total += i
    
s = 0
for i in range(k):
    if s <= len(hp) - 1:
        total -= hp[s]
        s += 1

print(total)

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

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

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


H.sort()

if K >= len(H):
    print("0")
else:
    for i in  range(K):
        H.pop()
    print(sum(H))

Solution (Python):
import sys
n,k = map(int,input().split())
lis = list(map(int,input().split()))
if k >=n:
    print(0)
    sys.exit()
s_lis = sorted(lis,reverse=True)
print(sum(s_lis[k:]))

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

Solution (Python):
[N, K] = map(int, raw_input().split())
H = map(int, raw_input().split())


H.sort()


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

print sum

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

H.sort(reverse = True)
total = 0
for i in range(N-K):
    total += H[K + i]

print(total)

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

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

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

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

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

h.sort(reverse=True)

ans = 0
if k >= len(h):
  print(0)
  sys.exit()

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

print(ans)

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

h.sort(reverse=True)
for i in range(k):
  if i >= n:
    break
  h[i] = 0
print(sum(h))

Solution (Python):
import numpy as np

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

h = np.array(sorted(h))

if(k > 0):h = h[:-k]


print(sum(h))

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

Solution (Python):

import sys


def solve(N: int, K: int, H: "List[int]"):
    H.sort()
    print(0 if N<=K else sum(H[:N-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 = [int(i) for i in input().split()]
mon_list = [int(i) for i in input().split()]
mon_list = sorted(mon_list, reverse=True)
if N <= K:
    output = 0
else:
    if K != 0:
        output = sum(mon_list[K:])
    else:
        output = sum(mon_list)
print(output)

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

if(N<=K):
    print("0")
else:
    H.sort()
    for _ in range(K):
        H.pop()

    kaisuu = 0
    for i in range(len(H)):
        kaisuu += H[i]

    print(kaisuu)

Solution (Python):
import sys,collections,math,random,fractions,bisect;sys.setrecursionlimit(10**7)
sr = sys.stdin.readline; P = print; P2 = lambda x: print(*x, sep="\n")
def I(i=0): t = [int(x)-i for x in sr().split()];return t 
def S(): t = sr().split(); return t if len(t) > 1 else t[0]
L1,L2,L3,L4, = [],[],[],[]

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

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

list = list[k:]

if list == []:
  print(0)
else:
  print(sum(list))

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

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

Solution (Python):

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

H.sort(reverse=True)

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

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

Solution (Python):
import math

N,MP=map(int, input().split())
HP=list(map(int, input().split()))
HP.sort()
HP.reverse()
if MP==0:
    print(sum(HP))
elif N<=MP:
    print(0)
else:
    del HP[0:MP]
    print(sum(HP))

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

h.sort()
c = list(reversed(h))

ans = 0
if n > k:
    ans = sum(c[k:])
print(ans)

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

H.sort(reverse=False)
if k >= len(H):
    print("0")
    exit()
for i in range(k):
    H.pop(-1)
print(sum(H))

Solution (Python):


import math


def inputIntList():
  return [int(s) for s in input().split()]


def inputInt():
  return int(input())


def main():
  N, K = inputIntList()
  H = inputIntList()
  H = sorted(H, reverse=True)[K:]
  ans = sum(H)
  return ans


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

Solution (Python):

"""
Created on Sun Jan 26 21:09:11 2020

@author: H_Hoshigi
"""

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

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

answer = None
if K >= N:
    answer = 0
else:
    answer = sum(H_list[K:])

print(answer)

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

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

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

h.sort(reverse=True)

for i in range(k,n):

    attack += h[i]
print(attack)

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

NK=np.array(input().split(" "),dtype=np.int64)
N=NK[0]
K=NK[1]

H=np.array(input().split(" "),dtype=np.int64)

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

remain_H=np.sum(sort_H[K::])

print(remain_H)