标签:
#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
int main()
{
int n,m,k,ans;
while(~scanf("%d%d",&n,&k))
{
ans=0;
m=0;
ans=n;
m=n;
while(n>=k)
{
m=n/k;
ans+=n/k;
n=n%k;
n+=m;
}
printf("%d\n",ans);
}
return 0;
}
版权声明:本文为博主原创文章,未经博主允许不得转载。
fzu 1150 Farmer Bill's Problem
标签:
原文地址:http://blog.csdn.net/xinag578/article/details/47357035