ac

给岁月以文明,而不是给文明以岁月  •  1个月前


include <bits/stdc++.h>

using namespace std;

int main() {

int n, k;
cin >> n >> k;

int total = n;
while (n >= k) {
    total += n / k;
    n = n / k + n % k;
}

cout << total << endl;
return 0;

}


评论:

请先登录,才能进行评论