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 = [int(i) for i in input().split(" ")]
h = [int(i) for i in input().split(" ")]
h = sorted(h)
sum_v = 0

for i in range(n-k):
    sum_v += h[i]
    
print(sum_v)

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

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

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

if (K >= len(H)) :
  print('0')
else :
  H = sorted(H, 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)

print(sum(H[K:]))

Solution (Python):
import numpy as np

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

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

    print(np.sum(h[k:]))

resolve()

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

if K > N:
  	print(0)
else:
	H.sort()

	H = H[0 : N - K]

	for val in H:
  		sum = sum + val
  
	print(sum)

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

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

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

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

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

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

print(sum(h[k:]))

Solution (Python):
def solve(n, k, H):
    return sum(sorted(H)[:n - min(k, n)])

_n, _k = map(int, input().split())
_H = map(int, input().split())
print(solve(_n, _k, _H))

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

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

Solution (Python):

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

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

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

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

Solution (Python):
data1=input().split()
data2=[int(x) for x in input().split()]
Nu=int(data1[0])
Kill=int(data1[1])
data2.sort()
if Nu>Kill:
	data3=data2[0:Nu-Kill]
else:
  data3=[]
print(sum(data3))

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

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

sum_hp = 0


hp.sort()


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



for j in hp:
    sum_hp = sum_hp + int(j)

print(str(sum_hp))

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

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

if k == 0:
    print(sum(h))
else:
    h = sorted(h)
    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 n <= k:
    print(0)
else:
    print(sum(h[k:]))

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

for i in range(K):
  if len(H) == 0:
    break
  H.pop()

print(sum(H))

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

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

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

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

Solution (Python):
from math import ceil
from sys import stdin
n,k = map(int,stdin.readline().split())
h = sorted(list(map(int,stdin.readline().split())))
ans = 0
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()))
M = sorted(H)
if N<=K:
    print(0)
else:
    print(sum(M[:N-K]))

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

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

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

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

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

if __name__ == '__main__':
    main()

Solution (Python):

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

h=sorted(H)

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

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

Solution (Python):

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

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

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

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

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

    
    sorted_h_list = sorted(h_list, reverse=True)
    attack_list = sorted_h_list[k:]

    ans = sum(attack_list)
    print(ans)


main()

Solution (Python):
import numpy as np

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


a = list(np.zeros(K))
if N - K>=0:
    b = list(np.ones(N-K))
    a.extend(b)
else:
    a = list(np.zeros(N))

print(int(np.dot(a, li)))

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

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

if K == 0:
  print(sum(E))
  
else:
  E = sorted(E)
  for i in range(K):
    if len(E) == 0:
      break
    E.pop()
  print(sum(E))

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

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

if __name__ == '__main__':
    
    

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

Solution (Python):
from sys import stdin

def main():
    n,m = map(int,stdin.readline().split())
    l = list(map(int,stdin.readline().split()))
    l.sort()
    aco = 0
    for i in range(n-m):
        aco+= l[i]
    print(aco)
        
main()

Solution (Python):
from sys import stdin

def main():
    N,K = map(int,stdin.readline().split())
    arr = [int(x) for x in stdin.readline().split()]

    arr.sort()
    arr.reverse()
    res = 0
    for i in range(K,len(arr)):
        res +=arr[i]
    print(res)
main()

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


remain_monster = N - K
if remain_monster <= 0:
    monsterHP = 0

else:
    new_list = sorted(List, reverse=True)

    monsterHP = sum(new_list[-remain_monster:])

print(monsterHP)

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

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

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

print(atk)

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

cnt = 0
atk = 0
while True:
    for i in range(N):
        if H[i] <= 0:
            continue
        else:
            if K > 0:
                K -= 1
                H[i] = 0
                cnt += 1
            else:
                atk += H[i]
                cnt += 1

    if cnt == N:
        break

print(atk)

Solution (Python):
h,k = map(int,input().split())
l = list(map(int,input().split()))
l.sort()
for i in range(k):
    if(len(l)==0):break
    else:l.pop(len(l)-1)
