#!/usr/bin/env python3

import sys

import heapq



def solve(N: int, M: int, A: "List[int]"):

    a = []

    for i in A:

        heapq.heappush(a, -i)



    for _ in range(M):

        m = heapq.heappop(a)

        heapq.heappush(a, -(-m // 2))



    sum = 0

    for i in a:

        sum += i

    print((-sum))

    return





# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)

def main():

    def iterate_tokens():

        for line in sys.stdin:

            for word in line.split():

                yield word

    tokens = iterate_tokens()

    N = int(next(tokens))  # type: int

    M = int(next(tokens))  # type: int

    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"

    solve(N, M, A)



if __name__ == '__main__':

    main()

#!/usr/bin/env python3

import sys

import heapq



def main():

    N, M = list(map(int, input().split()))

    A = [int(i) for i in input().split()]

    a = []

    for i in A:

        heapq.heappush(a, -i)



    for _ in range(M):

        m = heapq.heappop(a)

        heapq.heappush(a, -(-m // 2))



    sum = 0

    for i in a:

        sum += i

    print((-sum))

    return 



if __name__ == '__main__':

    main()

#!/usr/bin/env python3
import sys
import heapq


def solve(N: int, M: int, A: "List[int]"):
    a = []
    for i in A:
        heapq.heappush(a, -i)
    for _ in range(M):
        m = heapq.heappop(a)
        heapq.heappush(a, -(-m // 2))
    sum = 0
    for i in a:
        sum += i
    print((-sum))
    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, M, A)


if __name__ == "__main__":
    main()

#!/usr/bin/env python3
import sys
import heapq


def main():
    N, M = list(map(int, input().split()))
    A = [int(i) for i in input().split()]
    a = []
    for i in A:
        heapq.heappush(a, -i)
    for _ in range(M):
        m = heapq.heappop(a)
        heapq.heappush(a, -(-m // 2))
    sum = 0
    for i in a:
        sum += i
    print((-sum))
    return


if __name__ == "__main__":
    main()

-def solve(N: int, M: int, A: "List[int]"): +def main(): +    N, M = list(map(int, input().split())) +    A = [int(i) for i in input().split()] -# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template) -def main(): -    def iterate_tokens(): -        for line in sys.stdin: -            for word in line.split(): -                yield word - -    tokens = iterate_tokens() -    N = int(next(tokens))  # type: int -    M = int(next(tokens))  # type: int -    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]" -    solve(N, M, A) - -