Peter的烟

#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