import heapq
from collections import deque
n,m=map(int,input().split())
A=list(map(int,input().split()))

for i in range(n):
    A[i]*=-1
heapq.heapify(A)

for i in range(m):
    x=heapq.heappop(A)
    if x%2==0:
        x//=2
    else:
        x=x//2 +1
    heapq.heappush(A,x)

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

for i in range(n):
    A[i]*=-1
heapq.heapify(A)

for i in range(m):
    x=heapq.heappop(A)
    if x%2==0:
        x//=2
    else:
        x=x//2 +1
    heapq.heappush(A,x)

ans=-1*sum(A)
print(ans)