import heapq
from fractions import Fraction

n, m = list(map(int, input().split()))

a = list(map(lambda x: Fraction(1, int(x)), input().split()))

heapq.heapify(a)

for i in range(m):
    x = heapq.heappop(a)
    y = Fraction(x.numerator * 2, x.denominator)
    if y.numerator < y.denominator:
        heapq.heappush(a, y)
    elif len(a) == 0:
        break

s = 0


for j in range(len(a)):
    s += int(Fraction(a[j].denominator, a[j].numerator))

print(s) import heapq heapq from fractions import Fraction n, m = list(map(int, input().split())) n list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split m a = list(map(lambda x: Fraction(1, int(x)), input().split())) a list(map(lambda x: Fraction(1, int(x)), input().split())) list map(lambda x: Fraction(1, int(x)), input().split()) map lambda x: Fraction(1, int(x)) Fraction(1, int(x)) Fraction 1 int(x) int x x input().split() ().split () input split heapq.heapify(a) heapq.heapify heapq heapify a for i in range(m):
    x = heapq.heappop(a)
    y = Fraction(x.numerator * 2, x.denominator)
    if y.numerator < y.denominator:
        heapq.heappush(a, y)
    elif len(a) == 0:
        break i range(m) range m x = heapq.heappop(a) x heapq.heappop(a) heapq.heappop heapq heappop a y = Fraction(x.numerator * 2, x.denominator) y Fraction(x.numerator * 2, x.denominator) Fraction x.numerator * 2 x.numerator x numerator 2 x.denominator x denominator if y.numerator < y.denominator:
        heapq.heappush(a, y)
    elif len(a) == 0:
        break y.numerator < y.denominator y.numerator y numerator y.denominator y denominator heapq.heappush(a, y) heapq.heappush heapq heappush a y elif len(a) == 0:
        break len(a) == 0 len(a) len a 0 break s = 0 s 0 for j in range(len(a)):
    s += int(Fraction(a[j].denominator, a[j].numerator)) j range(len(a)) range len(a) len a s += int(Fraction(a[j].denominator, a[j].numerator)) s int(Fraction(a[j].denominator, a[j].numerator)) int Fraction(a[j].denominator, a[j].numerator) Fraction a[j].denominator [j] a j denominator a[j].numerator [j] a j numerator print(s) print s x = heapq.heappop(a) heapq.heappop(a) x y = Fraction(x.numerator * 2, x.denominator) Fraction(x.numerator * 2, x.denominator) y n, m = list(map(int, input().split())) list(map(int, input().split())) n a = list(map(lambda x: Fraction(1, int(x)), input().split())) list(map(lambda x: Fraction(1, int(x)), input().split())) a s += int(Fraction(a[j].denominator, a[j].numerator)) int(Fraction(a[j].denominator, a[j].numerator)) s s = 0 0 s m = list(map(int, input().split())) list(map(int, input().split())) m
import heapq
from fractions import Fraction

n, m = list(map(int, input().split()))

a = list(map(lambda x: Fraction(1, int(x)), input().split()))

heapq.heapify(a)

for i in range(m):
    x = heapq.heappop(a)
    y = Fraction(x.numerator * 2, x.denominator)
    if y.numerator < y.denominator:
        heapq.heappush(a, y)
    elif len(a) == 0:
        break

s = 0


for j in range(len(a)):
    s += int(Fraction(a[j].denominator, a[j].numerator))

print(s)
