#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
int n,k,x;
cin>>n>>k;
for(int i=1;i<=n;i++)
cin>>x;
int ans = (n-1)/(k-1);
if((n-1)%(k-1) != 0)
ans++;
cout<<ans<<endl;
return 0;
}
原文:https://www.cnblogs.com/QFNU-ACM/p/12898842.html