yyz0526 @ 2024-02-24 10:40:43
#include <stdio.h>
using namespace std;
int main(){
int n,k,x;
scanf("%d%d",&n,&k);
x=n/k;
if(x+n%x*k>=k){
x++;
}
printf("%d",x+n);
return 0;
}
by 2023hkm @ 2024-02-24 11:13:54
AC代码
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,k;
cin>>n>>k;
cout<<n+(n-1)/(k-1);
return 0;
}
by yyz0526 @ 2024-02-25 13:17:50
@2023hkm yiihuiguan已回关~