SOLUTION INFO
Python · main.py
import sys
def input():
return sys.stdin.readline().rstrip()
n, m, l = map(int, input().split())
rests = sorted([0] + list(map(int, input().split())) + [l])
low = 1
high = l
answer = high
while low <= high:
mid = (low + high) // 2
cnt = 0
for i in range(n+1):
cnt += (rests[i+1] - rests[i] - 1) // mid
if cnt<=m:
answer = mid
high = mid - 1
else:
low = mid + 1
print(answer)
SOLUTION DESCRIPTION
풀이 설명
등록된 풀이 설명이 없습니다.