import heapq

N, M = map(int, input().split())
A = list(map(int, input().split()))
A = list(map(lambda x: x*(-1), A))

heapq.heapify(A)

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

N, M = map(int, input().split())
A = list(map(int, input().split()))
A = list(map(lambda x: x*(-1), A))

heapq.heapify(A)

for _ in range(M):
  Max = heapq.heappop(A) * -1
  heapq.heappush(A, Max//2 * -1)
  
ans = 0
for i in range(N):
  ans += -1 * A[i]
  
print(ans)