/**
 * This function takes in two nested lists and returns a new nested list with the common elements based on modulus.
 */
fun checkListModulus(list1: List<List<Int>>, list2: List<List<Int>>): List<List<Int>> {

    val result = mutableListOf<List<Int>>()
    for (subList1 in list1) {
        for (subList2 in list2) {
            val commonElements = mutableListOf<Int>()
            for (num1 in subList1) {
                for (num2 in subList2) {
                    if (num1 % num2 == 0) {
                        commonElements.add(num1)
                    }
                }
            }
            result.add(commonElements)
        }
    }
    return result
}
/**
 * This function takes in two nested lists and returns a new nested list with the common elements based on modulus.
 */
fun checkListModulus(list1: List<List<Int>>, list2: List<List<Int>>): List<List<Int>> {
/**
 * This function takes in two nested lists and returns a new nested list with the common elements based on modulus.
 */
fun checkListModulus(list1: List<List<Int>>, list2: List<List<Int>>): List<List<Int>> {

    val result = mutableListOf<List<Int>>()
    for (subList1 in list1) {
        for (subList2 in list2) {
            val commonElements = mutableListOf<Int>()
            for (num1 in subList1) {
                for (num2 in subList2) {
                    if (num1 % num2 == 0) {
                        commonElements.add(num1)
                    }
                }
            }
            result.add(commonElements)
        }
    }
    return result
}