#include<stdio.h>
#include<string.h>
int main()
{
int m,k,cnt,day;
while(scanf("%d%d",&m,&k)!=EOF&&m!=0||k!=0)
{
cnt=0;day=0;
while(m>0)
{
m--;day++;cnt++;
if(cnt==k)
{m++;cnt=0;}
}
printf("%d\n",day);
}
return 0;
}
hdu 1555 How many days? (模拟)
最新推荐文章于 2021-05-23 19:45:36 发布