/**
 * Given a positive integer n and a list of prime numbers as input, return true if n has any prime factors,
 * otherwise return false. Use short-circuiting and nested loops with break and continue statements to optimize
 * the solution.
 *
 * @param n A positive integer.
 * @param primes A list of prime numbers.
 * @return true if n has any prime factors, false otherwise.
 */
fun hasPrimeFactors(n: Int, primes: List<Int>): Boolean {

    // Check if n is divisible by any of the prime numbers
    for (prime in primes) {
        // If n is divisible by a prime number, it has prime factors
        if (n % prime == 0) {
            return true
        }

        // If n is less than the square of the current prime number, break the loop
        if (n < prime * prime) {
            break
        }
    }
    return false
}
/**
 * Given a positive integer n and a list of prime numbers as input, return true if n has any prime factors,
 * otherwise return false. Use short-circuiting and nested loops with break and continue statements to optimize
 * the solution.
 *
 * @param n A positive integer.
 * @param primes A list of prime numbers.
 * @return true if n has any prime factors, false otherwise.
 */
fun hasPrimeFactors(n: Int, primes: List<Int>): Boolean {
/**
 * Given a positive integer n and a list of prime numbers as input, return true if n has any prime factors,
 * otherwise return false. Use short-circuiting and nested loops with break and continue statements to optimize
 * the solution.
 *
 * @param n A positive integer.
 * @param primes A list of prime numbers.
 * @return true if n has any prime factors, false otherwise.
 */
fun hasPrimeFactors(n: Int, primes: List<Int>): Boolean {

    // Check if n is divisible by any of the prime numbers
    for (prime in primes) {
        // If n is divisible by a prime number, it has prime factors
        if (n % prime == 0) {
            return true
        }

        // If n is less than the square of the current prime number, break the loop
        if (n < prime * prime) {
            break
        }
    }
    return false
}