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

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

for i in range(N):
  A[i]*=-1
heapq.heapify(A)
for i in range(M):
  n=heapq.heappop(A)
  heapq.heappush(A,-((-n)//2))
print(-sum(A)) 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 for i in range(N):
  A[i]*=-1 i range(N) range N A[i]*=-1 A[i] A i -1 heapq.heapify(A) heapq.heapify heapq heapify A for i in range(M):
  n=heapq.heappop(A)
  heapq.heappush(A,-((-n)//2)) i range(M) range M n=heapq.heappop(A) n heapq.heappop(A) heapq.heappop heapq heappop A heapq.heappush(A,-((-n)//2)) heapq.heappush heapq heappush A -((-n)//2) (-n)//2 -n n 2 print(-sum(A)) print -sum(A) sum(A) sum A M=map(int,input().split()) map(int,input().split()) M n=heapq.heappop(A) heapq.heappop(A) n N,M=map(int,input().split()) map(int,input().split()) N A=list(map(int,input().split())) list(map(int,input().split())) A
import heapq
N,M=map(int,input().split())

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

for i in range(N):
  A[i]*=-1
heapq.heapify(A)
for i in range(M):
  n=heapq.heappop(A)
  heapq.heappush(A,-((-n)//2))
print(-sum(A))