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.sort(reverse=True)
if K>=N:
    print(0)
else:
    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(reverse=True)
i=0
new_h=[]
if n<=k:
  print(0)
else:
  for item in h:
    i=i+1
    if i>k:
      new_h.append(item)
  print(sum(new_h))

Solution (Python):

n,k = [int(x) for x in input().split()]
h = sorted([int(x) for x in input().split()])
if k >= n:
    print(0)
else:
    count = 0
    for i in range(n-k):
        count += h[i]
    print(count)

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

Solution (Python):

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

Solution (Python):

import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline






















def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

def main():
	N,K = inputMap()
	H = inputList()
 
	H.sort()
	H = H[::-1]
 
	ans = 0
	for i,vol in enumerate(H):
		if K > 0:
			K -= 1
			
			continue
		ans += vol
 
	print(ans)



if __name__ == "__main__":
	main()

Solution (Python):
from itertools import permutations, combinations

nums = input().split()
As = input().split()
H = nums[0]
N = nums[1]
A = []


N =int(N)

As = list(map(int, As))
As = sorted(As , reverse=True)

if N != 0:
    del As[:N]

print(sum(As))

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

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

H_sorted = sorted(H, reverse=True)

print(sum(H_sorted[K:]))

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

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

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

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

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

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

Solution (Python):
import os
import sys
import heapq

def main():
    H , K = map(int , input().split())
    n_list = [s for s in input().split()]
    n_list = list(map(int,n_list))
    
    
    list_small = []
    new_list = []
    if K >= len(n_list) :
        print (str(0))
    elif K == 0 :
        c = sum(int(i) for i in n_list)
        print (str(c))
    else :
        list_small = heapq.nlargest(K,n_list)
        list_small = list(map(int,list_small))
        
        
        
        
        
        c = sum(int(i) for i in n_list)
        d = sum(int(i) for i in list_small)
        print (str(c-d))
    

if __name__ == '__main__':
    main()

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

Solution (Python):
import math

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

enemys.sort(reverse=True)
count = 0
for e in enemys:
  if(k > 0):
    k -= 1
  else:
    count += e

print(count)

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


h.sort()
count = 0
n -= k
if n <= 0:
    print('0')
else:
    for i in range(n):
        count += h[i]

    print(count)

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

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

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

Solution (Python):
import sys

use_clipboard=False
bbn=1000000007
	


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

isTest=False

def pa(v):
	if isTest:
		print(v)
		
class input_clipboard:
	def __init__(self,s):
		self.input_l=s.splitlines()
		self.ii=0
		
	def input(self):
		ret = self.input_l[self.ii]
		self.ii+=1
		return ret

if __name__ == "__main__":
	if sys.platform =='ios':
		if use_clipboard:
			import clipboard
			input_text=clipboard.get()
			ic=input_clipboard(input_text)
			input = lambda : ic.input()
		else:
			sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		
			
	ret = main()
	if ret is not None:
		print(ret)

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

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


if __name__ == '__main__':
    main()

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

Solution (Python):
N, K = 0, -1
while (N < 1 or N > 2 * 10**5) and (K < 0 or K > 2 * 10**5):
  N, K = input().split()
  N, K = int(N), int(K)

flag = False
while flag == False:
  H = input().split()
  flag = (sum([((int(i) >= 1) and (int(i) <= 10**9)) for i in H]) == len(H))

H = [int(s) for s in H]
H.sort(reverse=True)
attack = []
for i,v in enumerate(H):
  if(i >= K):
    attack.append(v)
print(sum(attack))

Solution (Python):

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


for i in range(N):
  H[i] = int(H[i])


H.sort(reverse = True)


ans = 0

if N > K:
  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()))

if K >= N:
  print(0)
 
elif K == 0:
  print(sum(H))

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

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

h.sort()

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

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

s.sort(reverse=True)

if K>=len(s):
  for A in range(len(s)):
    s[A]=0

else:
  for A in range(K):
    s[A]=0



for A in s:
  sum+=A
 
print(sum)

Solution (Python):
Input1 = list(map(int,input().split()))
H = Input1[0]
K = Input1[1]

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

Ar = Input2


if K > H:
  K = H

Ar.sort(reverse=True)
del Ar[:K]

print(sum(Ar))

Solution (Python):
n, k = map(int , input().split())
h = list(map(int, input().split()))
count = 0
MOD = 1000000007
h.sort()
try:
    if(k != 0):
        del h[-k]
    for i in range(n - k):
        count += h[i]%MOD
    print(count)
