Returns largest power of k that divides n !
static int largestPowerOfK ( int n , int k ) { List < pair > vec = new List < pair > ( ) ; vec = primeFactorsofK ( k ) ; int ans = int . MaxValue ; for ( int i = 0 ; i < vec . Count ; i ++ )