import heapq
n, m = map(int, input().split())
lst = list(map(lambda x: -(int(x)), input().split()))
heapq.heapify(lst)
for i in range(m):
  a = heapq.heappop(lst)
  heapq.heappush(lst, a / 2)
res = 0
for i in range(n):
  res += int(-lst[i])
print(res) import heapq heapq n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m lst = list(map(lambda x: -(int(x)), input().split())) lst list(map(lambda x: -(int(x)), input().split())) list map(lambda x: -(int(x)), input().split()) map lambda x: -(int(x)) -(int(x)) int(x) int x x input().split() ().split () input split heapq.heapify(lst) heapq.heapify heapq heapify lst for i in range(m):
  a = heapq.heappop(lst)
  heapq.heappush(lst, a / 2) i range(m) range m a = heapq.heappop(lst) a heapq.heappop(lst) heapq.heappop heapq heappop lst heapq.heappush(lst, a / 2) heapq.heappush heapq heappush lst a / 2 a 2 res = 0 res 0 for i in range(n):
  res += int(-lst[i]) i range(n) range n res += int(-lst[i]) res int(-lst[i]) int -lst[i] lst[i] lst i print(res) print res a = heapq.heappop(lst) heapq.heappop(lst) a m = map(int, input().split()) map(int, input().split()) m lst = list(map(lambda x: -(int(x)), input().split())) list(map(lambda x: -(int(x)), input().split())) lst res = 0 0 res res += int(-lst[i]) int(-lst[i]) res n, m = map(int, input().split()) map(int, input().split()) n
import heapq
n, m = map(int, input().split())
lst = list(map(lambda x: -(int(x)), input().split()))
heapq.heapify(lst)
for i in range(m):
  a = heapq.heappop(lst)
  heapq.heappush(lst, a / 2)
res = 0
for i in range(n):
  res += int(-lst[i])
print(res)