from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations

def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))

    A = [-1 * a for a in A]
    heapify(A)

    for _ in range(M):
        tmp = heappop(A)
        heappush(A, -(-tmp // 2))
    
    print(-sum(A))

if __name__ == '__main__':
    main() from fractions import gcd from collections import Counter, deque, defaultdict from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort from itertools import accumulate, product, permutations, combinations def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))

    A = [-1 * a for a in A]
    heapify(A)

    for _ in range(M):
        tmp = heappop(A)
        heappush(A, -(-tmp // 2))
    
    print(-sum(A)) main 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 -1 * a for a in A for a in A a A for a in A -1 * a -1 a A = [-1 * a for a in A] A [-1 * a for a in A] heapify(A) heapify A for _ in range(M):
        tmp = heappop(A)
        heappush(A, -(-tmp // 2))
    
     _ range(M) range M tmp = heappop(A) tmp heappop(A) heappop A heappush(A, -(-tmp // 2)) heappush A -(-tmp // 2) -tmp // 2 -tmp tmp 2 print(-sum(A)) print -sum(A) sum(A) sum A if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))

    A = [-1 * a for a in A]
    heapify(A)

    for _ in range(M):
        tmp = heappop(A)
        heappush(A, -(-tmp // 2))
    
    print(-sum(A)) def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))

    A = [-1 * a for a in A]
    heapify(A)

    for _ in range(M):
        tmp = heappop(A)
        heappush(A, -(-tmp // 2))
    
    print(-sum(A)) main
from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations

def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))

    A = [-1 * a for a in A]
    heapify(A)

    for _ in range(M):
        tmp = heappop(A)
        heappush(A, -(-tmp // 2))
    
    print(-sum(A))

if __name__ == '__main__':
    main()