N,M = list(map(int,input().split()))
A = list(map(int,input().split()))
A.sort(reverse=True)

discount_list = []
for a in A:
    while a > 0:
        discount = a//2
        discount_list.append(a-discount)
        a = discount
        
discount_list.sort(reverse=True)
# print(discount_list)

print(sum(A)-sum(discount_list[:M])) N,M = list(map(int,input().split())) N list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split M A = list(map(int,input().split())) A list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split A.sort(reverse=True) A.sort A sort reverse=True reverse True discount_list = [] discount_list [] for a in A:
    while a > 0:
        discount = a//2
        discount_list.append(a-discount)
        a = discount
         a A while a > 0:
        discount = a//2
        discount_list.append(a-discount)
        a = discount
         a > 0 a 0 discount = a//2 discount a//2 a 2 discount_list.append(a-discount) discount_list.append discount_list append a-discount a discount a = discount a discount discount_list.sort(reverse=True) discount_list.sort discount_list sort reverse=True reverse True print(sum(A)-sum(discount_list[:M])) print sum(A)-sum(discount_list[:M]) sum(A) sum A sum(discount_list[:M]) sum discount_list[:M] discount_list :M M A = list(map(int,input().split())) list(map(int,input().split())) A discount = a//2 a//2 discount M = list(map(int,input().split())) list(map(int,input().split())) M a = discount discount a discount_list = [] [] discount_list N,M = list(map(int,input().split())) list(map(int,input().split())) N
N,M = list(map(int,input().split()))
A = list(map(int,input().split()))
A.sort(reverse=True)

discount_list = []
for a in A:
    while a > 0:
        discount = a//2
        discount_list.append(a-discount)
        a = discount
        
discount_list.sort(reverse=True)
# print(discount_list)

print(sum(A)-sum(discount_list[:M]))