Function to return the number of ways to arrange K different objects taking N objects at a time
ll countArrangements ( ll n , ll k , ll p ) { return ( factorial ( n , p ) * nCrModP ( k , n , p ) ) % p ; }