/**
 * Find the intersection of nested tuples using modulus operator.
 */
fun intersectionNestedTuples(lst1: List<Pair<Int, Int>>, lst2: List<Pair<Int, Int>>): List<Pair<Int, Int>> {

    val result = mutableListOf<Pair<Int, Int>>()
    for (tuple1 in lst1) {
        for (tuple2 in lst2) {
            if (tuple1.first % tuple2.first == 0 && tuple1.second % tuple2.second == 0) {
                result.add(Pair(tuple1.first % tuple1.second, tuple2.first % tuple2.second))
            }
        }
    }
    return result
}
/**
 * Find the intersection of nested tuples using modulus operator.
 */
fun intersectionNestedTuples(lst1: List<Pair<Int, Int>>, lst2: List<Pair<Int, Int>>): List<Pair<Int, Int>> {
/**
 * Find the intersection of nested tuples using modulus operator.
 */
fun intersectionNestedTuples(lst1: List<Pair<Int, Int>>, lst2: List<Pair<Int, Int>>): List<Pair<Int, Int>> {

    val result = mutableListOf<Pair<Int, Int>>()
    for (tuple1 in lst1) {
        for (tuple2 in lst2) {
            if (tuple1.first % tuple2.first == 0 && tuple1.second % tuple2.second == 0) {
                result.add(Pair(tuple1.first % tuple1.second, tuple2.first % tuple2.second))
            }
        }
    }
    return result
}