import heapq
import math
n, m = map(int, input().split())
a = list(map(int, input().split()))
a = list(map(lambda x: x*(-1), a))
ticket_num = m
heapq.heapify(a)

if n > 1:
    for i in range(m):
        MAX = heapq.heappop(a)
        MAX = math.ceil(MAX / 2)
        heapq.heappush(a,MAX)
        
else:
    MAX = heapq.heappop(a)
    MAX = math.ceil(MAX / (2**m))
    heapq.heappush(a,MAX)

print(sum(a)*(-1)) import heapq heapq import math math 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 ticket_num = m ticket_num m heapq.heapify(a) heapq.heapify heapq heapify a if n > 1:
    for i in range(m):
        MAX = heapq.heappop(a)
        MAX = math.ceil(MAX / 2)
        heapq.heappush(a,MAX)
        
else:
    MAX = heapq.heappop(a)
    MAX = math.ceil(MAX / (2**m))
    heapq.heappush(a,MAX) n > 1 n 1 for i in range(m):
        MAX = heapq.heappop(a)
        MAX = math.ceil(MAX / 2)
        heapq.heappush(a,MAX)
         i range(m) range m MAX = heapq.heappop(a) MAX heapq.heappop(a) heapq.heappop heapq heappop a MAX = math.ceil(MAX / 2) MAX math.ceil(MAX / 2) math.ceil math ceil MAX / 2 MAX 2 heapq.heappush(a,MAX) heapq.heappush heapq heappush a MAX MAX = heapq.heappop(a) MAX heapq.heappop(a) heapq.heappop heapq heappop a MAX = math.ceil(MAX / (2**m)) MAX math.ceil(MAX / (2**m)) math.ceil math ceil MAX / (2**m) MAX 2**m 2 m heapq.heappush(a,MAX) heapq.heappush heapq heappush a MAX print(sum(a)*(-1)) print sum(a)*(-1) sum(a) sum a -1 a = list(map(int, input().split())) list(map(int, input().split())) a ticket_num = m m ticket_num MAX = math.ceil(MAX / (2**m)) math.ceil(MAX / (2**m)) MAX m = map(int, input().split()) map(int, input().split()) m a = list(map(lambda x: x*(-1), a)) list(map(lambda x: x*(-1), a)) a MAX = heapq.heappop(a) heapq.heappop(a) MAX n, m = map(int, input().split()) map(int, input().split()) n MAX = math.ceil(MAX / 2) math.ceil(MAX / 2) MAX MAX = heapq.heappop(a) heapq.heappop(a) MAX
import heapq
import math
n, m = map(int, input().split())
a = list(map(int, input().split()))
a = list(map(lambda x: x*(-1), a))
ticket_num = m
heapq.heapify(a)

if n > 1:
    for i in range(m):
        MAX = heapq.heappop(a)
        MAX = math.ceil(MAX / 2)
        heapq.heappush(a,MAX)
        
else:
    MAX = heapq.heappop(a)
    MAX = math.ceil(MAX / (2**m))
    heapq.heappush(a,MAX)

print(sum(a)*(-1))