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