Utility function to check if the given number is semi - prime or not
static boolean isSemiPrime ( int num ) { int cnt = 0 ; for ( int i = 2 ; cnt < 2 && i * i <= num ; ++ i ) while ( num % i == 0 ) { num /= i ;