import math
import heapq
n, m = map(int, input().split())
a = [int(i) * (-1) for i in input().split()]
heapq.heapify(a)
i = 0
while i < m:
    max_a = - heapq.heappop(a)
    max_a /= 2
    heapq.heappush(a, -max_a)
    i += 1
total = 0
for k in a:
    total += math.floor(-k)
print(total) import math math import heapq heapq n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m int(i) * (-1) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) * (-1) int(i) int i -1 a = [int(i) * (-1) for i in input().split()] a [int(i) * (-1) for i in input().split()] heapq.heapify(a) heapq.heapify heapq heapify a i = 0 i 0 while i < m:
    max_a = - heapq.heappop(a)
    max_a /= 2
    heapq.heappush(a, -max_a)
    i += 1 i < m i m max_a = - heapq.heappop(a) max_a - heapq.heappop(a) heapq.heappop(a) heapq.heappop heapq heappop a max_a /= 2 max_a 2 heapq.heappush(a, -max_a) heapq.heappush heapq heappush a -max_a max_a i += 1 i 1 total = 0 total 0 for k in a:
    total += math.floor(-k) k a total += math.floor(-k) total math.floor(-k) math.floor math floor -k k print(total) print total i += 1 1 i total = 0 0 total max_a = - heapq.heappop(a) - heapq.heappop(a) max_a max_a /= 2 2 max_a total += math.floor(-k) math.floor(-k) total i = 0 0 i n, m = map(int, input().split()) map(int, input().split()) n m = map(int, input().split()) map(int, input().split()) m a = [int(i) * (-1) for i in input().split()] [int(i) * (-1) for i in input().split()] a
import math
import heapq
n, m = map(int, input().split())
a = [int(i) * (-1) for i in input().split()]
heapq.heapify(a)
i = 0
while i < m:
    max_a = - heapq.heappop(a)
    max_a /= 2
    heapq.heappush(a, -max_a)
    i += 1
total = 0
for k in a:
    total += math.floor(-k)
print(total)