Iterative Function to calculate ( nCr ) % p and save in f [ n ] [ r ] C ( n , r ) % p = [ C ( n - 1 , r - 1 ) % p + C ( n - 1 , r ) % p ] % p and C ( n , 0 ) = C ( n , n ) = 1
void nCr ( lli n , lli p , lli f [ ] [ m + 1 ] ) { for ( lli i = 0 ; i <= n ; i ++ ) { for ( lli j = 0 ; j <= m ; j ++ ) {