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
import math

from collections import defaultdict
from collections import deque
def load(vtype=int):
    return vtype(input().strip())
def load_list(seplator=" ", vtype=int):
    return [vtype(v) for v in input().strip().split(seplator)]
def exit():
    import sys
    sys.exit(0)
def perm_sub(li, used):
    if len(li) == len(used):
        return [deque()]
    k = []
    for i in range(len(li)):
        if i in used:
            continue
        used.add(i)
        sub_list = perm_sub(li, used)
        for sub in sub_list:
            sub.appendleft(li[i])
        k.extend(sub_list)
        used.discard(i)
    return k
def perm_li(li):
    return perm_sub(li, set())
def perm_n(n):
    return perm_sub(list(range(n)), set())
def join_i(li, sep=""):
    return sep.join([str(e) for e in li])
def li2n(li):
    n, base = 0, 1
    for i in range(len(li)-1, -1, -1):
        n += li[i] * base
        base *= 10
    return n
def sli2ili(li):
    return [int(s) for s in li] 
def prime_list(n):
    li = [i for i in range(2, n+1)]
    for i in range(len(li)):
        if li[i] >= int(math.sqrt(n)):
            break
        if li[i] == -1:
            continue
        for j in range(i+1, len(li)):
            if li[j] % li[i] == 0:
                li[j] = -1
    return [n for n in li if n != -1]
def gcd(a, b):
    a, b = max(a, b), min(a, b)
    while True:
        r = a % b
        if r == 0: return b
        a, b = b, r
def lcm(a, b):
    return int(a * b / gcd(a,b))
def all_subset(li):
    s = []
    n = len(li)
    for bit in range(0, (1<<(n+1))):
        ss = set()
        for i in range(0, n):
            if (bit & (1 << i)):
                ss.add(li[i])
        s.append(ss)
    return s
def factorial(n):
    if n == 1:
        return 1
    return n * factorial(n-1)
def mCn(m, n):
    def factorial_ntimes(m, n):
        r = 1
        while n:
            r *= m
            m -= 1
            n -= 1
        return r
    return int(factorial_ntimes(m, n) / factorial(n))

n, k = load_list()
H = load_list()

h = list(reversed(sorted(H)))
print(sum(h[k:]))

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

Solution (Python):
N, K = map(int, input().split())
lists = list(map(int, input().split()))
if K == 0:
    print(sum(lists))
    exit()

if K <= len(lists):
    
    
    lists = sorted(lists)[:N - K]
    print(sum(lists))
    exit()
else:
    print(0)
    exit()

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

if n <= k:
  print(0)
else:
  res = 0
  for i in range(k, n):
    res += List[i]
  print(res)

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

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

print(answer)

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

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

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

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

for ind in range(k):
    if len(h) != 0:
        h.pop(-1)   
print(sum(h))

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

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

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

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

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

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

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

h.sort(reverse=True)
del h[0:k]
print(sum(h))

Solution (Python):
from collections import deque
x,y = map(int, input().split())
li = list(map(int, input().split()))
li.sort(reverse=True)
q = deque(li)
if y >= len(li):
    print(0)
else:
    for i in range(y):
        q.popleft()
    s = 0
    for i in range(len(q)):
        s += q[i]
    print(s)

Solution (Python):
def main():
    num, k = map(int, input().split())
    a = list(map(int, input().split()))
    a = sorted(a, reverse=True)
    sum_attack = sum(a[k:])
    print(sum_attack)


if __name__ == "__main__":
    main()

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

print(sum(H))

Solution (Python):

from collections import Counter
def inputlist(): return [int(j) for j in input().split()]
N,K = inputlist()
H = inputlist()
H.sort()
H.reverse()
ans = 0
for i in range(K,N):
    ans += H[i]
print(ans)

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

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

A=sorted(H,reverse=True)
B=(A[k:n])
print(sum(B))

Solution (Python):
def q3():
    H,K = (int(i) for i in input().split())
    H = [int(i) for i in input().split()]
    H = sorted(H, reverse=True)
    ans = sum(H[K:])
    print(ans)

