PersonalCorpus 版 (精华区)
1140143 Big Guava ... 10346 Accepted
0:00.000 64 2002/10/03 07:56:43.750
void main()
{
#ifndef ONLINE_JUDGE
freopen("c:\\uva\\contest824\\inputB.txt","r",stdin);
freopen("c:\\uva\\contest824\\outputB.txt","w",stdout);
#endif
int n,k,sum,b;
while (scanf("%d%d\n",&n,&k)==2) {
b=n; sum=n;
while (b>=k) {
n=b/k;
b%=k;
sum+=n;
b+=n;
}
printf("%d\n",sum);
}
}
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:25.119毫秒