Untitled

mail@pastecode.io avatar
unknown
c_cpp
2 years ago
282 B
3
Indexable
Never
#include <iostream>
using namespace std;

int module = 1000000007;

int factorial(int n)
{
	int res = 1;
	for (int i = 1; i <= n; i++)
	{
		res *= i%module;
	}
	return res;
}

int main()
{
	int n,k;
	cin >> n >> k;

	cout << factorial(n)/(factorial(k) * factorial(n - k)) << endl;
}