      program answer
      implicit none
      integer(8) N,M
      integer(8),allocatable,dimension(:) :: A
      double precision,allocatable,dimension(:) :: B
      double precision :: tmp
      integer(8) :: i,j,res
      intrinsic dble,maxval
      res = 0
      read(*,*) N,M
      allocate(A(N),B(N))
      read(*,*) (A(i),i=1,N)
      do i=1,N
        B(i) = dble(A(i))
      end do
      do i=1,M
        tmp = maxval(B)/2.0d0
      lp:do j=1,N
          if( maxval(B) == B(j)) then
            B(j) = tmp
            exit lp
          end if
        end do lp
      end do
      do i=1,N
        A(i) = B(i) + 0.0
        res = res + A(i)
      end do
      write(*,'(I0)') res
      end program answer
