-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
'Beakjoon&프로그래머스 > 파이썬' 카테고리의 다른 글
[백준/파이썬] 2037번 문자메시지 (0) | 2022.05.27 |
---|---|
[백준/파이썬] 1673번 줄 세우기 (0) | 2022.05.27 |
[백준/파이썬] 1392번 노래 악보 (0) | 2022.05.27 |
[백준/파이썬] 1362번 펫 (0) | 2022.05.27 |
[백준/파이썬] 25175번 두~~부 두부 두부 (0) | 2022.05.27 |