import sys

import heapq

import math

input = sys.stdin.readline



n, m = list(map(int, input().split()))

a = list([int(x) * (-1) for x in input().split()])

heapq.heapify(a)

for i in range(m):

    max_a = heapq.heappop(a)

    max_a /= 2

    heapq.heappush(a, max_a)

for i in range(n):

    a[i] = math.floor(-a[i])

print((sum(a)))

import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines

sys.setrecursionlimit(10 ** 7)



import heapq



n, m = list(map(int, readline().split()))

a = list([int(x)*(-1) for x in readline().split()])

heapq.heapify(a)

for i in range(m):

    memo = heapq.heappop(a)

    heapq.heappush(a, (-memo // 2) * (-1))

print((-sum(a)))

import sys
import heapq
import math

input = sys.stdin.readline
n, m = list(map(int, input().split()))
a = list([int(x) * (-1) for x in input().split()])
heapq.heapify(a)
for i in range(m):
    max_a = heapq.heappop(a)
    max_a /= 2
    heapq.heappush(a, max_a)
for i in range(n):
    a[i] = math.floor(-a[i])
print((sum(a)))

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**7)
import heapq

n, m = list(map(int, readline().split()))
a = list([int(x) * (-1) for x in readline().split()])
heapq.heapify(a)
for i in range(m):
    memo = heapq.heappop(a)
    heapq.heappush(a, (-memo // 2) * (-1))
print((-sum(a)))

+ +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines +sys.setrecursionlimit(10**7) -import math -input = sys.stdin.readline -n, m = list(map(int, input().split())) -a = list([int(x) * (-1) for x in input().split()]) +n, m = list(map(int, readline().split())) +a = list([int(x) * (-1) for x in readline().split()]) -    max_a = heapq.heappop(a) -    max_a /= 2 -    heapq.heappush(a, max_a) -for i in range(n): -    a[i] = math.floor(-a[i]) -print((sum(a))) +    memo = heapq.heappop(a) +    heapq.heappush(a, (-memo // 2) * (-1)) +print((-sum(a)))