program main
    implicit none
    integer::i,j,k, p
    integer:: n,m
    integer(8),allocatable:: a(:)

    read*, n,m
    allocate(a(n))
    read*, a(1:n)

    do while(.true.)
        p = maxloc(a(1:n),1)
        if (m > 0)then
            a(p) = a(p) / 2
            m = m - 1
            ! print*, a(p)
        else
            exit
        end if
    end do
    
  
    print*, sum(a)

    
end program