import math
import heapq
n, m = map(int, input().split())
a = list(map(int, input().split()))

lis = []
for i in a:
    lis.append(-1*i)

heapq.heapify(lis)

for _ in range(m):
    tmp = heapq.heappop(lis)
    heapq.heappush(lis, (-1)*(-tmp//2))

print(-sum(lis)) import math math import heapq heapq n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m a = list(map(int, input().split())) a list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split lis = [] lis [] for i in a:
    lis.append(-1*i) i a lis.append(-1*i) lis.append lis append -1*i -1 i heapq.heapify(lis) heapq.heapify heapq heapify lis for _ in range(m):
    tmp = heapq.heappop(lis)
    heapq.heappush(lis, (-1)*(-tmp//2)) _ range(m) range m tmp = heapq.heappop(lis) tmp heapq.heappop(lis) heapq.heappop heapq heappop lis heapq.heappush(lis, (-1)*(-tmp//2)) heapq.heappush heapq heappush lis (-1)*(-tmp//2) -1 -tmp//2 -tmp tmp 2 print(-sum(lis)) print -sum(lis) sum(lis) sum lis tmp = heapq.heappop(lis) heapq.heappop(lis) tmp a = list(map(int, input().split())) list(map(int, input().split())) a lis = [] [] lis m = map(int, input().split()) map(int, input().split()) m n, m = map(int, input().split()) map(int, input().split()) n
import math
import heapq
n, m = map(int, input().split())
a = list(map(int, input().split()))

lis = []
for i in a:
    lis.append(-1*i)

heapq.heapify(lis)

for _ in range(m):
    tmp = heapq.heappop(lis)
    heapq.heappush(lis, (-1)*(-tmp//2))

print(-sum(lis))