Factorize arr [ i ] , count and store its factors in cnt
factorize ( arr [ i ] ) ; } for ( auto i : cnt ) { int ci = i . second ; res = ( res * nCrModP ( ci + K - 1 , K - 1 , P ) ) % P ; } return res ; }