#!/usr/bin/env python3

from heapq import heapify, heappop, heappush

n, m = map(int, input().split())
a = list(map(int, input().split()))
a = [-1*item for item in a]
heapify(a)

for i in range(m):
    max = -1* heappop(a)
    heappush(a, int(-1*max/2))  # 要素の挿入

a = [-1*item for item in a]
ans = sum(list(a))

print(ans) 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(int, input().split())) a list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split -1*item for item in a for item in a item a for item in a -1*item -1 item a = [-1*item for item in a] a [-1*item for item in a] heapify(a) heapify a for i in range(m):
    max = -1* heappop(a)
    heappush(a, int(-1*max/2))  # 要素の挿入 i range(m) range m max = -1* heappop(a) max -1* heappop(a) -1 heappop(a) heappop a heappush(a, int(-1*max/2)) heappush a int(-1*max/2) int -1*max/2 -1*max -1 max 2 -1*item for item in a for item in a item a for item in a -1*item -1 item a = [-1*item for item in a] a [-1*item for item in a] ans = sum(list(a)) ans sum(list(a)) sum list(a) list a print(ans) print ans max = -1* heappop(a) -1* heappop(a) max m = map(int, input().split()) map(int, input().split()) m a = [-1*item for item in a] [-1*item for item in a] a a = list(map(int, input().split())) list(map(int, input().split())) a n, m = map(int, input().split()) map(int, input().split()) n ans = sum(list(a)) sum(list(a)) ans a = [-1*item for item in a] [-1*item for item in a] a
#!/usr/bin/env python3

from heapq import heapify, heappop, heappush

n, m = map(int, input().split())
a = list(map(int, input().split()))
a = [-1*item for item in a]
heapify(a)

for i in range(m):
    max = -1* heappop(a)
    heappush(a, int(-1*max/2))  # 要素の挿入

a = [-1*item for item in a]
ans = sum(list(a))

print(ans)
