Buggy python submission (verdict: Time Limit Exceeded):
def main():
  n, k = map(int, input().split())
  a = list(map(int, input().split()))

  for i in range(n):
    a[i] = [(-1) * a[i], (-1) * a[i], 1]

  import heapq
  heapq.heapify(a)

  for _ in range(k):
    i = heapq.heappop(a)
    i[2] += 1
    i[0] = i[1] / i[2]
    heapq.heappush(a, i)

  from math import ceil
  print(ceil((-1) * heapq.heappop(a)[0]))

main()

Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))

# binary search
left = 1
right = 10 ** 9

while left < right:
    center = (left + right) // 2

    total = 0
    for i in a:
        if i % center == 0:
            i -= 1
        total += i//center
    
    if total > k:
        left = center + 1
    else:
        right = center

print(left)

Buggy python submission (verdict: Time Limit Exceeded):
def main():
  n, k = map(int, input().split())
  a = list(map(int, input().split()))

  for i in range(n):
    a[i] = [(-1) * a[i], (-1) * a[i], 1]

  import heapq
  heapq.heapify(a)

  for _ in range(k):
    i = heapq.heappop(a)
    i[2] += 1
    i[0] = i[1] / i[2]
    heapq.heappush(a, i)

  from math import ceil
  print(ceil((-1) * heapq.heappop(a)[0]))

main()

Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))

# binary search
left = 1
right = 10 ** 9

while left < right:
    center = (left + right) // 2

    total = 0
    for i in a:
        if i % center == 0:
            i -= 1
        total += i//center
    
    if total > k:
        left = center + 1
    else:
        right = center

print(left)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
a = list(map(int, input().split()))

for i in range(n):
  a[i] = [(-1) * a[i], (-1) * a[i], 1]

import heapq
heapq.heapify(a)

for _ in range(k):
  i = heapq.heappop(a)
  i[2] += 1
  i[0] = i[1] / i[2]
  heapq.heappush(a, i)

from math import ceil
print(ceil((-1) * heapq.heappop(a)[0]))


Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))

# binary search
left = 1
right = 10 ** 9

while left < right:
    center = (left + right) // 2

    total = 0
    for i in a:
        if i % center == 0:
            i -= 1
        total += i//center
    
    if total > k:
        left = center + 1
    else:
        right = center

print(left)

Buggy python submission (verdict: Time Limit Exceeded):
from decimal import Decimal

n, k = map(int, input().split())
a = list(map(int, input().split()))

for i in range(n):
  a[i] = [(-1) * a[i], Decimal(str((-1) * a[i])), (-1) * a[i], Decimal(str((-1) * a[i])), 1]

import heapq
heapq.heapify(a)

for _ in range(k):
  i = heapq.heappop(a)
  i[4] += 1
  i[0] = i[2] // i[4]
  i[1] = i[3] / i[4]
  heapq.heappush(a, i)

print((-1) * heapq.heappop(a)[0])


Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))

# binary search
left = 1
right = 10 ** 9

while left < right:
    center = (left + right) // 2

    total = 0
    for i in a:
        if i % center == 0:
            i -= 1
        total += i//center
    
    if total > k:
        left = center + 1
    else:
        right = center

print(left)

Buggy python submission (verdict: Time Limit Exceeded):
from decimal import Decimal

n, k = map(int, input().split())
a = list(map(int, input().split()))

for i in range(n):
  a[i] = [(-1) * a[i], Decimal(str((-1) * a[i])), (-1) * a[i], Decimal(str((-1) * a[i])), 1]

import heapq
heapq.heapify(a)

for _ in range(k):
  i = heapq.heappop(a)
  i[4] += 1
  i[0] = i[2] // i[4]
  i[1] = i[3] / i[4]
  heapq.heappush(a, i)

print((-1) * heapq.heappop(a)[0])

Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))

# binary search
left = 1
right = 10 ** 9

while left < right:
    center = (left + right) // 2

    total = 0
    for i in a:
        if i % center == 0:
            i -= 1
        total += i//center
    
    if total > k:
        left = center + 1
    else:
        right = center

print(left)

Buggy python submission (verdict: Time Limit Exceeded):
from decimal import Decimal

n, k = map(int, input().split())
a = list(map(Decimal, input().split()))

for i in range(n):
  a[i] = [(-1) * a[i], (-1) * a[i], 1]

import heapq
heapq.heapify(a)

for _ in range(k):
  i = heapq.heappop(a)
  i[2] += 1
  i[0] = i[1] / i[2]
  heapq.heappush(a, i)

from math import ceil
print(ceil((-1) * heapq.heappop(a)[0]))

Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))

# binary search
left = 1
right = 10 ** 9

while left < right:
    center = (left + right) // 2

    total = 0
    for i in a:
        if i % center == 0:
            i -= 1
        total += i//center
    
    if total > k:
        left = center + 1
    else:
        right = center

print(left)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
a = list(map(int, input().split()))

for i in range(n):
  a[i] = [(-1) * a[i], (-1) * a[i], 1]

import heapq
heapq.heapify(a)

for _ in range(k):
  i = heapq.heappop(a)
  i[2] += 1
  i[0] = i[1] / i[2]
  heapq.heappush(a, i)

from math import ceil
print(ceil((-1) * heapq.heappop(a)[0]))

Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))

# binary search
left = 1
right = 10 ** 9

while left < right:
    center = (left + right) // 2

    total = 0
    for i in a:
        if i % center == 0:
            i -= 1
        total += i//center
    
    if total > k:
        left = center + 1
    else:
        right = center

print(left)