import heapq
NM,a=open(0).read().rstrip().split('\n')
N,M=map(int,NM.split())
A=list(map(int,a.split()))
A=[-1*i for i in A]
heapq.heapify(A)
for i in range(M):
    sample=heapq.heappop(A)
    sample=-1*sample//2
    heapq.heappush(A,-1*sample)
print(-sum(A)) import heapq heapq NM,a=open(0).read().rstrip().split('\n') NM open(0).read().rstrip().split('\n') (0).read().rstrip().split (0).read().rstrip() (0).read().rstrip (0).read() (0).read (0) open 0 read rstrip split '\n' a N,M=map(int,NM.split()) N map(int,NM.split()) map int NM.split() NM.split NM split M A=list(map(int,a.split())) A list(map(int,a.split())) list map(int,a.split()) map int a.split() a.split a split -1*i for i in A for i in A i A for i in A -1*i -1 i A=[-1*i for i in A] A [-1*i for i in A] heapq.heapify(A) heapq.heapify heapq heapify A for i in range(M):
    sample=heapq.heappop(A)
    sample=-1*sample//2
    heapq.heappush(A,-1*sample) i range(M) range M sample=heapq.heappop(A) sample heapq.heappop(A) heapq.heappop heapq heappop A sample=-1*sample//2 sample -1*sample//2 -1*sample -1 sample 2 heapq.heappush(A,-1*sample) heapq.heappush heapq heappush A -1*sample -1 sample print(-sum(A)) print -sum(A) sum(A) sum A NM,a=open(0).read().rstrip().split('\n') open(0).read().rstrip().split('\n') NM sample=heapq.heappop(A) heapq.heappop(A) sample N,M=map(int,NM.split()) map(int,NM.split()) N A=[-1*i for i in A] [-1*i for i in A] A M=map(int,NM.split()) map(int,NM.split()) M A=list(map(int,a.split())) list(map(int,a.split())) A sample=-1*sample//2 -1*sample//2 sample a=open(0).read().rstrip().split('\n') open(0).read().rstrip().split('\n') a
import heapq
NM,a=open(0).read().rstrip().split('\n')
N,M=map(int,NM.split())
A=list(map(int,a.split()))
A=[-1*i for i in A]
heapq.heapify(A)
for i in range(M):
    sample=heapq.heappop(A)
    sample=-1*sample//2
    heapq.heappush(A,-1*sample)
print(-sum(A))