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

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

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

del h[0:k]

print(sum(h))

Solution (Python):
"""
NTC here
"""
import sys
inp= sys.stdin.readline
input = lambda : inp().strip()
flush= sys.stdout.flush




def iin(): return int(input())
def lin(): return list(map(int, input().split()))





def main():
    n, k = lin()
    a = lin()
    a.sort(reverse=True)
    for i in range(min(k, n)):
        a[i]=0
    
    print(sum(a))



            
        

        
main()

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

H.sort()

kill = min(N, K)

H = H[0:N-kill]

print(sum(H))

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

H.sort()
s = 0

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

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

if (len(A)-K)>=0:
    h=A[0:(len(A)-K)]
    print(sum(h))
else:
    print(0)

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

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

Solution (Python):


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

t = min(n, k)


ans = sum(h[0:(n-t)])
print(ans)

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

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

tmp = 0

if n <= k:
    print(0)

else:
    h.sort(reverse=True)

    for i in range(k, len(h)):
        tmp += h[i]
    
    print(tmp)

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

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

H.sort()
print(sum(H[0:len(H)-K]))

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

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

H.sort(reverse= True)

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

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=map(int,input().split())
H=list(map(int,input().split() ))
J=[]
import heapq

for i in range(N):
  J.append((-1)*H[i])

heapq.heapify(J)
for l in range(K):
  if l <N:
    heapq.heappop(J)
  
print((-1)*sum(J))

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

Solution (Python):
def main():
    from sys import stdin, setrecursionlimit
    
    
    r = stdin.readline()[:-1]
    
    
    
    
    
    
    n,k = map(int, r.split())
    r = stdin.readline()[:-1]
    a = list(map(int, r.split()))
    
    
    

    if n <= k:
        print(0)
    elif k == 0:
        print(sum(a))
    else:
        a.sort()
        print(sum(a[:-k]))
    

if __name__ == '__main__':
    main()

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

print(ans)

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

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

S = sum(Hs[K:])

print(S)

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

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

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

Solution (Python):

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

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

Solution (Python):
import bisect
import numpy as np
import math
import itertools
def main():
    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)
        H = H[:-K]
        print(sum(H))


    return 0
if __name__ == '__main__':
    main()

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

for i in range(min(K,N)):
  if K > 0:
    List[i] = 0
    K -= 1

a = sum(List)
print(int(a))

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

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

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

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

Solution (Python):
N,K = map(int,input().split())
H = list(map(int,input().split()))
if N<=K:
  print(0);exit()

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

print(ans)

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

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

H.sort(reverse=True)

for i  in range(min(K,len(H))):
    H[i] = 0

print(sum(H))

Solution (Python):
def resolve():
    import sys
    input = sys.stdin.readline
    
    N, K = map(int, input().split())
    H = list(map(int, input().split()))

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

if __name__ == "__main__":
    resolve()

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

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

a.sort()

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

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

Solution (Python):
n,k=map(int,input().split())
hl=list(map(int,input().split()))
ans=0
if n<=k:
    print(0)
else:
    hl.sort(reverse=True)
    temp=hl[(k+1)-1:n]
    for v in temp:
        ans+=v
    print(ans)

Solution (Python):
import unittest


class TestC(unittest.TestCase):
    def test_1(self):
        self.assertEqual(think(1, [4, 1, 5]), 5)

    def test_2(self):
        self.assertEqual(think(9, [7, 9, 3, 2, 3, 8, 4, 6]), 0)

    def test_3(self):
        self.assertEqual(think(0, [1000000000, 1000000000, 1000000000]), 3000000000)


def solve():
    k, h = read()
    result = think(k, h)
    write(result)


def read():
    n, k = read_int(2)
    return k, read_int(n)


def read_int(n):
    return read_type(int, n, sep=' ')


def read_float(n):
    return read_type(float, n, sep=' ')


def read_type(t, n, sep):
    return list(map(lambda x: t(x), read_line().split(sep)))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(k, h):
    if k >= len(h):
        return 0
    h.sort(key=lambda x: -x)
    h[0:k] = [0] * k
    return sum(h)


def write(result):
    print(result)


if __name__ == '__main__':
    
    solve()

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

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

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

H.sort(reverse=True)

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

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

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

L.sort(reverse=True)



