import heapq

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

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

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

heapq.heapify(A)



while M > 0:

    heapq.heappush(A, -(-heapq.heappop(A) // 2))

    M -= 1



print((-sum(A)))

import heapq

def f(str):

    return -int(str)



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

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

heapq.heapify(A)



while M > 0:

    heapq.heappush(A, -(-heapq.heappop(A) // 2))

    M -= 1



print((-sum(A)))

import heapq

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

import heapq


def f(str):
    return -int(str)


N, M = list(map(int, input().split()))
A = list(map(f, input().split()))
heapq.heapify(A)
while M > 0:
    heapq.heappush(A, -(-heapq.heappop(A) // 2))
    M -= 1
print((-sum(A)))

+ +def f(str): +    return -int(str) + + -A = list(map(int, input().split())) -A = list([-x for x in A]) +A = list(map(f, input().split()))