import heapq



N,M = list(map(int,input().split()))

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

value = []



for v in original_value:

  heapq.heappush(value,v*(-1))



for i in range(M):

  num = (heapq.heappop(value)*(-1)//2)*(-1)

  heapq.heappush(value,num)



print((sum(list([x*(-1) for x in value]))))

import heapq



N,M = list(map(int,input().split()))

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

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

heapq.heapify(value)



for i in range(M):

  num = (heapq.heappop(value)*(-1)//2)*(-1)

  heapq.heappush(value,num)



print((sum(list([x*(-1) for x in value]))))

import heapq

N, M = list(map(int, input().split()))
original_value = list(map(int, input().split()))
value = []
for v in original_value:
    heapq.heappush(value, v * (-1))
for i in range(M):
    num = (heapq.heappop(value) * (-1) // 2) * (-1)
    heapq.heappush(value, num)
print((sum(list([x * (-1) for x in value]))))

import heapq

N, M = list(map(int, input().split()))
value = list(map(int, input().split()))
value = list([x * (-1) for x in value])
heapq.heapify(value)
for i in range(M):
    num = (heapq.heappop(value) * (-1) // 2) * (-1)
    heapq.heappush(value, num)
print((sum(list([x * (-1) for x in value]))))

-original_value = list(map(int, input().split())) -value = [] -for v in original_value: -    heapq.heappush(value, v * (-1)) +value = list(map(int, input().split())) +value = list([x * (-1) for x in value]) +heapq.heapify(value)