print(sum(l))

Solution (Python):
enemmyCountN,killerTimeK = map(int,input().split())
enemyHp = input().split()

intEnemyHp = [int(i) for i in enemyHp]
intEnemyHp.sort()

resultEnemyCount = enemmyCountN - killerTimeK
countNormal = 0


    


for i in range(resultEnemyCount):
    countNormal += intEnemyHp[i]
print(countNormal)

Solution (Python):
enemmyCountN,killerTimeK = map(int,input().split())
enemyHp = input().split()

intEnemyHp = [int(i) for i in enemyHp]
intEnemyHp.sort()

resultEnemyCount = enemmyCountN - killerTimeK
countNormal = 0

if killerTimeK >= enemmyCountN:
    print(0)

else:
    for i in range(resultEnemyCount):
        countNormal += intEnemyHp[i]
    print(countNormal)

Solution (Python):
enemmyCountN,killerTimeK = map(int,input().split())
enemyHp = list(map(int,input().split()))

enemyHp.sort()

resultEnemyCount = enemmyCountN - killerTimeK
countNormal = 0

if killerTimeK >= enemmyCountN:
    print(0)

else:
    for i in range(resultEnemyCount):
        countNormal += enemyHp[i]
    print(countNormal)

Solution (Python):
import numpy as np
N,K = map(int,input().split())
H = list(map(int,input().split()))
H.sort()
j=0
if K >= N:
    print(0)
else:
    for i in range (N-K):
        j+=H[i]
    print(j)

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

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

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

b.sort(reverse=True)
c = b[a[1]:]
cnt = 0

for i in range(len(c)):
  cnt += c[i]

print(cnt)

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

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 heapq

def main():
    N, K = map(int, input().split())
    H = [int(x) for x in input().split()]

    q = list(map(lambda x: x*-1, H))
    heapq.heapify(q)

    
    K = min(N, K)

    for _ in range(K):
        heapq.heappop(q)

    print(sum(q)*-1)

if __name__ == "__main__":
    main()

Solution (Python):
N, K = map(int, input().split())
A = sorted(map(int, input().split()),reverse=True)
if K>N:
    print(0)
else:
    i=0
    for j in range(K,N):
        i=i+A[j]
    print(i)

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

Solution (Python):
import sys
n, k = map(int, input().split())
h = [int(x) for x in input().split()]
h.sort()
if n <= k:
    print(0)
    sys.exit()
else:
    ans = sum(h[:n-k])
    print(ans)

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

Solution (Python):
import numpy as np

def do():
    data = np.array(input().split(" "), dtype="int64")
    life = np.array(input().split(" "), dtype="int64")
    monsters = data[0]
    smash = data[1]
    if smash == 0:
        print(np.sum(life))
    elif smash >= monsters:
        print(0)
    else:
        a = np.sort(life)[-smash]
        leftover = np.where(life < a, life, 0)
        print(np.sum(leftover))

do()

Solution (Python):
data  = [int(_) for _ in input().split()]
enemy = [int(_) for _ in input().split()]

if len(enemy) < data[1]:
    print(0)
    exit()
elif data[1] == 0:
    print(sum(enemy))
else:
    enemy.sort()
    
    print(sum(enemy[:-data[1]]))

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

sum = 0

H = sorted(H)

answer = 0

if N > K:
    for i in H[:N-K]:
        answer += i

print(answer)

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

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

n = len(A)
if k >= n:
    print(0)
    sys.exit(0)
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 k>=n:
    print(0)
    exit()
for i in range(k):
    h[i]*=0
print(sum(h))

