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