Run ID:146131

提交时间:2026-01-26 21:05:50

n,k=map(int,input().split()) total=0 while n>0: total+=n n//=k print(total)