Function that calculate the count of each prime factor of a number
void primeFactorize ( int a ) { for ( int i = 2 ; i * i <= a ; i += 2 ) { int cnt = 0 ; while ( a % i == 0 ) { cnt ++ ; a /= i ; } ma [ i ] = cnt ; } if ( a > 1 ) { ma [ a ] = 1 ; } }