Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
72422 吕毅心 14能吸多少根烟 C++ Accepted 1 MS 272 KB 295 2024-05-05 19:12:26

Tests(10/10):


Code:

# include<iostream> # include<cstdio> using namespace std; int main(){ int n,k,i=1,yt=0,sum=0; cin>>n>>k; while(n>0){ sum+=n; yt+=n; n=0; n+=yt/k; yt%=k; } cout<<sum; return 0; }