import sys
input = sys.stdin.readline
import heapq

n,m = map(int,input().split())
l = list(map(int,input().split()))
s = sum(l)
for i in range(n):
    l[i] *= (-1)

heapq.heapify(l)

discount = 0

for i in range(m):
    x = (-heapq.heappop(l))
    heapq.heappush(l,-(x//2))
    discount += (x-x//2)

print(s-discount) import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline import heapq heapq n,m = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split m l = list(map(int,input().split())) l list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split s = sum(l) s sum(l) sum l for i in range(n):
    l[i] *= (-1) i range(n) range n l[i] *= (-1) l[i] l i -1 heapq.heapify(l) heapq.heapify heapq heapify l discount = 0 discount 0 for i in range(m):
    x = (-heapq.heappop(l))
    heapq.heappush(l,-(x//2))
    discount += (x-x//2) i range(m) range m x = (-heapq.heappop(l)) x -heapq.heappop(l) heapq.heappop(l) heapq.heappop heapq heappop l heapq.heappush(l,-(x//2)) heapq.heappush heapq heappush l -(x//2) x//2 x 2 discount += (x-x//2) discount x-x//2 x x//2 x 2 print(s-discount) print s-discount s discount x = (-heapq.heappop(l)) -heapq.heappop(l) x m = map(int,input().split()) map(int,input().split()) m l = list(map(int,input().split())) list(map(int,input().split())) l discount += (x-x//2) x-x//2 discount n,m = map(int,input().split()) map(int,input().split()) n discount = 0 0 discount input = sys.stdin.readline sys.stdin.readline input s = sum(l) sum(l) s
import sys
input = sys.stdin.readline
import heapq

n,m = map(int,input().split())
l = list(map(int,input().split()))
s = sum(l)
for i in range(n):
    l[i] *= (-1)

heapq.heapify(l)

discount = 0

for i in range(m):
    x = (-heapq.heappop(l))
    heapq.heappush(l,-(x//2))
    discount += (x-x//2)

print(s-discount)