# 優先度付キューのimport
import heapq

n, m = map(int, input().split())

a = [int(i) * -1 for i in input().split()]

heapq.heapify(a)

for i in range(m):
    minPrice = heapq.heappop(a)
    # 負の切捨てが面倒なので正の値にしてからまた負に戻す
    minPrice = -(abs(minPrice) // 2)
    heapq.heappush(a, minPrice)

sum = 0
for i in a:
    sum += -i

print(sum) import heapq heapq n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m int(i) * -1 for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) * -1 int(i) int i -1 a = [int(i) * -1 for i in input().split()] a [int(i) * -1 for i in input().split()] heapq.heapify(a) heapq.heapify heapq heapify a for i in range(m):
    minPrice = heapq.heappop(a)
    # 負の切捨てが面倒なので正の値にしてからまた負に戻す
    minPrice = -(abs(minPrice) // 2)
    heapq.heappush(a, minPrice) i range(m) range m minPrice = heapq.heappop(a) minPrice heapq.heappop(a) heapq.heappop heapq heappop a minPrice = -(abs(minPrice) // 2) minPrice -(abs(minPrice) // 2) abs(minPrice) // 2 abs(minPrice) abs minPrice 2 heapq.heappush(a, minPrice) heapq.heappush heapq heappush a minPrice sum = 0 sum 0 for i in a:
    sum += -i i a sum += -i sum -i i print(sum) print sum sum = 0 0 sum sum += -i -i sum a = [int(i) * -1 for i in input().split()] [int(i) * -1 for i in input().split()] a minPrice = heapq.heappop(a) heapq.heappop(a) minPrice minPrice = -(abs(minPrice) // 2) -(abs(minPrice) // 2) minPrice m = map(int, input().split()) map(int, input().split()) m n, m = map(int, input().split()) map(int, input().split()) n
# 優先度付キューのimport
import heapq

n, m = map(int, input().split())

a = [int(i) * -1 for i in input().split()]

heapq.heapify(a)

for i in range(m):
    minPrice = heapq.heappop(a)
    # 負の切捨てが面倒なので正の値にしてからまた負に戻す
    minPrice = -(abs(minPrice) // 2)
    heapq.heappush(a, minPrice)

sum = 0
for i in a:
    sum += -i

print(sum)