#!/usr/bin/env python3
import heapq
# input = stdin.readline

def solve(n,m,a):
  a = [-x for x in a]
  heapq.heapify(a)
  for _ in range(m):
    x = heapq.heappop(a)
    heapq.heappush(a,-(abs(x)//2))
  return abs(sum(a))


def main():
  N,M = map(int,input().split())
  a = list(sorted(map(int,input().split())))
  print(solve(N,M,a))
  pass

if __name__ == '__main__':
  main() import heapq heapq def solve(n,m,a):
  a = [-x for x in a]
  heapq.heapify(a)
  for _ in range(m):
    x = heapq.heappop(a)
    heapq.heappush(a,-(abs(x)//2))
  return abs(sum(a)) solve -x for x in a for x in a x a for x in a -x x a = [-x for x in a] a [-x for x in a] heapq.heapify(a) heapq.heapify heapq heapify a for _ in range(m):
    x = heapq.heappop(a)
    heapq.heappush(a,-(abs(x)//2))
   _ range(m) range m x = heapq.heappop(a) x heapq.heappop(a) heapq.heappop heapq heappop a heapq.heappush(a,-(abs(x)//2)) heapq.heappush heapq heappush a -(abs(x)//2) abs(x)//2 abs(x) abs x 2 return abs(sum(a)) abs(sum(a)) abs sum(a) sum a n n m m a a def main():
  N,M = map(int,input().split())
  a = list(sorted(map(int,input().split())))
  print(solve(N,M,a))
  pass main N,M = map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split M a = list(sorted(map(int,input().split()))) a list(sorted(map(int,input().split()))) list sorted(map(int,input().split())) sorted map(int,input().split()) map int input().split() ().split () input split print(solve(N,M,a)) print solve(N,M,a) solve N M a if __name__ == '__main__':
  main() __name__ == '__main__' __name__ '__main__' main() main def solve(n,m,a):
  a = [-x for x in a]
  heapq.heapify(a)
  for _ in range(m):
    x = heapq.heappop(a)
    heapq.heappush(a,-(abs(x)//2))
  return abs(sum(a)) def solve(n,m,a):
  a = [-x for x in a]
  heapq.heapify(a)
  for _ in range(m):
    x = heapq.heappop(a)
    heapq.heappush(a,-(abs(x)//2))
  return abs(sum(a)) solve def main():
  N,M = map(int,input().split())
  a = list(sorted(map(int,input().split())))
  print(solve(N,M,a))
  pass def main():
  N,M = map(int,input().split())
  a = list(sorted(map(int,input().split())))
  print(solve(N,M,a))
  pass main
#!/usr/bin/env python3
import heapq
# input = stdin.readline

def solve(n,m,a):
  a = [-x for x in a]
  heapq.heapify(a)
  for _ in range(m):
    x = heapq.heappop(a)
    heapq.heappush(a,-(abs(x)//2))
  return abs(sum(a))


def main():
  N,M = map(int,input().split())
  a = list(sorted(map(int,input().split())))
  print(solve(N,M,a))
  pass

if __name__ == '__main__':
  main()
