import heapq

N, M = map(int, input().split())
a_list = list(map(lambda x: int(x) * (-1), input().split()))
heapq.heapify(a_list)
for _ in range(M):
    min_num = heapq.heappop(a_list)
    heapq.heappush(a_list, (-1) * (-min_num // 2))
print(-sum(a_list)) import heapq heapq N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M a_list = list(map(lambda x: int(x) * (-1), input().split())) a_list list(map(lambda x: int(x) * (-1), input().split())) list map(lambda x: int(x) * (-1), input().split()) map lambda x: int(x) * (-1) int(x) * (-1) int(x) int x -1 x input().split() ().split () input split heapq.heapify(a_list) heapq.heapify heapq heapify a_list for _ in range(M):
    min_num = heapq.heappop(a_list)
    heapq.heappush(a_list, (-1) * (-min_num // 2)) _ range(M) range M min_num = heapq.heappop(a_list) min_num heapq.heappop(a_list) heapq.heappop heapq heappop a_list heapq.heappush(a_list, (-1) * (-min_num // 2)) heapq.heappush heapq heappush a_list (-1) * (-min_num // 2) -1 -min_num // 2 -min_num min_num 2 print(-sum(a_list)) print -sum(a_list) sum(a_list) sum a_list min_num = heapq.heappop(a_list) heapq.heappop(a_list) min_num M = map(int, input().split()) map(int, input().split()) M N, M = map(int, input().split()) map(int, input().split()) N a_list = list(map(lambda x: int(x) * (-1), input().split())) list(map(lambda x: int(x) * (-1), input().split())) a_list
import heapq

N, M = map(int, input().split())
a_list = list(map(lambda x: int(x) * (-1), input().split()))
heapq.heapify(a_list)
for _ in range(M):
    min_num = heapq.heappop(a_list)
    heapq.heappush(a_list, (-1) * (-min_num // 2))
print(-sum(a_list))
