import heapq

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

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

memo = []
for t in T:
    memo.append(-t)
memo.sort()

for m in range(M):
    tmp = heapq.heappop(memo)
    tmp = int(tmp/2)
    heapq.heappush(memo,tmp)
print(-1*sum(memo)) import heapq heapq N,M = map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split M T = list(map(int,input().split())) T list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split memo = [] memo [] for t in T:
    memo.append(-t) t T memo.append(-t) memo.append memo append -t t memo.sort() memo.sort memo sort for m in range(M):
    tmp = heapq.heappop(memo)
    tmp = int(tmp/2)
    heapq.heappush(memo,tmp) m range(M) range M tmp = heapq.heappop(memo) tmp heapq.heappop(memo) heapq.heappop heapq heappop memo tmp = int(tmp/2) tmp int(tmp/2) int tmp/2 tmp 2 heapq.heappush(memo,tmp) heapq.heappush heapq heappush memo tmp print(-1*sum(memo)) print -1*sum(memo) -1 sum(memo) sum memo N,M = map(int,input().split()) map(int,input().split()) N tmp = int(tmp/2) int(tmp/2) tmp tmp = heapq.heappop(memo) heapq.heappop(memo) tmp M = map(int,input().split()) map(int,input().split()) M memo = [] [] memo T = list(map(int,input().split())) list(map(int,input().split())) T
import heapq

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

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

memo = []
for t in T:
    memo.append(-t)
memo.sort()

for m in range(M):
    tmp = heapq.heappop(memo)
    tmp = int(tmp/2)
    heapq.heappush(memo,tmp)
print(-1*sum(memo))
