简单题
View Code
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cstdio>
using namespace std;
int main()
{
//freopen("D:\\t.txt", "r", stdin);
int n, k;
while (scanf("%d%d", &n, &k) != EOF)
{
int ans = n + (n / (k - 1));
if (n % (k - 1) == 0)
ans--;
printf("%d\n", ans);
}
return 0;
}