Function to factorize using spf and store in cnt
public static void factorize ( long f ) { while ( f > 1 ) { long x = spf [ ( int ) f ] ; while ( f % x == 0 ) { if ( cnt . ContainsKey ( x ) ) { long z = cnt [ x ] ; cnt [ x ] = ++ z ; } else cnt . Add ( x , ( long ) 1 ) ; f /= x ; } } }