# 解説を読んだ。優先度付きキューね，はい。
import heapq


def main():
    item_no, discount_no = [int(x) for x in input().split()]
    prices = [int(x) * -1 for x in input().split()]
    heapq.heapify(prices)

    for _ in range(discount_no):
        current_max = heapq.heappop(prices)
        current_max = current_max * -1 // 2 * -1
        heapq.heappush(prices, current_max)

    print(- sum(prices))


if __name__ == '__main__':
    main() import heapq heapq def main():
    item_no, discount_no = [int(x) for x in input().split()]
    prices = [int(x) * -1 for x in input().split()]
    heapq.heapify(prices)

    for _ in range(discount_no):
        current_max = heapq.heappop(prices)
        current_max = current_max * -1 // 2 * -1
        heapq.heappush(prices, current_max)

    print(- sum(prices)) main int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x item_no, discount_no = [int(x) for x in input().split()] item_no [int(x) for x in input().split()] discount_no int(x) * -1 for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) * -1 int(x) int x -1 prices = [int(x) * -1 for x in input().split()] prices [int(x) * -1 for x in input().split()] heapq.heapify(prices) heapq.heapify heapq heapify prices for _ in range(discount_no):
        current_max = heapq.heappop(prices)
        current_max = current_max * -1 // 2 * -1
        heapq.heappush(prices, current_max)

     _ range(discount_no) range discount_no current_max = heapq.heappop(prices) current_max heapq.heappop(prices) heapq.heappop heapq heappop prices current_max = current_max * -1 // 2 * -1 current_max current_max * -1 // 2 * -1 current_max * -1 // 2 current_max * -1 current_max -1 2 -1 heapq.heappush(prices, current_max) heapq.heappush heapq heappush prices current_max print(- sum(prices)) print - sum(prices) sum(prices) sum prices if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    item_no, discount_no = [int(x) for x in input().split()]
    prices = [int(x) * -1 for x in input().split()]
    heapq.heapify(prices)

    for _ in range(discount_no):
        current_max = heapq.heappop(prices)
        current_max = current_max * -1 // 2 * -1
        heapq.heappush(prices, current_max)

    print(- sum(prices)) def main():
    item_no, discount_no = [int(x) for x in input().split()]
    prices = [int(x) * -1 for x in input().split()]
    heapq.heapify(prices)

    for _ in range(discount_no):
        current_max = heapq.heappop(prices)
        current_max = current_max * -1 // 2 * -1
        heapq.heappush(prices, current_max)

    print(- sum(prices)) main
# 解説を読んだ。優先度付きキューね，はい。
import heapq


def main():
    item_no, discount_no = [int(x) for x in input().split()]
    prices = [int(x) * -1 for x in input().split()]
    heapq.heapify(prices)

    for _ in range(discount_no):
        current_max = heapq.heappop(prices)
        current_max = current_max * -1 // 2 * -1
        heapq.heappush(prices, current_max)

    print(- sum(prices))


if __name__ == '__main__':
    main()
