https://www.acmicpc.net/problem/2792
# 보석상자
import math, sys
input = sys.stdin.readline
n, m = map(int, input().split())
color = [int(input()) for _ in range(m)]
start = 1
end = max(color)
result = 0
while start <= end:
mid = (start+end)//2
total = 0
for c in color:
total += math.ceil(c/mid)
if total > n:
start = mid + 1
else:
result = mid
end = mid - 1
print(result)
이분탐색을 이용한다.