import heapq

import sys

input = sys.stdin.readline



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

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

A = list([x*(-1) for x in A])

heapq.heapify(A)



for _ in range(m):

    max_price = -heapq.heappop(A) // 2

    heapq.heappush(A, -max_price)



total = -sum(A)

print(total)

import heapq



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

A = list([-int(x) for x in input().split()])

heapq.heapify(A)

for _ in range(m):

    max_price = -heapq.heappop(A) // 2

    heapq.heappush(A, -max_price)

total = -sum(A)

print(total)

import heapq
import sys

input = sys.stdin.readline
n, m = list(map(int, input().split()))
A = list(map(int, input().split()))
A = list([x * (-1) for x in A])
heapq.heapify(A)
for _ in range(m):
    max_price = -heapq.heappop(A) // 2
    heapq.heappush(A, -max_price)
total = -sum(A)
print(total)

import heapq

n, m = list(map(int, input().split()))
A = list([-int(x) for x in input().split()])
heapq.heapify(A)
for _ in range(m):
    max_price = -heapq.heappop(A) // 2
    heapq.heappush(A, -max_price)
total = -sum(A)
print(total)

-import sys -input = sys.stdin.readline -A = list(map(int, input().split())) -A = list([x * (-1) for x in A]) +A = list([-int(x) for x in input().split()])