from decimal import Decimal
from bisect import bisect
n,m=map(int,input().split())
lst=sorted(map(Decimal, input().split()))

while m>0:
    p=lst[-1]
    index=bisect(lst,p/2)
    for i in range(n-1,index-1,-1):
        if m>0:
            lst[i]=lst[i]/2
            m-=1
    lst=sorted(lst)
    if lst[-1]<1:
        break

ans=0
for i in lst:
    ans+=i//1
print(ans) from decimal import Decimal from bisect import bisect n,m=map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split m lst=sorted(map(Decimal, input().split())) lst sorted(map(Decimal, input().split())) sorted map(Decimal, input().split()) map Decimal input().split() ().split () input split while m>0:
    p=lst[-1]
    index=bisect(lst,p/2)
    for i in range(n-1,index-1,-1):
        if m>0:
            lst[i]=lst[i]/2
            m-=1
    lst=sorted(lst)
    if lst[-1]<1:
        break m>0 m 0 p=lst[-1] p lst[-1] lst -1 index=bisect(lst,p/2) index bisect(lst,p/2) bisect lst p/2 p 2 for i in range(n-1,index-1,-1):
        if m>0:
            lst[i]=lst[i]/2
            m-=1
     i range(n-1,index-1,-1) range n-1 n 1 index-1 index 1 -1 if m>0:
            lst[i]=lst[i]/2
            m-=1
     m>0 m 0 lst[i]=lst[i]/2 lst[i] lst i lst[i]/2 lst[i] lst i 2 m-=1 m 1 lst=sorted(lst) lst sorted(lst) sorted lst if lst[-1]<1:
        break lst[-1]<1 lst[-1] lst -1 1 break ans=0 ans 0 for i in lst:
    ans+=i//1 i lst ans+=i//1 ans i//1 i 1 print(ans) print ans m-=1 1 m lst=sorted(lst) sorted(lst) lst p=lst[-1] lst[-1] p index=bisect(lst,p/2) bisect(lst,p/2) index m=map(int,input().split()) map(int,input().split()) m n,m=map(int,input().split()) map(int,input().split()) n ans=0 0 ans lst=sorted(map(Decimal, input().split())) sorted(map(Decimal, input().split())) lst ans+=i//1 i//1 ans
from decimal import Decimal
from bisect import bisect
n,m=map(int,input().split())
lst=sorted(map(Decimal, input().split()))

while m>0:
    p=lst[-1]
    index=bisect(lst,p/2)
    for i in range(n-1,index-1,-1):
        if m>0:
            lst[i]=lst[i]/2
            m-=1
    lst=sorted(lst)
    if lst[-1]<1:
        break

ans=0
for i in lst:
    ans+=i//1
print(ans)