import heapq
n,m = map(int,input().split())
p = list(map(int,input().split()))
price = [x*(-1) for x in p]
heapq.heapify(price)
while m != 0:
    max_price = heapq.heappop(price)*(-1)
    heapq.heappush(price,(max_price//2)*(-1))
    m -= 1
print(sum(price)*(-1)) import heapq heapq n,m = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split m p = list(map(int,input().split())) p list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split x*(-1) for x in p for x in p x p for x in p x*(-1) x -1 price = [x*(-1) for x in p] price [x*(-1) for x in p] heapq.heapify(price) heapq.heapify heapq heapify price while m != 0:
    max_price = heapq.heappop(price)*(-1)
    heapq.heappush(price,(max_price//2)*(-1))
    m -= 1 m != 0 m 0 max_price = heapq.heappop(price)*(-1) max_price heapq.heappop(price)*(-1) heapq.heappop(price) heapq.heappop heapq heappop price -1 heapq.heappush(price,(max_price//2)*(-1)) heapq.heappush heapq heappush price (max_price//2)*(-1) max_price//2 max_price 2 -1 m -= 1 m 1 print(sum(price)*(-1)) print sum(price)*(-1) sum(price) sum price -1 n,m = map(int,input().split()) map(int,input().split()) n m = map(int,input().split()) map(int,input().split()) m max_price = heapq.heappop(price)*(-1) heapq.heappop(price)*(-1) max_price m -= 1 1 m p = list(map(int,input().split())) list(map(int,input().split())) p price = [x*(-1) for x in p] [x*(-1) for x in p] price
import heapq
n,m = map(int,input().split())
p = list(map(int,input().split()))
price = [x*(-1) for x in p]
heapq.heapify(price)
while m != 0:
    max_price = heapq.heappop(price)*(-1)
    heapq.heappush(price,(max_price//2)*(-1))
    m -= 1
print(sum(price)*(-1))