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

N, K = map(int, input().split())
A = list(map(int, input().split()))
# N, K = 2*10**5, 1
# A = [10**9]*N

def solve(x):
    m = 0
    for a in A:
        m += a//x - (a%x == 0)
    # print(x, m)
    return m <= K

A = [a*10**10 for a in A]

ok, ng = max(A), 0
while abs(ok-ng > 1):
    mid = (ok+ng)//2
    # print(mid)
    if solve(mid):
        ok = mid
    else:
        ng = mid

print(-(-mid//10**10))

Fixed submission:
BIG = 10**10

N, K = map(int, input().split())
A = list(map(int, input().split()))
# N, K = 2*10**5, 2*10**5
# A = [10**9]*N

def solve(x):
    m = 0
    for a in A:
        m += -(-(a//x))
    # print(x, m)
    return m > K

A = [a*BIG for a in A]

# c = 0
ok, ng = 0, max(A)
while abs(ok-ng) > 1:
    mid = (ok+ng)//2
    # print(mid)
    if solve(mid):
        ok = mid
    else:
        ng = mid
    # c += 1

# print(c)

print(-(-ok//BIG))

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

N, K = map(int, input().split())
A = list(map(int, input().split()))
# N, K = 2*10**5, 1
# A = [10**9]*N

def solve(x):
    m = 0
    for a in A:
        m += a//x - (a%x == 0)
    # print(x, m)
    return m <= K

A = [a*10**10 for a in A]

ok, ng = max(A), 0
while abs(ok-ng > 1):
    mid = (ok+ng)//2
    # print(mid)
    if solve(mid):
        ok = mid
    else:
        ng = mid

print(-(-mid//10**10))

Fixed submission:
BIG = 10**10

N, K = map(int, input().split())
A = list(map(int, input().split()))
# N, K = 2*10**5, 2*10**5
# A = [10**9]*N

def solve(x):
    m = 0
    for a in A:
        m += -(-(a//x))
    # print(x, m)
    return m > K

A = [a*BIG for a in A]

# c = 0
ok, ng = 0, max(A)
while abs(ok-ng) > 1:
    mid = (ok+ng)//2
    # print(mid)
    if solve(mid):
        ok = mid
    else:
        ng = mid
    # c += 1

# print(c)

print(-(-ok//BIG))

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

N, K = map(int, input().split())
A = list(map(int, input().split()))
# N, K = 2*10**5, 1
# A = [10**9]*N

def solve(x):
    m = 0
    for a in A:
        m += a//x - (a%x == 0)
    # print(x, m)
    return m <= K

ok, ng = Decimal(max(A)), Decimal(0)
while abs(ok-ng > Decimal(0.1**6)):
    mid = (ok+ng)/Decimal(2)
    # print(mid)
    if solve(mid):
        ok = mid
    else:
        ng = mid

print(ceil(mid))

Fixed submission:
BIG = 10**10

N, K = map(int, input().split())
A = list(map(int, input().split()))
# N, K = 2*10**5, 2*10**5
# A = [10**9]*N

def solve(x):
    m = 0
    for a in A:
        m += -(-(a//x))
    # print(x, m)
    return m > K

A = [a*BIG for a in A]

# c = 0
ok, ng = 0, max(A)
while abs(ok-ng) > 1:
    mid = (ok+ng)//2
    # print(mid)
    if solve(mid):
        ok = mid
    else:
        ng = mid
    # c += 1

# print(c)

print(-(-ok//BIG))

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

N, K = map(int, input().split())
A = list(map(int, input().split()))
# N, K = 2*10**5, 1
# A = [10**9]*N

def solve(x):
    m = 0
    for a in A:
        m += a//x - (a%x == 0)
    # print(x, m)
    return m <= K

ok, ng = max(A), 0
while abs(ok-ng > 0.1**6):
    mid = (ok+ng)/2
    # print(mid)
    if solve(mid):
        ok = mid
    else:
        ng = mid

print(ceil(mid))

Fixed submission:
BIG = 10**10

N, K = map(int, input().split())
A = list(map(int, input().split()))
# N, K = 2*10**5, 2*10**5
# A = [10**9]*N

def solve(x):
    m = 0
    for a in A:
        m += -(-(a//x))
    # print(x, m)
    return m > K

A = [a*BIG for a in A]

# c = 0
ok, ng = 0, max(A)
while abs(ok-ng) > 1:
    mid = (ok+ng)//2
    # print(mid)
    if solve(mid):
        ok = mid
    else:
        ng = mid
    # c += 1

# print(c)

print(-(-ok//BIG))