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

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

A = sorted(A)

heapq.heapify(A)

import math

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

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

A = sorted(A)

heapq.heapify(A)

import math

for i in range (0, M):
	V = heapq.heappop(A)
	V = math.ceil(V/2)
	heapq.heappush(A, V)
  
print(-1*sum(A))