본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬] 1673번 치킨 쿠폰

by 현장 2022. 5. 27.

-Code

while 1:
    try:
        n, k = map(int, input().split())
        plus, temp = n, 0
        while plus // k:
            temp = plus // k
            temp2 = plus % k
            n += temp
            plus = temp + temp2

        print(n)
    except EOFError:
        break