import heapq
import sys

lines = sys.stdin.readlines()

N, M = [int(n) for n in lines[0].strip().split()]
prices = [-int(n) for n in lines[1].strip().split()]

heapq.heapify(prices)

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

print(-sum(prices)) import heapq heapq import sys sys lines = sys.stdin.readlines() lines sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines int(n) for n in lines[0].strip().split() for n in lines[0].strip().split() n lines[0].strip().split() [0].strip().split [0].strip() [0].strip [0] lines 0 strip split for n in lines[0].strip().split() int(n) int n N, M = [int(n) for n in lines[0].strip().split()] N [int(n) for n in lines[0].strip().split()] M -int(n) for n in lines[1].strip().split() for n in lines[1].strip().split() n lines[1].strip().split() [1].strip().split [1].strip() [1].strip [1] lines 1 strip split for n in lines[1].strip().split() -int(n) int(n) int n prices = [-int(n) for n in lines[1].strip().split()] prices [-int(n) for n in lines[1].strip().split()] heapq.heapify(prices) heapq.heapify heapq heapify prices for _ in range(M):
    price = -heapq.heappop(prices)
    heapq.heappush(prices, -1 * (price // 2)) _ range(M) range M price = -heapq.heappop(prices) price -heapq.heappop(prices) heapq.heappop(prices) heapq.heappop heapq heappop prices heapq.heappush(prices, -1 * (price // 2)) heapq.heappush heapq heappush prices -1 * (price // 2) -1 price // 2 price 2 print(-sum(prices)) print -sum(prices) sum(prices) sum prices price = -heapq.heappop(prices) -heapq.heappop(prices) price N, M = [int(n) for n in lines[0].strip().split()] [int(n) for n in lines[0].strip().split()] N prices = [-int(n) for n in lines[1].strip().split()] [-int(n) for n in lines[1].strip().split()] prices M = [int(n) for n in lines[0].strip().split()] [int(n) for n in lines[0].strip().split()] M lines = sys.stdin.readlines() sys.stdin.readlines() lines
import heapq
import sys

lines = sys.stdin.readlines()

N, M = [int(n) for n in lines[0].strip().split()]
prices = [-int(n) for n in lines[1].strip().split()]

heapq.heapify(prices)

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

print(-sum(prices))