if __name__ == '__main__':
    q3()

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

if K > len(H):
    del H[:]

else:
    for j in range(K):
        del H[-1]
print(sum(H))

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 = map(int, input().split())
h = [int(i) for i in input().split()]
h.sort()
del h[-1:-ｋ-1:-1]
print(sum(h))

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

Solution (Python):
from collections import deque
from collections import Counter
from itertools import product, permutations,combinations
from operator import itemgetter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right, bisect




from fractions import gcd
from math import ceil,floor, sqrt, cos, sin, pi, factorial
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
from datetime import datetime as dt

def main():
  n,k = map(int, readline().split())
  h = list(map(int, readline().split()))
  if n<=k:
    print(0)
  else:
    h.sort(reverse=True)
    ans = sum(h[k:])
    print(ans)
  
  
if __name__ == '__main__':
  main()

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

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

monster_list = sorted(H, reverse=True)[:K]
ans = sum(H) - sum(monster_list)

print(ans)

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

Solution (Python):
h, a = map(int, input().split(" "))
aL = sorted(list(map(int, input().split(" "))), reverse=True)

print(sum(aL[a:]))

Solution (Python):
from collections import deque

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

A=list(map(int,input().split()))
A.sort(reverse=True)
A=A[K:]

print(sum(A))

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(sum(H))

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

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

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    
    from itertools import combinations, permutations, accumulate, groupby
    
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    

    
    

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


if __name__ == '__main__':
    main()

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

L=[]
for i in l:
    if k>0 :
        k-=1
    else:
        L.append(i)

S=sum(L)
print(S)

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

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

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

Solution (Python):
n, k = [int(i) for i in input().split()]
print(sum(list(reversed(sorted([int(i) for i in input().split()])))[k:]))

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

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

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

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

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

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

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

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

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

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

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

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

h.sort()

if n<k:
  k=n

for i in range(k):
  h[-1-i]=0

print(sum(h))

Solution (Python):
import numpy as np
n,k = map(int,input().split())
num_list = list(map(int,input().split()))
ans = 0
num_list = np.sort(num_list)[::-1]
num_list = np.array(num_list)

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

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

Solution (Python):

import sys


def solve(N: int, K: int, H: "List[int]"):
    print(sum(sorted(H, reverse=True)[K:]))
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    K = int(next(tokens))  
    H = [int(next(tokens)) for _ in range(N)]  
    solve(N, K, H)


if __name__ == '__main__':
    main()

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

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

print(sum(H))

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

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

y=sorted(x,reverse=True)

print(sum(y[n:]))

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=[int(i) for i in input().split(" ")]
H=[int(i) for i in input().split(" ")]
H.sort()
H.reverse()
print(sum(H[K:]))

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

H.sort()
for n in range(K):
    if H==[]:
        break
    H.pop()

print(sum(H))

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

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

H.sort(reverse=True)
for i in range(K):
    H[i] = 0
    if i+1 == N:
        break

print(sum(H))

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

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

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

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

Solution (Python):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n,k = iim()
H = sorted(iil(),reverse=True)[k::]
print(sum(H))

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

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

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

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

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

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

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

print(sum(move))

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

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


if __name__ == '__main__':
    main()

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

    print(sum(tmp1[K:]))
    

main()

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

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

if n <= k:
    print(0)

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

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

Solution (Python):
import heapq
import numpy

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

h = numpy.array(h)
h *= -1
h = list(h)
heapq.heapify(h)

for i in range(k):
    if i > n-1:
        break
    heapq.heappop(h)
print(sum(h)*-1)

Solution (Python):
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):
import heapq
n,k = map(int,input().split())
hlist = list(map(lambda x: int(x)*(-1),input().split()))

heapq.heapify(hlist)
if k < n:
  for i in range(k):
    heapq.heappop(hlist)
  print(-sum(hlist))
else:
  print(0)

Solution (Python):
import sys

n,k=map(int,input().split())
s=list(map(int,input().split()))
s.sort(reverse=True)

if k<len(s):
  for i in range(k):
    s[i]=0
else:
  for i in range(n):
    print(0)
    sys.exit()

