from bisect import bisect_left as b

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

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

a.sort()

while m>0:

  i=a.pop(-1)//2

  a.insert(b(a,i),i)

  m-=1

print((sum(a)))
import heapq



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

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

heapq.heapify(A)



for _ in range(M):

  tmp_min = heapq.heappop(A)

  heapq.heappush(A, (-1) * (-tmp_min // 2))



print((-sum(A)))
from bisect import bisect_left as b

n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
a.sort()
while m > 0:
    i = a.pop(-1) // 2
    a.insert(b(a, i), i)
    m -= 1
print((sum(a)))

import heapq

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

-from bisect import bisect_left as b +import heapq -n, m = list(map(int, input().split())) -a = list(map(int, input().split())) -a.sort() -while m > 0: -    i = a.pop(-1) // 2 -    a.insert(b(a, i), i) -    m -= 1 -print((sum(a))) +N, M = list(map(int, input().split())) +A = list([int(x) * (-1) for x in input().split()]) +heapq.heapify(A) +for _ in range(M): +    tmp_min = heapq.heappop(A) +    heapq.heappush(A, (-1) * (-tmp_min // 2)) +print((-sum(A)))