//-------------------------------------------------------------
// number of combinations choosing k out of n
// # you might better consider to use Pascal's triangle
// # for comb modulo some number...
//
// Verified by
//   - SRM 350 Div1 LV2
//-------------------------------------------------------------

LL comb(LL n, LL k)
{
	k = min(k, n-k);

	LL c = 1;
	for(LL i=0; i<k; ++i)
		c *= n-i, c /= i+1;
	return c;
}
