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