if K >= N:
    print(0)
else:
    for i in range(K):
        L[i] = 0
    ans = sum(L)
    print(ans)

Solution (Python):

 
import math
import itertools
import sys
import copy
 






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

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

h.sort()
count = 0



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

print(count)

Solution (Python):
a,b = map(int, input().split())
box = list(map(int, input().split()))
box.sort(reverse=True)
ans = sum(box[b:])
print(ans)

Solution (Python):


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

Solution (Python):
import sys

stdin = sys.stdin

mod = 1000000007
inf = 1 << 60

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

n, k = na()
h = na()
h.sort()
h.reverse()

ans = 0

j = 0
for i in range(n):
    if h[i] > 0:
        if j < k:
            h[i] = 0
            j += 1
        else:
            ans += h[i]
            h[i] = 0

print(ans)

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

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

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

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

Solution (Python):
import math

n, k = 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):
n,k = map(int,input().split())
h = list(map(int,input().split()))
h.sort()
h.reverse()
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()))

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

Solution (Python):
from sys import stdin
H,K = [int(x) for x in stdin.readline().rstrip().split()]
H = [int(x) for x in stdin.readline().rstrip().split()]
print(sum(sorted(H)[::-1][K:]))

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

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

x.sort(reverse=True)

sum = 0

for kk in range(b,a):
    sum += x[kk]


print(sum)

Solution (Python):


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

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

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

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

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

Solution (Python):
import sys
from pprint import pprint

def solve(n, k, h):
    h.sort(reverse=True)
    target = h[k:] if k < n else [0]
    print(sum(target))

if __name__ == '__main__':
    n, k = map(int, sys.stdin.readline().strip().split(" "))
    h = list(map(int,sys.stdin.readline().strip().split(" ")))
    
    solve(n, k, h)

Solution (Python):

from fractions import gcd 
from functools import reduce

def pin(type=int):
    return map(type,input().split())

N,K =pin()
H = list(pin())

H.sort()

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

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

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

h.sort()

while k > 0 and len(h) > 0:
    h.pop(-1)
    k -= 1

print(sum(h))

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

H.sort(reverse = True)

del H[0:K]

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

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

Solution (Python):
nk = list(map(int, input().split()))
h = list(map(int, input().split()))
n = nk[0]
k = nk[1]
if n <= k:
    print(0)
    exit()

h.sort()
res = sum(h[:n-k])
print(res)

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

Solution (Python):
n, k = list(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()))
if k>=n:
    print(0)
else:
    h.sort(reverse=True)
    nh = h[k:]
    print(sum(nh))

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

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

if (n <= k):
   print(0)
else:
   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_ = sorted(H)

ans = 0

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

print(ans)

Solution (Python):
def num():
    return int(input())
def nums():
    return list(map(int,input().split()))

import itertools as iter
import math
import fractions
from functools import reduce

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

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

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

print(ans)

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

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

H.sort()

num = 0
for i in range(N[0]-N[1]):
    num += H[i]
print(num)

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

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

Solution (Python):
import math
import decimal
import queue
import bisect
import heapq
import time
import itertools

mod = int(1e9+7)

