```cpp
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n,k;
cin>>n>>k;
cout<<n+(n-1)/(k-1);
return 0;
}
```
by hanruchen_rainbowcat @ 2023-10-19 11:52:45