阿冷alen @ 2019-08-05 16:21:49
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,k,ans=0;
cin>>n>>k;
ans+=n;
while(n>=k){
n/=k;
ans+=n;
}
cout<<ans<<endl;
return 0;
}
by 张晋曹 @ 2019-08-09 09:15:14