import heapq

N,M = map(int,input().split())
A = list(map(int,input().split()))
A = [a*-1 for a in A]

heapq.heapify(A)

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

N,M = map(int,input().split())
A = list(map(int,input().split()))
A = [a*-1 for a in A]

heapq.heapify(A)

for _ in range(M):
  a = heapq.heappop(A)
  heapq.heappush(A,-(-a//2))
  
print(sum(A)*-1)