백준 1673번: 치킨 쿠폰 #Python

ColorlessDia·2024년 2월 15일

algorithm/baekjoon

목록 보기
84/809
import sys

while True:
    try:
        N, K = map(int, sys.stdin.readline().split())

        chicken = N

        while True:
            if N // K == 0:
                break

            chicken += N // K
            N = (N // K) + N % K

        print(chicken)
    except:
        break

0개의 댓글