Initiate Luogu

This commit is contained in:
e2hang
2025-08-13 21:38:49 +08:00
parent ab606e0cbd
commit 8bfe9f31f3
22 changed files with 735 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
#include <iostream>
using namespace std;
int main(){
int n,k;
cin>>n>>k;
int tmp=n;
int js=n;
while(tmp>k){
js+=int(tmp/k);
tmp=tmp%k+tmp/k;
}
cout<<js<<endl;
return 0;
}
/* 4%3=1 5%3=2 2+int(5/3)=3 3%3=0
6%4=2 2+6/4=3*/