/**
 * This function takes in a list of numbers and an increment value as arguments.
 * It then prints the numbers from the list that are divisible by the increment value.
 *
 * @param numbers A list of numbers.
 * @param increment An integer to increment the numbers by.
 */
fun nestedIfListIntersection(numbers: List<Any>, increment: Int) {

    if (numbers.all { it is Int } && increment is Int) {
        for (num in numbers) {
            if (num is Int && num % increment == 0) {
                println(num)
            }
        }
    } else {
        when {
            !numbers.all { it is Int } -> println("Invalid input: numbers must be a list")
            increment !is Int -> println("Invalid input: increment must be an integer")
            else -> println("Invalid input: both arguments must be of correct types")
        }
    }
}
/**
 * This function takes in a list of numbers and an increment value as arguments.
 * It then prints the numbers from the list that are divisible by the increment value.
 *
 * @param numbers A list of numbers.
 * @param increment An integer to increment the numbers by.
 */
fun nestedIfListIntersection(numbers: List<Any>, increment: Int) {
/**
 * This function takes in a list of numbers and an increment value as arguments.
 * It then prints the numbers from the list that are divisible by the increment value.
 *
 * @param numbers A list of numbers.
 * @param increment An integer to increment the numbers by.
 */
fun nestedIfListIntersection(numbers: List<Any>, increment: Int) {

    if (numbers.all { it is Int } && increment is Int) {
        for (num in numbers) {
            if (num is Int && num % increment == 0) {
                println(num)
            }
        }
    } else {
        when {
            !numbers.all { it is Int } -> println("Invalid input: numbers must be a list")
            increment !is Int -> println("Invalid input: increment must be an integer")
            else -> println("Invalid input: both arguments must be of correct types")
        }
    }
}