08-25-2025

This commit is contained in:
e2hang
2025-08-25 21:45:54 +08:00
parent 8edd0f98b5
commit 4e76498908
4 changed files with 41 additions and 11 deletions

View File

@@ -1,17 +1,14 @@
#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;
int n, k;
cin >> n >> k;
int tmp = n;
int js = 0;
while(tmp >= k){
tmp = tmp - k + 1;
js++;
}
cout<<js<<endl;
cout << n + 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*/