목차

새 앨범

ps
링크acmicpc.net/…
출처BOJ
문제 번호1424
문제명새 앨범
레벨골드 2
분류

애드혹

시간복잡도O(1)
사용한 언어Python 3.11
제출기록30616KB / 40ms
최고기록40ms
해결날짜2022/12/18

풀이

코드

"""Solution code for "BOJ 1424. 새 앨범".

- Problem link: https://www.acmicpc.net/problem/1424
- Solution link: http://www.teferi.net/ps/problems/boj/1424
"""


def main():
    N = int(input())
    L = int(input())
    C = int(input())

    song_count_per_cd = (C + 1) // (L + 1)
    song_count_per_cd = min(song_count_per_cd, N)
    if song_count_per_cd % 13 == 0:
        song_count_per_cd -= 1
    q, r = divmod(N, song_count_per_cd)
    if r == 0:
        answer = q
    elif r % 13 == 0 and song_count_per_cd == r + 1:
        answer = q + 2
    else:
        answer = q + 1

    print(answer)


if __name__ == '__main__':
    main()