from heapq import heapify, heappop, heappush
N, M = map(int, input().split())
A = [-a for a in list(map(int, input().split()))]
heapify(A)
for _ in range(M):
  p = heappop(A)
  heappush(A, -((-p)//2))
print(-sum(A)) from heapq import heapify, heappop, heappush N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M -a for a in list(map(int, input().split())) for a in list(map(int, input().split())) a list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split for a in list(map(int, input().split())) -a a A = [-a for a in list(map(int, input().split()))] A [-a for a in list(map(int, input().split()))] heapify(A) heapify A for _ in range(M):
  p = heappop(A)
  heappush(A, -((-p)//2)) _ range(M) range M p = heappop(A) p heappop(A) heappop A heappush(A, -((-p)//2)) heappush A -((-p)//2) (-p)//2 -p p 2 print(-sum(A)) print -sum(A) sum(A) sum A A = [-a for a in list(map(int, input().split()))] [-a for a in list(map(int, input().split()))] A p = heappop(A) heappop(A) p M = map(int, input().split()) map(int, input().split()) M N, M = map(int, input().split()) map(int, input().split()) N
from heapq import heapify, heappop, heappush
N, M = map(int, input().split())
A = [-a for a in list(map(int, input().split()))]
heapify(A)
for _ in range(M):
  p = heappop(A)
  heappush(A, -((-p)//2))
print(-sum(A))