output_description: Print the minimum amount of money required to buy all the items.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N M
      A_1 A_2 ... A_N
attempt: import sys
  
  sys.setrecursionlimit(2147483647)
  INF = float("inf")
  MOD = 10**9 + 7  # 998244353
  input = lambda: sys.stdin.readline().rstrip()
  
  
  class Heap(object):
      def __init__(self, A):
          self._heap = []
          # heapify は O(n) でできるらしいが、O(nlogn) で妥協
          # cf. https://github.com/python/cpython/blob/3.8/Lib/heapq.py
          for a in A:
              self.append(a)
  
      def __len__(self):
          return len(self._heap)
  
      def __bool__(self):
          return bool(self._heap)
  
      def front(self):
          assert self
          return self._heap[0]
  
      def append(self, x):
          self._heap.append(x)
          now = len(self) - 1
          heap = self._heap
          # n の親は (n-1)//2
          while now != 0 and heap[now] < heap[(now - 1) // 2]:
              heap[now], heap[(now - 1) // 2] = heap[(now - 1) // 2], heap[now]
              now = (now - 1) // 2
  
      def pop(self):
          assert self
          if len(self) == 1:
              return self._heap.pop()
  
          heap = self._heap
          res, heap[0] = heap[0], heap.pop()
          # n の子は 2*n+1, 2*n+2
          now = 0
          while 1:
              if now * 2 + 1 >= len(self):
                  break  # 子が存在しない
              # 子がひとつだけのとき、必要なら入れ替えて終わり
              if now * 2 + 1 == len(self) - 1:
                  if heap[now] > heap[now * 2 + 1]:
                      heap[now], heap[now * 2 + 1] = heap[now * 2 + 1], heap[now]
                  break
              # 子が複数のとき
              else:
                  # 親、子1、子2のうち、親が最小であれば終わり
                  if min(heap[now], heap[2 * now + 1], heap[2 * now + 2]) == heap[now]:
                      break
                  # そうでないとき、子のうち小さい方を親と入れ替える
                  next = min(
                      (heap[2 * now + 1], 2 * now + 1), (heap[2 * now + 2], 2 * now + 2)
                  )[1]
                  heap[now], heap[next] = heap[next], heap[now]
                  now = next
  
          return res
  
      def sort(self):
          return [self.pop() for _ in range(len(self))]
  
  
  def resolve():
      n, m = map(int, input().split())
      A = list(map(lambda x: -int(x), input().split()))
      heap = Heap(A)
      for _ in range(m):
          x = -heap.pop()
          x //= 2
          heap.append(-x)
  
      print(-sum(heap._heap))
  
  
  resolve()
  
problem_description: Statement
  
  Takahashi is going to buy N items one by one.
  
  The price of the i-th item he buys is A_i yen (the currency of Japan).
  
  He has M discount tickets, and he can use any number of them when buying an
  item.
  
  If Y tickets are used when buying an item priced X yen, he can get the item
  for \frac{X}{2^Y} (rounded down to the nearest integer) yen.
  
  What is the minimum amount of money required to buy all the items?
samples: [{"input": "3 3\n    2 13 8", "output": "9\n    \n\nWe can buy all the items for 9 yen, as follows:\n\n  * Buy the 1-st item for 2 yen without tickets.\n  * Buy the 2-nd item for 3 yen with 2 tickets.\n  * Buy the 3-rd item for 4 yen with 1 ticket.\n\n* * *"}, {"input": "4 4\n    1 9 3 5", "output": "6\n    \n\n* * *"}, {"input": "1 100000\n    1000000000", "output": "0\n    \n\nWe can buy the item priced 1000000000 yen for 0 yen with 100000 tickets.\n\n* * *"}, {"input": "10 1\n    1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000", "output": "9500000000"}]