← Back to List

1673번: 치킨 쿠폰 ↗

Solutions

Python 3
238 B | 238 chars
while True:
    try:
        n,k = map(int,input().split())
    except:
        break
    
    S = n
    stamp = n
    while stamp >= k:
        cnt = stamp // k
        stamp = stamp % k
        stamp += cnt
        S += cnt
    print(S)