Scroll indicator done
728x90

https://www.acmicpc.net/problem/1654


import sys

k, n = map(int, sys.stdin.readline().split())
lan = [int(sys.stdin.readline()) for _ in range(k)]
start, end = 1, max(lan)

while start <= end:
    mid = (start+end)//2
    line = 0
    for i in lan:
        line += i//mid 
    
    if line >= n:
        start = mid + 1
    else:
        end = mid - 1
        
print(end)
728x90

'BAEKJOON > Python' 카테고리의 다른 글

[B2108][통계학][python]  (0) 2021.03.19
[B1929][소수 구하기][python]  (0) 2021.03.19
[B11866][요세푸스 문제 0][python]  (0) 2021.03.18
[B2164][카드][python]  (0) 2021.03.18
[B10886][덱][python]  (0) 2021.03.18