1 条题解

  • 1
    
    #include<bits/stdc++.h>
    using namespace std;
    int main() 
    {
        long long n,k,sum,bot;
        cin>>n>>k;
        sum=n;
        bot=n;
        while(bot>=k) 
        {
            long long t=bot/k;
            sum+=t;
            bot=bot%k+t;
        }
        cout<<sum;
        return 0;
    }
    
  • 1

信息

ID
3064
难度
9
分类
(无)
标签
递交数
4
已通过
2
通过率
50%
上传者