import heapq

from typing import List


def main():
    n, m = map(int, input().split())
    v = map(int, input().split())
    print(pdt(v, m))


def pdt(v: List[int], m: int) -> int:
    vv = [-a for a in v]
    heapq.heapify(vv)

    for _ in range(m):
        k = -heapq.heappop(vv)
        k = k // 2
        heapq.heappush(vv, -k)

    return -sum(vv)


if __name__ == '__main__':
    main() import heapq heapq from typing import List def main():
    n, m = map(int, input().split())
    v = map(int, input().split())
    print(pdt(v, m)) main n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m v = map(int, input().split()) v map(int, input().split()) map int input().split() ().split () input split print(pdt(v, m)) print pdt(v, m) pdt v m def pdt(v: List[int], m: int) -> int:
    vv = [-a for a in v]
    heapq.heapify(vv)

    for _ in range(m):
        k = -heapq.heappop(vv)
        k = k // 2
        heapq.heappush(vv, -k)

    return -sum(vv) pdt -a for a in v for a in v a v for a in v -a a vv = [-a for a in v] vv [-a for a in v] heapq.heapify(vv) heapq.heapify heapq heapify vv for _ in range(m):
        k = -heapq.heappop(vv)
        k = k // 2
        heapq.heappush(vv, -k)

     _ range(m) range m k = -heapq.heappop(vv) k -heapq.heappop(vv) heapq.heappop(vv) heapq.heappop heapq heappop vv k = k // 2 k k // 2 k 2 heapq.heappush(vv, -k) heapq.heappush heapq heappush vv -k k return -sum(vv) -sum(vv) sum(vv) sum vv v: List[int] v m: int m if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    n, m = map(int, input().split())
    v = map(int, input().split())
    print(pdt(v, m)) def main():
    n, m = map(int, input().split())
    v = map(int, input().split())
    print(pdt(v, m)) main def pdt(v: List[int], m: int) -> int:
    vv = [-a for a in v]
    heapq.heapify(vv)

    for _ in range(m):
        k = -heapq.heappop(vv)
        k = k // 2
        heapq.heappush(vv, -k)

    return -sum(vv) def pdt(v: List[int], m: int) -> int:
    vv = [-a for a in v]
    heapq.heapify(vv)

    for _ in range(m):
        k = -heapq.heappop(vv)
        k = k // 2
        heapq.heappush(vv, -k)

    return -sum(vv) pdt
import heapq

from typing import List


def main():
    n, m = map(int, input().split())
    v = map(int, input().split())
    print(pdt(v, m))


def pdt(v: List[int], m: int) -> int:
    vv = [-a for a in v]
    heapq.heapify(vv)

    for _ in range(m):
        k = -heapq.heappop(vv)
        k = k // 2
        heapq.heappush(vv, -k)

    return -sum(vv)


if __name__ == '__main__':
    main()
