Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
74837 李雨昊 14能吸多少根烟 C++ Accepted 1 MS 276 KB 199 2024-05-26 09:36:59

Tests(10/10):


Code:

#include<iostream> #include<cstdio> using namespace std; int main() { int c,s=0,b,a=0,n=0,k; cin>>c>>k; s+=c; b=s; while(b >=k ){ n=b/k; a=b%k; b=n+a; s+=n; } cout<<s; }