except IndexError:
    count = 0
    print(count)

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

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

if len(H) <= K:
    print(0)
else:
    sorted_h = sorted(H, reverse=True)
    print(sum(sorted_h[K:]))

Solution (Python):
n,k=map(int,input().split())
h=list(map(int,input().split()))
c=0
if n<=k:
  print("0")
else:
  h.sort()
  for i in range(k):
    h.pop(-1)
  for x in h:
    c+=x
  print(c)

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

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

Solution (Python):
n, k = map(int, input().split())
h = list(map(int, input().split()))
 
h_ = sorted(h)
 
for i in range(k):
    if len(h_) > 0:
        h_.pop()
    
s = [0]*(len(h_)+1)
for j in range(len(h_)):
    s[j+1] = s[j] + h_[j]

print(s[-1])

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

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

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

Solution (Python):
N, K = [int(i) for i in input().rstrip().split(' ')]
H = [int(i) for i in input().rstrip().split(' ')]
H.sort(reverse=True)
if len(H) <= K:print(0)
else:
    lst = [h for k, h in enumerate(H) if k >= K]
    print(sum(lst))

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

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

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

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

sorted_h = sorted(list_h, reverse=True)

del sorted_h[:k]

print(sum(sorted_h))

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

Solution (Python):
N, K = map(int, input().split())
Hlist = list(map(int, input().split()))
Hlist.sort(reverse=True)
if K == 0:
  print(sum(Hlist))
else:
  Hlist[0:K] = []
  print(sum(Hlist))
'''
elif K == 1:
  del Hlist[0]
  print(sum(Hlist))
elif K == 2:
  del Hlist[0]
  del Hlist[0]
  print(sum(Hlist))
else:
  del Hlist[0:K-1]
  print(sum(Hlist))
'''

Solution (Python):
hs= input().split()
h = int(hs[0])
s = int(hs[1])
my_list = input().split()
total = 0
for i in range(len(my_list)):
  my_list[i] = int(my_list[i])
my_list.sort(reverse = True)
for j in range(s, len(my_list)):
  total = total + my_list[j]
print(total)

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

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):
import numpy as np

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

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

Solution (Python):
"""
Fennec should do special move on the K monsters with largest health.
then the other monsters take H turns to kill.
so total turns is H[i] for i in low health monsters
"""

def calc_num_turns(K, H):
  H.sort(reverse=True)
  total_turns = sum(H[K:])
  return total_turns


