import heapq
N, M = map(int, input().split())
A = list(map(int, input().split()))
A = [-a for a in A]
heapq.heapify(A)

for i in range(M):
    most_expensive = -heapq.heappop(A)
    most_expensive //= 2
    heapq.heappush(A, -most_expensive)

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

for i in range(M):
    most_expensive = -heapq.heappop(A)
    most_expensive //= 2
    heapq.heappush(A, -most_expensive)

print(-sum(A))


