#include #include using namespace std; typedef long long ll; typedef vector vl; typedef vector vvl; const ll mod=1e9+7; ll n,k,d; int main(){ cin>>n>>k>>d; // a:=残り数 b:=処理数 ll a=n%(k-1)==0?k-1:n%(k-1),b=(n-a)/(k-1); // コーナーケース if(d==1){ cout<