下载了第一个测试点,明明是对的,但现实WA。
#include<bits/stdc++.h> using namespace std; int main(){ int n,k,t; int cnt=0; cin>>n>>k; while(n){ cnt+=n; t+=n; n=0; n+=(t-t%k)/k; t=t%k; } cout<<cnt; return 0; }