from heapq import heappop, heappush, heapify

n, m = map(int, input().split())
arr = list(map(int, input().split()))
arr = [-x for x in arr]

heapify(arr)

for _ in range(m):
    a = heappop(arr)
    heappush(arr, -(-a // 2))

print(-sum(arr)) from heapq import heappop, heappush, heapify n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m arr = list(map(int, input().split())) arr list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split -x for x in arr for x in arr x arr for x in arr -x x arr = [-x for x in arr] arr [-x for x in arr] heapify(arr) heapify arr for _ in range(m):
    a = heappop(arr)
    heappush(arr, -(-a // 2)) _ range(m) range m a = heappop(arr) a heappop(arr) heappop arr heappush(arr, -(-a // 2)) heappush arr -(-a // 2) -a // 2 -a a 2 print(-sum(arr)) print -sum(arr) sum(arr) sum arr arr = list(map(int, input().split())) list(map(int, input().split())) arr a = heappop(arr) heappop(arr) a n, m = map(int, input().split()) map(int, input().split()) n m = map(int, input().split()) map(int, input().split()) m arr = [-x for x in arr] [-x for x in arr] arr
from heapq import heappop, heappush, heapify

n, m = map(int, input().split())
arr = list(map(int, input().split()))
arr = [-x for x in arr]

heapify(arr)

for _ in range(m):
    a = heappop(arr)
    heappush(arr, -(-a // 2))

print(-sum(arr))