print(sum(s))

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


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

sum = 0
a.sort()

for i in range(min(n,k)): a.pop()

for i in range(len(a)):
    sum += a[i]
print(sum)

Solution (Python):
readline = input().split()
monsters = input().split()
n = int(readline[0])
k = int(readline[1])
ans = 0

for i in range (n):
    monsters[i] = int(monsters[i])

monsters.sort()

if (k < n):
    for i in range (n - k):
        ans += monsters[i]

print(ans)

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

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

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

y=sorted(H)
y.sort(reverse=True)
x=0

for i in range (K,N):
    x=x+y[i]
    
print(x)

Solution (Python):
import sys

x = sys.stdin.readline()
x = x.split(' ')
(n,k)=[int(str) for str in x]

h = sys.stdin.readline()
h = h.split(' ')
h = [int(str) for str in h]
h = sorted(h,reverse=True)

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

print(sum)

sys.stdout.flush()

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

tmp = list(input().split())

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

tmp = sorted(tmp)

sum = 0

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

print (sum)

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

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

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

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


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

Solution (Python):
N, K = map(int, input().split())
H = list(map(int, input().split()))
H.sort()
print(0 if N<K else sum(H[:N-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):

N,K = (int(x) for x in input().split(" "))
H = list(map(int, input().split()))
tuujou_attack = 1



nokori_kaisu = 0
H_sorted = sorted(H)
if N <= K:
    nokori_kaisu = 0
else:
    nokori_hissatuwaza = N -K
    
    nokori_kaisu = sum( H_sorted[:nokori_hissatuwaza] ) 

print(nokori_kaisu)

Solution (Python):

N,K = (int(x) for x in input().split(" "))
H = list(map(int, input().split()))
tuujou_attack = 1



nokori_kaisu = 0
H_sorted = sorted(H)
if N <= K:
    nokori_kaisu = 0
else:
    nokori_hissatuwaza = N -K
    del H_sorted[nokori_hissatuwaza:]
    nokori_kaisu = sum( H_sorted ) 

print(nokori_kaisu)

Solution (Python):
import sys
import heapq
N,K=map(int,input().split())
H=list(map(lambda x: -int(x),input().split()))

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

heapq.heapify(H)

for i in range(K):
    heapq.heappop(H)

print(sum(H)*(-1))

Solution (Python):
from sys import exit

N, K = map(int, input().split())
monsters = [int(i) for i in input().split()]
if N <= K:
  print(0)
  exit()
monsters.sort()
attack = 0
for i in range(N - K):
  attack += monsters[i]
print(attack)

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

Solution (Python):
m_count, s_count = map(int, input().split())
monsters = list(map(int, input().split()))
monsters.sort(reverse=True)
del monsters[0:s_count]
count = sum(monsters)
print(count)

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


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

h.sort()

h.reverse()

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

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

li.sort()

ans = 0

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

for i in range(n-k):
    ans += li[i]
    
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):
x = [int(x) for x in input().split()]
line = [int(x) for x in input().split()]

line.sort(reverse = True)

if x[0] <= x[1]:
    print(0)
else:
    print(sum(line[x[1]:]))

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

Solution (Python):
n, k = [int(x) for x in input().split()]
H = sorted([int(x) for x in input().split()], reverse=True)
print(sum(H[k:]))

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

total = 0
h.sort(reverse = True)
for i in range(k,n):
    total += h[i]

print(total)

Solution (Python):
n,k = map(int,input().split())
h = sorted(list(map(int,input().split())))
for i in range(k):
  if i == n:
    break
  h.pop(-1)
print(sum(h))

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

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

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

h = sorted(h, reverse=True)

del h[:k]

print(sum(h) if h != 0 else 0)

Solution (Python):
a=input().split()
(n,m)=map(int,a)
b=input().split()
b1=list(map(int,b))
b1=sorted(b1)
for i in range(m):
    b1[len(b)-1-i]=0
    if i==len(b1)-1:
        break

print(sum(b1))

Solution (Python):
n, k = map(int, input().split())
h = list(map(int, input().split()))
h.sort()
ans = 0
if len(h) == n:
    for i in range(k):
        try:
            h.pop()
        except:
            pass
    for x in h:
        ans += x
    print(ans)

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

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

Solution (Python):
import math 

nk = input().split()
hl = input().split()


n = int(nk[0])
k = int(nk[1])

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

	h = sorted([int(i) for i in hl])
	hp = 0

	for i in hl:
		hp = hp + int(i)



	for i in range(k):
		hp = hp - int(h[-1-i])

	print(hp)

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

Solution (Python):
'''
    Auther: ghoshashis545 Ashis Ghosh
    College: jalpaiguri Govt Enggineerin College
    Date:23/03/2020
'''


from math import ceil
def main():
    
    
    
    n,m=map(int,input().split())
    
    a=list(map(int,input().split()))
    a.sort()
    ans=0
    for i in range(n-m):
        ans+=a[i]
    print(ans)
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
if __name__ =="__main__":
    main()

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

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

Solution (Python):
nk=input().rstrip().split(" ")
n=int(nk[0])
k=int(nk[1])
hps=input().rstrip().split(" ")
for i in range(n):
    hps[i]=int(hps[i])
shps=sorted(hps)

answer=0
for i in range(n-k):
    answer+=int(shps[i])
print(answer)

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

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

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

power = sorted(power, reverse=True)

print(sum(power[K:]))

Solution (Python):
n, k = map(int, input().split())
h = list(map(int, input().split()))
if n <= k:
    print(0)
    exit()
h.sort()
for i in range(k):
    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):N]))

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

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

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

