import heapq



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

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

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

heapq.heapify(aa)

for i in range(m):

    max=heapq.heappop(aa)

    heapq.heappush(aa,max//2+max%2)

print((-1*sum(aa)))
from heapq import heappush, heappop



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

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

hp=[]

for i in a:

    heappush(hp,-i)

for i in range(m):

    max=heappop(hp)

    heappush(hp, -(-max//2))

print((-sum(hp)))
import heapq

n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
aa = list([x * (-1) for x in a])
heapq.heapify(aa)
for i in range(m):
    max = heapq.heappop(aa)
    heapq.heappush(aa, max // 2 + max % 2)
print((-1 * sum(aa)))

from heapq import heappush, heappop

n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
hp = []
for i in a:
    heappush(hp, -i)
for i in range(m):
    max = heappop(hp)
    heappush(hp, -(-max // 2))
print((-sum(hp)))

-import heapq +from heapq import heappush, heappop -aa = list([x * (-1) for x in a]) -heapq.heapify(aa) +hp = [] +for i in a: +    heappush(hp, -i) -    max = heapq.heappop(aa) -    heapq.heappush(aa, max // 2 + max % 2) -print((-1 * sum(aa))) +    max = heappop(hp) +    heappush(hp, -(-max // 2)) +print((-sum(hp)))