if __name__ == "__main__":
  K = int(input().split()[1])
  H = list(map(int, input().split()))
  print(calc_num_turns(K, 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 = list(map(int, input().split()))
if N-K <= 0:
    print(0)
else:
    H_list.sort()
    print(sum(H_list[0:N-K]))

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

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

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

h.sort(reverse=True)

print(sum(h[min(n,k):]))

Solution (Python):
h,k=map(int,input().split())
H = sorted(list(map(int,input().split())))[::-1]

print(sum(H[k::]))

Solution (Python):
arr = input().split(" ")
H = int(arr[0])
K = int(arr[1])

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

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

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

Solution (Python):
import numpy as np
n, k = [int(i) for i in input().split()]
h = np.array(sorted([int(i) for i in input().split()], reverse=True))
print(sum(h[k:]))

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

Solution (Python):
from collections import deque

N, K = map(int,input().split())
monsters = list(map(int, input().split()))
monsters.sort(reverse=True)
monsters = deque(monsters)
count = 0

while K > count:
  count += 1
  try:
    monsters.popleft()
  except IndexError:
    pass

print(sum(monsters))

Solution (Python):
N,K=map(int,input().split())
H=list(map(int,input().split()))
t=sorted(H)
n=list()
for i in range(N-K):
    n.append(t[i])
print(sum(n))

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

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

cnt = 0
if K >= N:
    cnt = 0
elif 1 <= K < N:
    H_down = sorted(H, reverse = True)
    cnt = sum(H_down[K:])

elif K == 0:
    cnt = sum(H)

print(cnt)

Solution (Python):
import heapq
list1 = input().split(' ')
list2 = input().split(' ')
list2 =  [int(s) for s in list2]

special = int(list1[1])
enemy = int(list1[0])

list = sorted(list2, reverse=True)
a = heapq.nsmallest(enemy-special, list)

if special >= enemy:
  print(0)
else:
  NN = 0
  for N in a:
    NN += N
  print(NN)

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

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

Solution (Python):
import sys
NK = input().split()
N,K = int(NK[0]),int(NK[1])
H = list(map(int,input().split()))
if K != 0 and len(H) < K:
    print(0)
    exit()
H.sort()
for i in range(K):
    H.pop(-1)
print(sum(H))

def input():
    return sys.stdin.readline()[:-1]

Solution (Python):
import sys
sys.setrecursionlimit(10**6)


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

result=0
i=0


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

if K>N:
    result=0
else:
    if K>0:
        for i in range(K):
            InpList[i]=0
    result=sum(InpList)

print(result)

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

H_sorted = sorted(H, reverse=True)

print( sum( H_sorted[min(K, len(H_sorted)):] ))

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

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

num = N-K
if(num < 0):
    num = 0
L = L[0:num]

print(sum(L))

Solution (Python):


def main():
    N, K = map(int, input().split())
    H = list(map(int, input().split()))
    H = sorted(H, reverse=True)
    sum_H = 0
    for h in H:
        if K > 0:
            K -= 1
            continue
        sum_H += h
    print(sum_H)

if __name__ == "__main__":
    main()

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

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

Solution (Python):
import numpy as np

N,K =(int(x) for x in input().split())
list1 = np.array([int(s) for s in input().split()])


list2=np.sort(list1)

i=0
sum=0
while i<=N-K-1:
  sum=sum+list2[i]
  i=i+1

print(sum)

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

Solution (Python):
n, k = map(int, input().split())
a = list(reversed(sorted(map(int, input().split()))))
ans = 0

for x in a:
    if k > 0:
        k -= 1
    else:
        ans += x

print(ans)

Solution (Python):


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

H.sort()

for _ in range(k):
    if len(H) != 0:
        H.pop()
    else:
        break

print(sum(H))

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

H.sort(reverse=True)

print(sum(H[K:]))

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

a = sorted(a, reverse=True)

def sum_ary(ary):
  total = 0
  for a in ary:
    total += a
  return total

if n >= len(a):
  print(0)
  exit()
del a[:n]
print(sum_ary(a))

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

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

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

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 = input().split()
N = int(N)
K = int(K)
H = input()
H = [int(i) for i in H.split()]
H.sort()
while (K > 0 and len(H) != 0):
  del H[-1]
  K -=1
print(sum(H))

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

if len(HListSorted) <= K:
    print('0')
else:
    HList = HListSorted[K:]
    print(sum(HList))

Solution (Python):
NK=input().split()
N=int(NK[0])
K=int(NK[1])
Hlis=list(map(int,input().split()))
ans=0

if K>=N:
    print(0)
else:
    Hlis.sort()
    for i in range(N-K):
        ans+=Hlis[i]
    print(ans)

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

Solution (Python):
N, K = map(int, input().lower().split())
H = []
total = 0
input_string = input()
H = input_string.split()
H = list(map(int, H))

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

print(sum(H))

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

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

Solution (Python):
from sys import stdin


def main(inp1, inp2):
    n, k = [int(i) for i in inp1.split(sep=' ')]
    h_list = sorted([int(i) for i in inp2.split(sep=' ')])

    num_enemy = n
    enable_special = k

    if enable_special >= num_enemy:
        return 0
    elif enable_special == 0:
        return sum(h_list)
    else:
        return sum(h_list[:-enable_special])


if __name__ == '__main__':
    input1 = stdin.readline().rstrip()
    input2 = stdin.readline().rstrip()
    ret = main(input1, input2)
    print(ret)

Solution (Python):
n = list(map(int,input().split())) 
K = n[1] 
n1 = list(map(int,input().split())) 
n1.sort()
if K < n[0] : 
    n1 = n1[0:len(n1)-K] 
    print(sum(n1))
else : 
    print("0")

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

Solution (Python):
in_len = input().split(" ")

in_n = int(in_len[0])
in_k = int(in_len[1])
in_h = input().split(" ")
out = 0

sort_h = sorted(in_h, reverse=True, key=int)
i = in_k

while i < in_n:
  out += int(sort_h[i])
  i += 1

print(out)

Solution (Python):
N, K = map(int, input().lower().split())
H = []
total = 0
input_string = input()
H = input_string.split()
H = list(map(int, H))

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

print(sum(H))

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

Solution (Python):
monster, skill = map(int,input().split())

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

monster_hp.sort()

attack_count = 0

while(skill>0):
    skill -= 1
    if len(monster_hp) > 0:    
        monster_hp.pop(-1)
    

for hp in monster_hp:
    attack_count += hp

print(attack_count)

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

if K >= N:
  print(0)
else:
  sort_H = sorted(H, reverse=True)
  print(sum(sort_H[K:]))

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

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

if K >= N:
    print(0)
elif K == 0:
    answer = np.sum(H)
    print(answer)
else:
    ind = np.argpartition(H, -K)[-K:]
    top_k = H[ind]
    answer = np.sum(H) - np.sum(top_k)
    print(answer)

Solution (Python):
NK = list(map(int, input().split()))
H = list(map(int, input().split()))
H.sort(reverse= False)
Hlen = len(H)
N = NK[0]
i = NK[1]
X = 0
for i in range(N - i):
	X += H[i]
print(X)

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

h.sort()


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

Solution (Python):
s = input().split()  
s2 = list(map(int, input().split()))  
s2_n = sorted(s2, reverse=True)[int(s[1]):]

print(sum(s2_n))

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

H.sort(reverse=True)

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

print(ans)

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

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

H.sort()

if(len(H) <= K):
    print(0)
else:
    for n in range(K):
        H.pop()

    sumH = sum(H)

    print(sumH)

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

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

Solution (Python):
def main():
  N, K = map(int, input().split())
  
  H = sorted(list(map(int, input().split())), reverse=True)
 
  n = sum(H)
  
  if K == 0:
    print(n)
  elif N > K:
    for i in range(K):
      n -= H[i]
    print(n)
  else:
    print(0)
    
  return 0
 
if __name__ == "__main__":
  main()

Solution (Python):
m,a=(int(x) for x in input().split())
lm = list(map(int, input().split()))
lm.sort(reverse=True)

del lm[0:a]

print(sum(lm))

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

count = 0
for i in range(K, N):
    count += H[i]

print(count)

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

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

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

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

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

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




if N <= K:
    print(0)
else:
    H = sorted(H, reverse=True)
    
    
    
    
    
    
    
    result = 0
    for i in range(K, N):
        result += H[i]

    print(result)

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

ld[0:K] = []
print(sum(ld))

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

T = N-K
H.sort()

ans = 0

for n in range(T):
    ans += H[n]

print(ans)

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

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

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

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

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

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

H.sort(reverse=True)

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

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):
input_list = list(map(int, input().split()))
monster_num = input_list[0]
atk_times = input_list[1]
hps_list = list(map(int, input().split()))
sort_hp_list = sorted(hps_list, reverse=True)
if monster_num < atk_times:
  print(0)
else:
  print(sum(sort_hp_list[atk_times: ]))

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

Solution (Python):
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = min(len(b),a[1])
b.sort()
del b[a[0] - c:a[0]]
print(sum(b))

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

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

    print(sum(l))

Solution (Python):
a=[int(i) for i in input().split()]
b=[int(i) for i in input().split()]
if a[1]>=a[0]:
    print(0)
else:
    print(sum(sorted(b)[:a[0]-a[1]]))

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

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

H.sort()

H_= H[:-K]


if N==K:
  print(0)
elif K==0:
  print(sum(H))
else:
  print(sum(H_))

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

 
  
  else:
    print(0)

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

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

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

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

A_list = list(A)
counter = 0
A_list.sort()
A_list.reverse()

if K >= N:
    print(0)
else:
    for val in range(N - K):
        counter += int(A_list[val+K])
    print(counter)

Solution (Python):
n, k= map(int, input().split())
h = list(map(int, input().strip().split()))
import numpy as np
hnp = np.asarray(h)
hnp = np.sort(hnp, axis=0)      
if(k >= n):
    print(int(0))
else:    
    s = n-k
    print(int(np.sum(hnp[:s])))

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

a.sort()

counter = 0
if K >= len(a):
  counter = 0
else:
  for _ in range(K):
      a.pop(-1)
  counter = sum(a)
print(counter)

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

count = 0

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

print(count)

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

if k >= len(h):
    H = []
else:
    H = h[k:]

if len(H) == 0:
  print(0)
else:
  print(sum(H))

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

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

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

H = sorted(H, reverse=True)

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

Solution (Python):
import numpy as np

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

x = np.array(list(map(int, input().split())))

if N <= K:
	print(0)
else:
	x = np.sort(x)[::-1]
	print(int(np.sum((x[K:]),dtype=np.float64)))