import heapq

N,M=map(int,input().split())
A=list(map(int,input().split()))

for i in range(0,N):
    A[i]=-A[i]

heapq.heapify(A)
for i in range(0,M):
    x=heapq.heappop(A)
    x=-x
    x=x//2
    heapq.heappush(A,-x)

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

N,M=map(int,input().split())
A=list(map(int,input().split()))

for i in range(0,N):
    A[i]=-A[i]

heapq.heapify(A)
for i in range(0,M):
    x=heapq.heappop(A)
    x=-x
    x=x//2
    heapq.heappush(A,-x)

ans=0
for i in range(0,N):
    ans-=A[i]
print(ans)