Solution (Python):
n, k = list(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 =input().split()
N=int(n)
K=int(k)
H=[int(i) for i in input().split()]
H.sort(reverse=True)
ans=0
if K==0:
    for j in range(N):
        ans = ans + H[j] 
elif N<=K:
    ans ==0
else:
    H = H[K:]
    for l in range(N-K):
       ans = ans + H[l]
print(ans)

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

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

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

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

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

ans = sum(H[K:])

print(ans)

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

for i in range(K):
    if len(monster_hp_list) >= 1:
        monster_hp_list.pop()
        K -= 1
    else:
        break
print(sum(monster_hp_list))

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

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

h.sort()
s = []
if k == 0:
    s = h
else:
    s = h[:-k]

print(sum(s))

Solution (Python):
from heapq import nsmallest
H, K = map(int, input().split())
arr = list(map(int, input().split()))
print(sum(nsmallest(H-K, arr)))

Solution (Python):

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

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

h.sort(reverse=True)

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

Solution (Python):

import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)

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

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

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

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

H = input().split()
intH = [int(s) for s in H]
intH.sort()
intH.reverse()

at = 0
for i in intH:
  if K > 0:
    K -= 1
  else:
    at += i

print(at)

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

Solution (Python):
values = input()
Num_monsters, K_skills = map(int, values.split())
values = input()
H_point = list(map(int, values.split()))

if Num_monsters <= K_skills:
    print(0)
else:
    num = Num_monsters - K_skills
    H_point.sort()
    print(sum(H_point[0:num]))

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

Solution (Python):
import sys

input = sys.stdin.buffer.readline


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

	vA.sort()
	
	res = sum(vA[:-K]) if K else sum(vA)
	print(res)

main()

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

H.sort(reverse=True)

S=0
if K<N:
    for i in range(K,N):
        S+=H[i]
    print(S)
else:
    print('0')

Solution (Python):
n,k = list(map(int,input().split()))
data = [int(s) for s in input().split()]

data.sort(reverse = True)
ans = 0
if k >= len(data):
  print(0)
  exit()
else:
  for i in range(k,len(data)):
    ans += data[i]
  print(ans)

Solution (Python):
S_nk = input().split(" ") 
S_h = input().split(" ") 

N = int(S_nk[0]) 
K = int(S_nk[1]) 
H = [] 
for i in range(N):
  H.append(int(S_h[i]))


H.sort(reverse=True)

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

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

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

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

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

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

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

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

Solution (Python):

from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect


def LI(): return [int(x) for x in sys.stdin.readline().split()]


def I(): return int(sys.stdin.readline())


def LS(): return [list(x) for x in sys.stdin.readline().split()]


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]


def LIR(n):
    return [LI() for i in range(n)]


def SR(n):
    return [S() for i in range(n)]


def LSR(n):
    return [LS() for i in range(n)]


sys.setrecursionlimit(1000000)
mod = 1000000007


def solve():
    n, k = LI()
    h = sorted(LI())
    if k == 0:
        print(sum(h))
    else:
        print(sum(h[:-k]))
    return



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):
[N,K]=list(map(int, input().split()))
H=list(map(int, input().split()))

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

Solution (Python):
def main():
	N,K = map(int,input().split())
	H = [int(h) for h in input().split()]
	H = sorted(H,reverse=True)
	for i in range(min(K,N)):
		H[i] = 0
	print(sum(H))
if __name__ == '__main__':
	main()

Solution (Python):
myinput = input()
myinput_H = input()
mylist = list(map(int, myinput.split(" ")))
N = mylist[0]
K = mylist[1]
list_H = list(map(int, myinput_H.split(" ")))
if N - K <= 0:
    print(0)
else:
    x = N - K
    list_H.sort()
    l = list_H[0:x]
    sum = sum(l)
    print(sum)

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

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

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

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

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

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

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

print(sum)

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

print(sum(H[K:]))

Solution (Python):
N, K = [int(x) for x in input().split()]
H = [int(x) for x 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()))

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

Solution (Python):