for i in range(min(n, k)):
        del h[n - i - 1]

HP = sum(h)
print(HP)

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

for i in range(k):
    if n > i:
        del h[n - i - 1]

HP = sum(h)
print(HP)

Solution (Python):
data = input().split()
 
n = int(data[0])
k = int(data[1])
 
hpstr = input().split()
hp = []
 
for i in range(n):
  hp.append(int(hpstr[i]))
 
hp.sort()
 
ans = 0
for i in range(n - k):
  ans += hp[i]
 
print(ans)

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

h.sort(reverse=True)

ans = sum(h[min(k,n):n])

print(ans)

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

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

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

a.sort(reverse=True)

del a[:m]

ans = sum(a)

print(ans)

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

h = sorted(h)

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

print(b)

Solution (Python):

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

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

Solution (Python):
n, k = map(int, input().split())
s = list(map(int, input().split()))
if k > len(s):
    k = len(s)
s = sorted(s, reverse=True)

print(sum(s[k:]))

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

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

Solution (Python):
A,B = map(int,input().split())
num_list= list(map(int,input().split()))


sort_num_list = sorted(num_list)

if B >= len(num_list):
  print(0)
else:
  for i in range(B):
    test = sort_num_list.pop()
  print(sum(sort_num_list))

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

h_lst = sorted(h_lst, reverse=-1)
print(sum(h_lst[k:]))

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

Solution (Python):
n, k = map(int, input().split())
h = list(map(int, input().split()))
h.sort(reverse = True)
ans = 0
for enemy in h:
  if k > 0:
    k -= 1
  else:
    ans += enemy
print(ans)

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

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

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):
n,h=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
a.reverse()
c=[0]*2
c[0]=h
c[1]=len(a)
for k in range(0,min(c)):
  a[k]=0
print(sum(a))

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

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

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

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

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

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

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

al = l[k:]
print(sum(al))

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

ll=sorted(l,reverse=True)

ll=ll[b:]
print(sum(ll))

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

if k >= n:
    print(0)
    exit()
else:
    for i in range(k):
        h.pop()

print(sum(h))

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

print(sum(H[K:]))

Solution (Python):
N, K = map(int, input().split(' '))
H = sorted(map(int, input().split(' ')))
if(K >= N):
    print(0)
    exit(0)
for j in range(K):
    H[N - j - 1] = 0
print(sum(H))

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

Solution (Python):


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

hl.sort()
e = n-k
if e <= 0:
    print(0)
    exit()
s = sum(hl[:e])
print(s)

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

h.sort(reverse = True)

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

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