from heapq import heapify, heappop, heappush


N, M = map(int, input().split())
A = list(map(lambda x: -int(x), input().split()))
if N == 1:
    print(N >> M)
    exit()
heapify(A)
while M > 0:
    a = -heappop(A)
    while M > 0 and a >= -A[0]:
        a >>= 1
        M -= 1
    heappush(A, -a)
print(-sum(A)) from heapq import heapify, heappop, heappush N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M A = list(map(lambda x: -int(x), input().split())) A list(map(lambda x: -int(x), input().split())) list map(lambda x: -int(x), input().split()) map lambda x: -int(x) -int(x) int(x) int x x input().split() ().split () input split if N == 1:
    print(N >> M)
    exit() N == 1 N 1 print(N >> M) print N >> M N M exit() exit heapify(A) heapify A while M > 0:
    a = -heappop(A)
    while M > 0 and a >= -A[0]:
        a >>= 1
        M -= 1
    heappush(A, -a) M > 0 M 0 a = -heappop(A) a -heappop(A) heappop(A) heappop A while M > 0 and a >= -A[0]:
        a >>= 1
        M -= 1
     M > 0 and a >= -A[0] M > 0 M 0 a >= -A[0] a -A[0] A[0] A 0 a >>= 1 a 1 M -= 1 M 1 heappush(A, -a) heappush A -a a print(-sum(A)) print -sum(A) sum(A) sum A a >>= 1 1 a M = map(int, input().split()) map(int, input().split()) M A = list(map(lambda x: -int(x), input().split())) list(map(lambda x: -int(x), input().split())) A a = -heappop(A) -heappop(A) a N, M = map(int, input().split()) map(int, input().split()) N M -= 1 1 M
from heapq import heapify, heappop, heappush


N, M = map(int, input().split())
A = list(map(lambda x: -int(x), input().split()))
if N == 1:
    print(N >> M)
    exit()
heapify(A)
while M > 0:
    a = -heappop(A)
    while M > 0 and a >= -A[0]:
        a >>= 1
        M -= 1
    heappush(A, -a)
print(-sum(A))