class Library():
    @staticmethod
    def Swap(a,b):
        return [b,a]

    @staticmethod
    def myRound(a,dig=0): 
        p = 10 ** dig
        return (a * p * 2 + 1) // 2 / p

    @staticmethod
    def Roundup(a,dig=0): 
        if a < 0:
            return int(a)
        else:
            return int(a + 0.9)

    @staticmethod
    def Gcd(a,b): 
        if (a<b):
            a,b = Library.Swap(a,b)
        if (b==0):
            return a
        else:
            return Library.Gcd(b,a%b)

    @staticmethod
    def Lcm(a,b): 
        return a//Library.Gcd(a,b)*b

    @staticmethod
    def Divisors(a): 
        divisors = []
        for i in range(1,int(a**0.5)+1):
            if a%i==0:
                divisors.append(i)
                if i!=a//i:
                    divisors.append(a//i)
        divisors.sort()
        return divisors

class Prime():
    
    
    def __init__(self,num):
        self.num = num
        self.sieve = [0] * (self.num + 1)
        self.sieve[0] = -1
        self.sieve[1] = -1
        for i in range(2,self.num + 1):
            if not self.sieve[i]:
                self.sieve[i] = i
                for j in range(i * i,self.num + 1,i):
                    if self.sieve[j]:
                        self.sieve[j] = i
    
    
    def isPrime(self,num = None):
        if num is None:
            num = self.num
        if self.sieve[num] == num:
            return True
        else:
            return False
    
    
    def PrimeNum(self,num = None):
        if num is None:
            num = self.num
        prime = []
        for i in range(2,num):
            if self.sieve[i] == i:
                prime.append(i)
        return prime
    
    
    def PrimeFact(self,num = None):
        if num is None:
            num = self.num
        fact = []
        while self.sieve[num] != num:
            fact.append(self.sieve[num])
            num //= self.sieve[num]
        fact.append(num)
        return fact

def main():
    n,k = map(int,input().split())
    h = list(map(int,input().split()))
    h.sort()
    ans = 0
    for i in range(k):
        if len(h) == 0:
            break
        del h[-1]
    ans += sum(h)
    print(ans)
    return

if __name__=='__main__':
    main()

Solution (Python):



def input_one_number():
    return int(input())


def input_multiple_number():
    return map(int, input().split())


def input_multiple_number_as_list():
    return list(map(int, input().split()))


def input_multiple_number_as_list_sep(N):
    ins = []
    for i in range(N):
        ins.append(input())
    return ins


def input_map():
    return [list(map(int,list(input()))) for i in range(h)]


def print_list(list):
    print(*list)
    return


def print_map(maplist):
    for i in maplist:print(*i, sep='')
    return


def generate_primenums():
    n = 100
    primes = set(range(2, n+1))
    for i in range(2, int(n**0.5+1)):
        primes.difference_update(range(i*2, n+1, i))
    primes=list(primes)
    return primes

def memo():
    a=[0]*5
    b=a  
    b2=a[:]  
    a[1]=3
    print('b:{}, b2:{}'.format(b,b2))  
    
    import copy
    a= [[0]*3 for i in range(5)] 
    b=copy.deepcopy(a)  
    
    
    odd=[i for i in range(100) if i%2==1] 

    
    import bisect
    a = [1, 2, 3, 5, 6, 7, 8, 9]
    b=bisect.bisect_left(a, 8)

    
    from itertools import permutations, combinations,combinations_with_replacement,product
    a=['a','b','C']
    print(list(permutations(a)))
    print(list(combinations(a,2)))
    print(list(combinations_with_replacement(a,3)))



def kaijo(n):
    import math
    return math.factorial(n)


def num_combination(n,r):
    import math
    return math.factorial(n) // math.factorial(n - r)



def calc_gcd(a,b):
    import fractions
    GCD=fractions.gcd(a,b)
    lcm=a*b//gcd
    return gcd,lcm


def calc_gcd_list(l):
    gcd = l[0]
    for i in range(1, N):
        gcd = fractions.gcd(gcd, l[i])
    return gcd


def sum_digit(n):
    sum = 0
    while n > 0:
        sum += n%10
        n //= 10
    return sum

givenN,givenK = input_multiple_number()
lst_h = input_multiple_number_as_list()

lst_h.sort()

if givenK != 0:
    lst_h = lst_h[:-givenK]

damage = 0
for a in lst_h:
    damage += a

print(damage)

Solution (Python):
n_k = list(map(lambda x: int(x), input().split(" ")))
N = n_k[0]
K = n_k[1]
Hs = list(map(lambda x: int(x), input().split(" ")))
Hs = reversed(sorted(Hs))
result = 0
for h in Hs:
    if K > 0:
        K -= 1
        continue
    result += h

print(result)

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

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

if K >= N:
    print(0)
else:
    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()))
ans = 0

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

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

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

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

Solution (Python):
def main():
    N,K = 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):
import math
n,k=map(int,input().split())
arr=list(map(int,input().split()))
arr.sort(reverse=True)
ss=0
for i in range(k,len(arr)):
	ss+=arr[i]
print(ss)

Solution (Python):
import heapq

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

hq=[]
for h in hlist:
  heapq.heappush(hq,-h)
  
for i in range(K):
  hmax=heapq.heappop(hq)
  heapq.heappush(hq,0)
  
print(-sum(hq))

