from heapq import (
    heapify,  # 優先度付きキューの生成
    heappop,
    heappush,
    heappushpop,
    heapreplace
    )

N, M = map(int, input().split())

# 最小値が返ってくるので-1倍する
A = [-i for i in map(int,input().split())]
heapify(A)

for _ in range(M):
    s = -heappop(A)
    s //= 2
    heappush(A, -s)

print(-sum(A)) from heapq import (
    heapify,  # 優先度付きキューの生成
    heappop,
    heappush,
    heappushpop,
    heapreplace
    ) N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M -i for i in map(int,input().split()) for i in map(int,input().split()) i map(int,input().split()) map int input().split() ().split () input split for i in map(int,input().split()) -i i A = [-i for i in map(int,input().split())] A [-i for i in map(int,input().split())] heapify(A) heapify A for _ in range(M):
    s = -heappop(A)
    s //= 2
    heappush(A, -s) _ range(M) range M s = -heappop(A) s -heappop(A) heappop(A) heappop A s //= 2 s 2 heappush(A, -s) heappush A -s s print(-sum(A)) print -sum(A) sum(A) sum A s = -heappop(A) -heappop(A) s N, M = map(int, input().split()) map(int, input().split()) N M = map(int, input().split()) map(int, input().split()) M A = [-i for i in map(int,input().split())] [-i for i in map(int,input().split())] A s //= 2 2 s
from heapq import (
    heapify,  # 優先度付きキューの生成
    heappop,
    heappush,
    heappushpop,
    heapreplace
    )

N, M = map(int, input().split())

# 最小値が返ってくるので-1倍する
A = [-i for i in map(int,input().split())]
heapify(A)

for _ in range(M):
    s = -heappop(A)
    s //= 2
    heappush(A, -s)

print(-sum(A))