import sys

def input(): return sys.stdin.readline().strip()

def mapint(): return list(map(int, input().split()))

sys.setrecursionlimit(10**9)



N, M = mapint()

As = list(mapint())

Q = []

from heapq import heappop, heappush

for a in As:

    heappush(Q, -a)

for i in range(M):

    v = heappop(Q)

    heappush(Q, v/2)

lis = [-int(x) for x in Q]

print((sum(lis)))
import sys

def input(): return sys.stdin.readline().strip()

def mapint(): return list(map(int, input().split()))

sys.setrecursionlimit(10**9)



N, M = mapint()

As = list(mapint())

from heapq import heappush, heappop

Q = []



for a in As:

    heappush(Q, -a)



for i in range(M):

    a = -heappop(Q)

    heappush(Q, -(a//2))



print((-sum(Q)))
import sys


def input():
    return sys.stdin.readline().strip()


def mapint():
    return list(map(int, input().split()))


sys.setrecursionlimit(10**9)
N, M = mapint()
As = list(mapint())
Q = []
from heapq import heappop, heappush

for a in As:
    heappush(Q, -a)
for i in range(M):
    v = heappop(Q)
    heappush(Q, v / 2)
lis = [-int(x) for x in Q]
print((sum(lis)))

import sys


def input():
    return sys.stdin.readline().strip()


def mapint():
    return list(map(int, input().split()))


sys.setrecursionlimit(10**9)
N, M = mapint()
As = list(mapint())
from heapq import heappush, heappop

Q = []
for a in As:
    heappush(Q, -a)
for i in range(M):
    a = -heappop(Q)
    heappush(Q, -(a // 2))
print((-sum(Q)))

+from heapq import heappush, heappop + -from heapq import heappop, heappush - -    v = heappop(Q) -    heappush(Q, v / 2) -lis = [-int(x) for x in Q] -print((sum(lis))) +    a = -heappop(Q) +    heappush(Q, -(a // 2)) +print((-sum(Q)))