import heapq

N, M = map(int, input().split())
A = sorted(list(map(int, input().split())), reverse=True)
A = list(map(lambda x: x * (-1), A))
heapq.heapify(A)

for x in range(M):
    maxA = heapq.heappop(A)
    heapq.heappush(A, -1 * ((-1 * maxA) // 2))
A = list(map(lambda x: x * (-1), A))

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 = sorted(list(map(int, input().split())), reverse=True) A sorted(list(map(int, input().split())), reverse=True) sorted list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split reverse=True reverse True A = list(map(lambda x: x * (-1), A)) A list(map(lambda x: x * (-1), A)) list map(lambda x: x * (-1), A) map lambda x: x * (-1) x * (-1) x -1 x A heapq.heapify(A) heapq.heapify heapq heapify A for x in range(M):
    maxA = heapq.heappop(A)
    heapq.heappush(A, -1 * ((-1 * maxA) // 2)) x range(M) range M maxA = heapq.heappop(A) maxA heapq.heappop(A) heapq.heappop heapq heappop A heapq.heappush(A, -1 * ((-1 * maxA) // 2)) heapq.heappush heapq heappush A -1 * ((-1 * maxA) // 2) -1 (-1 * maxA) // 2 -1 * maxA -1 maxA 2 A = list(map(lambda x: x * (-1), A)) A list(map(lambda x: x * (-1), A)) list map(lambda x: x * (-1), A) map lambda x: x * (-1) x * (-1) x -1 x A print(sum(A)) print sum(A) sum A A = list(map(lambda x: x * (-1), A)) list(map(lambda x: x * (-1), A)) A A = list(map(lambda x: x * (-1), A)) list(map(lambda x: x * (-1), A)) A maxA = heapq.heappop(A) heapq.heappop(A) maxA A = sorted(list(map(int, input().split())), reverse=True) sorted(list(map(int, input().split())), reverse=True) A M = map(int, input().split()) map(int, input().split()) M N, M = map(int, input().split()) map(int, input().split()) N
import heapq

N, M = map(int, input().split())
A = sorted(list(map(int, input().split())), reverse=True)
A = list(map(lambda x: x * (-1), A))
heapq.heapify(A)

for x in range(M):
    maxA = heapq.heappop(A)
    heapq.heappush(A, -1 * ((-1 * maxA) // 2))
A = list(map(lambda x: x * (-1), A))

print(sum(A))
