Returns largest power of B that divides N !
int largestPowerOfB ( int N , int B ) { vector < pair < int , int > > vec ; vec = primeFactorsofB ( B ) ; int ans = INT_MAX ; for ( int i = 0 ; i < vec . size ( ) ; i ++ )