Solution (Python):
hn=input().split(" ")
N=int(hn[0])
K=int(hn[1])
H=input().split(" ")
H=[int(s) for s in H]
H.sort(reverse=True)

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

print(ans)

Solution (Python):




def solve(N, K, H):
    H.sort(reverse=True)
    if N <= K:
        return 0

    for i in range(K):
        H[i] = 0
    return sum(H)




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








print(solve(N, K, H))

Solution (Python):
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    N, K = map(int, input().split())
    H = list(map(int, input().split()))

    H.sort(reverse=1)
    for i in range(min(N, K)):
        H[i] = 0
    print(sum(H))


main()

Solution (Python):
a, b = map(int, input().split())
c = list(map(int, input().split()))
c = sorted(c, reverse=True)
d = 1
ans = 0
for i in c:
    if(d<=b):
        d+=1
    else:ans+=i
    
print(ans)

Solution (Python):

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

Solution (Python):
import numpy as np

n, k = list(map(int, input().split()))
A = list(map(int, input().split()))
A = np.sort(A)[::-1]

num = float(0)
for i, a in enumerate(A):
    if i >= k:
        num += a

print(int(num))

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

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

print(sum(h))

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

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

Solution (Python):
def main():
    n,k = map(int,input().split())
    lst = list(map(int,input().split()))
    lst.sort()
    for _ in range(k):
        if len(lst) == 0:
            break
        del lst[-1]
    print(sum(lst))
if __name__ == '__main__':
    main()

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

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

h = sorted(h, reverse=True)
s = 0

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

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

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

if k==0:
    print(sum(li))
    exit()

if k>=n:
    print("0")
    exit()

for i in range(k):
    li[i]=0

print(sum(li))

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

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

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


H.sort()
if len(H) <= K:
    ans = 0
elif K == 0:
    ans = sum(H)
else:
    H = H[:-K]
    ans = sum(H)

print(ans)

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

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

Solution (Python):
from sys import stdin


n,k = map(int, stdin.readline().rstrip().split())
Hs = list(map(int, stdin.readline().rstrip().split()))


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

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

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

h.sort()

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

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

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

print(cnt)

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

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

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

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

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

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

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

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


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

Solution (Python):
import sys
inputs = sys.stdin.readlines()

n, k = map(int, inputs[0].split())
H = list(map(int, inputs[1].split()))

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

Solution (Python):


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

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

lstM.sort(reverse = True)

print(sum(lstM[K:]))

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

Solution (Python):
n, k = [int(s) for s in input().strip().split()]
H = [int(s) for s in input().strip().split()]

if k >= n:
    result = 0
else:
    H.sort()
    result = sum(H[:n - k])

print(result)

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

print(sum(H_list[K:]))

Solution (Python):
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(reverse=True)

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

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

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

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

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

H.sort()

f = True
for i in range(K):
    try:
        H.pop(-1)
    except:
        break
        f = False
if f:
    print(sum(H))
else:
    print(0)

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

	for i in range(b):
		if len(l) > 0:
			l.pop(-1)
	print(sum(l))



	

if __name__ == '__main__':
	main()

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

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

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

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

lst.sort()
lst2= lst[0:n-k]

print(sum(lst2))

Solution (Python):
from bisect import bisect_right, bisect_left
from itertools import groupby, permutations, combinations
from fractions import gcd
import numpy as np
from sys import stdin, stderr


def lcm(x, y):
    return (x * y) // gcd(x, y)


def main():
    N, K = [int(x) for x in input().split()]
    if K >= N:
        return 0
    H = [int(x) for x in input().split()]
    ret = 0
    H.sort()
    for i in range(N - K):
        ret += H[i]
    return ret


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

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

print sum(H[K:])

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

higher = sorted(Hn)[::-1]
print(sum(higher[K:]))

Solution (Python):
N, K = map(int,input().split())
H = list(map(int,input().split()))
H.sort(reverse=True)
t = 0
for h in H:
    if K > 0:
        K -= 1
        t += h
    else:break
print(sum(H)-t)

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

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


hh = sorted(h)

for _ in range(k):
    hh.pop()

s = sum(hh)
print(s)

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

cnt = 0
for i in range(n):
    if cnt < k:
        cnt += 1
        sum_h -= h[i]

print(sum_h)