Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import heapq


num_product, num_coupon = [int(s) for s in input().split()]
price_list = []
for s in input().split():
  heapq.heappush(price_list, int(s))

for i in range(num_coupon):
  max_price = max(price_list)
  for j in range(len(price_list)):
    if price_list[j] == max_price:
      price_list[j] //= 2
      break

sum = 0
for price in price_list:
  sum += price

print(sum)

Fixed submission:
# -*- coding: utf-8 -*-
import heapq

num_product, num_coupon = [int(s) for s in input().split()]
price_list = []
for s in input().split():
  heapq.heappush(price_list, int(s)*-1)

for i in range(num_coupon):
  min = price_list[0]
  heapq.heapreplace(price_list, (min*-1//2)*-1)

sum = 0
for price in price_list:
  sum -= price

print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
 
num_product, num_coupon = [int(s) for s in input().split()]
price_list = [int(s) for s in input().split()]

for i in range(num_coupon):
  max_price = max(price_list)
  for j in range(len(price_list)):
    if price_list[j] == max_price:
      price_list[j] //= 2
      break

sum = 0
for price in price_list:
  sum += price

print(sum)

Fixed submission:
# -*- coding: utf-8 -*-
import heapq

num_product, num_coupon = [int(s) for s in input().split()]
price_list = []
for s in input().split():
  heapq.heappush(price_list, int(s)*-1)

for i in range(num_coupon):
  min = price_list[0]
  heapq.heapreplace(price_list, (min*-1//2)*-1)

sum = 0
for price in price_list:
  sum -= price

print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
 
num_product, num_coupon = [int(s) for s in input().split()]
price_list = [int(s) for s in input().split()]
price_list.sort()
price_list.reverse()
discountable_price = price_list[0:num_coupon]

fixed_sum = 0

for price in price_list[num_coupon:]:
  fixed_sum += price

for i in range(num_coupon):
  discountable_price[0] //= 2
  discountable_price.sort()
  discountable_price.reverse()

sum = 0
for price in discountable_price:
  sum += price

sum += fixed_sum
print(sum)

Fixed submission:
# -*- coding: utf-8 -*-
import heapq

num_product, num_coupon = [int(s) for s in input().split()]
price_list = []
for s in input().split():
  heapq.heappush(price_list, int(s)*-1)

for i in range(num_coupon):
  min = price_list[0]
  heapq.heapreplace(price_list, (min*-1//2)*-1)

sum = 0
for price in price_list:
  sum -= price

print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
 
num_product, num_coupon = [int(s) for s in input().split()]
price_list = [int(s) for s in input().split()]

for i in range(num_coupon):
  price_list.sort()
  price_list.reverse()
  price_list[0] //= 2

sum = 0
for price in price_list:
  sum += price
  
print(sum)

Fixed submission:
# -*- coding: utf-8 -*-
import heapq

num_product, num_coupon = [int(s) for s in input().split()]
price_list = []
for s in input().split():
  heapq.heappush(price_list, int(s)*-1)

for i in range(num_coupon):
  min = price_list[0]
  heapq.heapreplace(price_list, (min*-1//2)*-1)

sum = 0
for price in price_list:
  sum -= price

print(sum)