#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std;
int n,k,ans;
int main()
{
cin>>n>>k;
while(n>=k)
{
ans+=k;
n=n-k+1;
}
ans+=n;
printf("%d",ans);
}
转载于:https://www.cnblogs.com/dfsac/p/7587846.html