/**
 * This function takes two nested tuples as input and performs division assignment on them.
 *
 * @param tup1 The first nested tuple.
 * @param tup2 The second nested tuple.
 * @return The result of division assignment on the nested tuples.
 */
fun divideAssignNestedTuples(tup1: List<Any>, tup2: List<Any>): List<Any> {

    // Check if the input tuples are empty
    if (tup1.isEmpty() || tup2.isEmpty()) {
        return emptyList()
    }

    // Initialize an empty list to store the result
    val result = mutableListOf<Any>()

    // Iterate over the elements of the first nested tuple
    for (i in tup1.indices) {
        // Check if the element is a nested tuple
        if (tup1[i] is List<*>) {
            // Check if the corresponding index in the second nested tuple is also a nested tuple
            if (tup2[i] is List<*>) {
                // Perform division assignment on the nested tuples recursively
                result.add(divideAssignNestedTuples(tup1[i] as List<Any>, tup2[i] as List<Any>))
            } else {
                // The second nested tuple does not have a corresponding nested tuple at this index
                result.add(tup1[i])
            }
        } else {
            // Check if the element is a number
            if (tup1[i] is Number && tup2[i] is Number) {
                // Perform division assignment on the numbers
                result.add((tup1[i] as Number).toDouble() / (tup2[i] as Number).toDouble())
            } else {
                result.add(tup1[i])
            }
        }
    }

    return result
}
/**
 * This function takes two nested tuples as input and performs division assignment on them.
 *
 * @param tup1 The first nested tuple.
 * @param tup2 The second nested tuple.
 * @return The result of division assignment on the nested tuples.
 */
fun divideAssignNestedTuples(tup1: List<Any>, tup2: List<Any>): List<Any> {
/**
 * This function takes two nested tuples as input and performs division assignment on them.
 *
 * @param tup1 The first nested tuple.
 * @param tup2 The second nested tuple.
 * @return The result of division assignment on the nested tuples.
 */
fun divideAssignNestedTuples(tup1: List<Any>, tup2: List<Any>): List<Any> {

    // Check if the input tuples are empty
    if (tup1.isEmpty() || tup2.isEmpty()) {
        return emptyList()
    }

    // Initialize an empty list to store the result
    val result = mutableListOf<Any>()

    // Iterate over the elements of the first nested tuple
    for (i in tup1.indices) {
        // Check if the element is a nested tuple
        if (tup1[i] is List<*>) {
            // Check if the corresponding index in the second nested tuple is also a nested tuple
            if (tup2[i] is List<*>) {
                // Perform division assignment on the nested tuples recursively
                result.add(divideAssignNestedTuples(tup1[i] as List<Any>, tup2[i] as List<Any>))
            } else {
                // The second nested tuple does not have a corresponding nested tuple at this index
                result.add(tup1[i])
            }
        } else {
            // Check if the element is a number
            if (tup1[i] is Number && tup2[i] is Number) {
                // Perform division assignment on the numbers
                result.add((tup1[i] as Number).toDouble() / (tup2[i] as Number).toDouble())
            } else {
                result.add(tup1[i])
            }
        }
    }

    return result
}