from heapq import heapify, heappop, heappush
n, m = map(int, input().split())
a = list(map(int, input().split()))
a = [-i for i in a]
heapify(a)

for i in range(m):
    x = heappop(a)
    heappush(a, int(x/2))

ans = 0
for i in range(n):
    ans += -a[i]
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 -i for i in a for i in a i a for i in a -i i a = [-i for i in a] a [-i for i in a] heapify(a) heapify a for i in range(m):
    x = heappop(a)
    heappush(a, int(x/2)) i range(m) range m x = heappop(a) x heappop(a) heappop a heappush(a, int(x/2)) heappush a int(x/2) int x/2 x 2 ans = 0 ans 0 for i in range(n):
    ans += -a[i] i range(n) range n ans += -a[i] ans -a[i] a[i] a i print(ans) print ans a = [-i for i in a] [-i for i in a] a x = heappop(a) heappop(a) x a = list(map(int, input().split())) list(map(int, input().split())) a ans = 0 0 ans ans += -a[i] -a[i] ans n, m = map(int, input().split()) map(int, input().split()) n m = map(int, input().split()) map(int, input().split()) m
from heapq import heapify, heappop, heappush
n, m = map(int, input().split())
a = list(map(int, input().split()))
a = [-i for i in a]
heapify(a)

for i in range(m):
    x = heappop(a)
    heappush(a, int(x/2))

ans = 0
for i in range(n):
    ans += -a[i]
print(ans)