import bisect,collections,copy,heapq,itertools,math,string
from collections import defaultdict as D
from functools import reduce
from heapq import heappop,heappush,heapify
import numpy as np
import sys
import os
sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353    

N, M = LI()
A = LI()

A_minus = [-x for x in A]

heapify(A_minus)

pop = lambda: -heappop(A_minus)
push = lambda x: heappush(A_minus,-x)

for _ in range(M):
    # 高速に値を取り出す。O(logN)
    x = pop()
    push(x//2)
 
answer = -sum(A_minus)
print(answer) import bisect,collections,copy,heapq,itertools,math,string bisect collections copy heapq itertools math string from collections import defaultdict as D from functools import reduce from heapq import heappop,heappush,heapify import numpy as np numpy import sys sys import os os sys.setrecursionlimit(10**7) sys.setrecursionlimit sys setrecursionlimit 10**7 10 7 def _S(): return sys.stdin.readline().rstrip() _S def I(): return int(_S()) I def LS(): return list(_S().split()) LS def LI(): return list(map(int,LS())) LI if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r") os.getenv("LOCAL") os.getenv os getenv "LOCAL" inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt' inputFile os.path.splitext(os.path.basename(__file__))[0]+'.txt' os.path.splitext(os.path.basename(__file__))[0] os.path.splitext(os.path.basename(__file__)) os.path.splitext os.path os path splitext os.path.basename(__file__) os.path.basename os.path os path basename __file__ 0 '.txt' = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt' basename_without_ext os.path.splitext(os.path.basename(__file__))[0]+'.txt' sys.stdin = open(inputFile, "r") sys.stdin sys stdin open(inputFile, "r") open inputFile "r" INF = float("inf") INF float("inf") float "inf" IINF = 10 ** 18 IINF 10 ** 18 10 18 MOD = 10 ** 9 + 7 MOD 10 ** 9 + 7 10 ** 9 10 9 7 N, M = LI() N LI() LI M A = LI() A LI() LI -x for x in A for x in A x A for x in A -x x A_minus = [-x for x in A] A_minus [-x for x in A] heapify(A_minus) heapify A_minus pop = lambda: -heappop(A_minus) pop lambda: -heappop(A_minus) -heappop(A_minus) heappop(A_minus) heappop A_minus push = lambda x: heappush(A_minus,-x) push lambda x: heappush(A_minus,-x) heappush(A_minus,-x) heappush A_minus -x x x for _ in range(M):
    # 高速に値を取り出す。O(logN)
    x = pop()
    push(x//2)
  _ range(M) range M x = pop() x pop() pop push(x//2) push x//2 x 2 answer = -sum(A_minus) answer -sum(A_minus) sum(A_minus) sum A_minus print(answer) print answer push = lambda x: heappush(A_minus,-x) lambda x: heappush(A_minus,-x) push IINF = 10 ** 18 10 ** 18 IINF def LS(): return list(_S().split()) def LS(): return list(_S().split()) LS MOD = 10 ** 9 + 7 10 ** 9 + 7 MOD N, M = LI() LI() N answer = -sum(A_minus) -sum(A_minus) answer M = LI() LI() M inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt' os.path.splitext(os.path.basename(__file__))[0]+'.txt' inputFile def LI(): return list(map(int,LS())) def LI(): return list(map(int,LS())) LI INF = float("inf") float("inf") INF def I(): return int(_S()) def I(): return int(_S()) I pop = lambda: -heappop(A_minus) lambda: -heappop(A_minus) pop def _S(): return sys.stdin.readline().rstrip() def _S(): return sys.stdin.readline().rstrip() _S basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt' os.path.splitext(os.path.basename(__file__))[0]+'.txt' basename_without_ext A = LI() LI() A A_minus = [-x for x in A] [-x for x in A] A_minus x = pop() pop() x
import bisect,collections,copy,heapq,itertools,math,string
from collections import defaultdict as D
from functools import reduce
from heapq import heappop,heappush,heapify
import numpy as np
import sys
import os
sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353    

N, M = LI()
A = LI()

A_minus = [-x for x in A]

heapify(A_minus)

pop = lambda: -heappop(A_minus)
push = lambda x: heappush(A_minus,-x)

for _ in range(M):
    # 高速に値を取り出す。O(logN)
    x = pop()
    push(x//2)
 
answer = -sum(A_minus)
print(answer)