Buggy python submission (verdict: Time Limit Exceeded):
import math
import bisect

N, M = map(int, input().split())
A = sorted(list(map(int, input().split())))

for i in range(M):
    n = A.pop() // 2
    bisect.insort(A, n)
    
for j in range(N):
    A[j] = math.floor(A[j])

print(sum(A))

Fixed submission:
from heapq import heapify, heappop, heappush

N, M = map(int, input().split())
A = list(map(int, input().split()))
A_minus = [-x for x in A]
heapify(A_minus)

for i in range(M):
    n = -heappop(A_minus) // 2
    heappush(A_minus, -n)

print(-sum(A_minus))

Buggy python submission (verdict: Time Limit Exceeded):
import math
import bisect

N, M = map(int, input().split())
A = sorted(list(map(int, input().split())))

for i in range(M):
    n = A.pop() / 2
    bisect.insort(A, n)

answer = 0
for j in range(N):
    answer += math.floor(A[j])

print(answer)

Fixed submission:
from heapq import heapify, heappop, heappush

N, M = map(int, input().split())
A = list(map(int, input().split()))
A_minus = [-x for x in A]
heapify(A_minus)

for i in range(M):
    n = -heappop(A_minus) // 2
    heappush(A_minus, -n)

print(-sum(A_minus))

Buggy python submission (verdict: Time Limit Exceeded):
import math
import bisect

N, M = map(int, input().split())
A = sorted(list(map(int, input().split())))

for i in range(M):
    n = A.pop() / 2
    bisect.insort(A, n)

answer = 0
for j in range(N):
    answer += math.floor(A[j])

print(answer)

Fixed submission:
from heapq import heapify, heappop, heappush

N, M = map(int, input().split())
A = list(map(int, input().split()))
A_minus = [-x for x in A]
heapify(A_minus)

for i in range(M):
    n = -heappop(A_minus) // 2
    heappush(A_minus, -n)

print(-sum(A_minus))

Buggy python submission (verdict: Time Limit Exceeded):
import math
import bisect

N, M = map(int, input().split())
A = sorted(list(map(int, input().split())))

for i in range(M):
    n = A.pop() / 2
    bisect.insort(A, n)

print(sum(math.floor(A[j]) for j in range(N)))

Fixed submission:
from heapq import heapify, heappop, heappush

N, M = map(int, input().split())
A = list(map(int, input().split()))
A_minus = [-x for x in A]
heapify(A_minus)

for i in range(M):
    n = -heappop(A_minus) // 2
    heappush(A_minus, -n)

print(-sum(A_minus))

Buggy python submission (verdict: Time Limit Exceeded):
import math
import bisect

N, M = map(int, input().split())
A = sorted(list(map(int, input().split())))

for i in range(M):
    n = A.pop() / 2
    bisect.insort(A, n)
    
for j in range(N):
    A[j] = math.floor(A[j])

print(sum(A))


Fixed submission:
from heapq import heapify, heappop, heappush

N, M = map(int, input().split())
A = list(map(int, input().split()))
A_minus = [-x for x in A]
heapify(A_minus)

for i in range(M):
    n = -heappop(A_minus) // 2
    heappush(A_minus, -n)

print(-sum(A_minus))

Buggy python submission (verdict: Time Limit Exceeded):
import math

N, M = map(int, input().split())
A = sorted(list(map(int, input().split())))

for i in range(M):
    A[-1] /= 2
    A = sorted(A)

for j in range(N):
    A[j] = math.floor(A[j])

print(sum(A))


Fixed submission:
from heapq import heapify, heappop, heappush

N, M = map(int, input().split())
A = list(map(int, input().split()))
A_minus = [-x for x in A]
heapify(A_minus)

for i in range(M):
    n = -heappop(A_minus) // 2
    heappush(A_minus, -n)

print(-sum(A_minus))

Buggy python submission (verdict: Time Limit Exceeded):
import math

N, M = map(int, input().split())
A = sorted(list(map(int, input().split())))

for i in range(M):
    A[-1] /= 2
    A.sort()

for j in range(N):
    A[j] = math.floor(A[j])

print(sum(A))

Fixed submission:
from heapq import heapify, heappop, heappush

N, M = map(int, input().split())
A = list(map(int, input().split()))
A_minus = [-x for x in A]
heapify(A_minus)

for i in range(M):
    n = -heappop(A_minus) // 2
    heappush(A_minus, -n)

print(-sum(A_minus))