88的雷达8

yang_zhiyu 2023-11-11 11:25:55

#include <bits/stdc++.h> 
using namespace std;
 
const int mod=1000000007; 

long long A(int n,int k)
{
	long long sum1=1;
	for (int i=n;i>n-k;i--) sum1*=i, sum1%=mod;
	 
	return sum1;
}

int main() 
{ 
	int n, k; 
	cin >> n >> k; 
	
	cout<<A(n-k+1,n-k+1)*A(k,k)%mod<<endl;
	return 0; 
}```