function to calculate the largest power of a prime in a number
long long int power ( long long int x , long long int y ) { long long int count = 0 ; long long int z = y ; while ( x >= z ) { count += ( x / z ) ; z *= y ; } return count ; }