import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [input() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [int(input()) for i in range(n)]


class Math():
    @staticmethod
    def gcd(a, b):
        if b == 0:
            return a
        return Math.gcd(b, a % b)

    @staticmethod
    def lcm(a, b):
        return (a * b) // Math.gcd(a, b)

    @staticmethod
    def roundUp(a, b):
        return -(-a // b)

    @staticmethod
    def toUpperMultiple(a, x):
        return Math.roundUp(a, x) * x

    @staticmethod
    def toLowerMultiple(a, x):
        return (a // x) * x

    @staticmethod
    def nearPow2(n):
        if n <= 0:
            return 0
        if n & (n - 1) == 0:
            return n
        ret = 1
        while(n > 0):
            ret <<= 1
            n >>= 1
        return ret

    @staticmethod
    def sign(n):
        if n == 0:
            return 0
        if n < 0:
            return -1
        return 1

    @staticmethod
    def isPrime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3, d + 1, 2):
            if n % i == 0:
                return False
        return True


class PriorityQueue:
    def __init__(self, l=[]):
        self.__q = l
        heapq.heapify(self.__q)
        return

    def push(self, n):
        heapq.heappush(self.__q, n)
        return

    def pop(self):
        return heapq.heappop(self.__q)


MOD = int(1e09) + 7
INF = int(1e15)


def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors


def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a


def main():
    
    N, K = Scanner.map_int()
    H = Scanner.map_int()
    H.sort()
    print(sum(H[:N - min(K, N)]))
    return


if __name__ == "__main__":
    main()

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

Solution (Python):
import math

temp = input().split(' ')
monter_count = int(temp[0])
kill_count = int(temp[1])
 
temp = input().split(' ')

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

temp.sort(reverse=True)
del(temp[0:kill_count])

print(sum(temp))

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

print(sum(h[k:]))

Solution (Python):
import sys



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

health.sort(reverse = True)
ans = 0
for i in range(k, len(health)):
    ans += health[i]
print(ans)

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

attack = 0
for i, hp in enumerate(reversed(hp_list)):
  if i < k:
    continue
  attack += hp
print(attack)

Solution (Python):
def find_minimum_normal_attack(monster_num, special_move_num, monster_healths):
    return sum(sorted(monster_healths, reverse=True)[special_move_num:])


if __name__ == '__main__':
    n, k = map(int, input().split())
    h = list(map(int, input().split()))
    print(find_minimum_normal_attack(n, k, 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):
n,k = map(int,input().split())
h = list(map(int,input().split()))

h = sorted(h)

attack_n = 0

if k >= n:
    attack_n = 0

else:
    for i in h[:n-k]:
        attack_n += i

print(attack_n)

Solution (Python):
import heapq

n, k = map(int, input().split())
li = list(map(int, input().split()))
li = list(map(lambda x: x * (-1), li))


def attack():
    if n <= k:
        return (0)
    heapq.heapify(li)
    for i in range(k):
        heapq.heappop(li)
    return - 1 * sum(li)


print(attack())

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

Solution (Python):
n, k = map(int, input().split())
li = list(map(int, input().split()))
arr=sorted(li)
for i in range(k):
  if len(arr)==0:
    break
  arr.pop()
print(sum(arr))

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

hh = sorted(h)

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

Solution (Python):

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

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

print(sum)

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:
    for i in range(K):
        H[i]=0
    print(sum(H))

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

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

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

H_list = [i for i in map(int, input().split())]

sorted_H_list = sorted(H_list)

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

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):
n,k=map(int,input().split())
l=[int(i) for i in input().split()]
l.sort()
if k>=n:
  print("0")
else:
  sum=0
  for i in range(n-k):
    sum+=l[i]
  print(sum)

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

H_list.sort(reverse = True)

del H_list[0:K]

print(sum(H_list))

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

Solution (Python):
import collections
n, k = map(int, input().split())
dat = list(map(int, input().split()))
dat.sort(reverse=True)
dat = collections.deque(dat)
res = 0

for _ in range(min(k, len(dat) )):
    _ = dat.popleft()
    

res += sum(dat)

print(res)

Solution (Python):
n,k = (int(x) for x in input().split())
h_lst = [int(x) for x in input().split()]
h_lst.sort()
if k != 0:
    del h_lst[(-1)*k:]
print(sum(h_lst))

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

Solution (Python):
x, y = (int(x) for x in input().split())
a = (int(x) for x in input().split())

print(sum(sorted(a,reverse=True)[y:]))

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