from heapq import *

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

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



q=[]

for x in a:

  heappush(q,-x)

  

for i in range(m):

  temp=-heappop(q)

  heappush(q,-(temp//2))

  

print((-sum(q)))
from heapq import *

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

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

q = []

for i in a:

  heappush(q,-i)

#print(q)

for j in range(m):

  temp = -heappop(q)

  temp //= 2

  heappush(q,-temp)

  #print(q)

print((-(sum(q))))
from heapq import *

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

from heapq import *

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

-for x in a: -    heappush(q, -x) -for i in range(m): +for i in a: +    heappush(q, -i) +# print(q) +for j in range(m): -    heappush(q, -(temp // 2)) -print((-sum(q))) +    temp //= 2 +    heappush(q, -temp) +    # print(q) +print((-(sum(q))))