/**
 * This function takes two tuples as input and updates the second tuple based on specific conditions.
 *
 * @param tuple1 The first tuple.
 * @param tuple2 The second tuple.
 * @return The updated tuple after applying the given conditions.
 */
fun updateTuple(tuple1: Triple<Int, Int, Int>, tuple2: Triple<Int, Int, Int>): Triple<Int, Int, Int> {

    // Separate the elements from each tuple
    val (a, b, c) = tuple1
    var (d, e, f) = tuple2

    // Update the second tuple based on specific conditions
    // Condition 1: If the element in tuple1 is even and the corresponding element in tuple2 is odd,
    // replace the element in tuple2 with the double of the element in tuple1.
    if (a % 2 == 0 && d % 2 != 0) {
        d = 2 * a
    }
    if (b % 2 == 0 && e % 2 != 0) {
        e = 2 * b
    }
    if (c % 2 == 0 && f % 2 != 0) {
        f = 2 * c
    }

    // Return the updated tuple
    return Triple(d, e, f)
}
/**
 * This function takes two tuples as input and updates the second tuple based on specific conditions.
 *
 * @param tuple1 The first tuple.
 * @param tuple2 The second tuple.
 * @return The updated tuple after applying the given conditions.
 */
fun updateTuple(tuple1: Triple<Int, Int, Int>, tuple2: Triple<Int, Int, Int>): Triple<Int, Int, Int> {
/**
 * This function takes two tuples as input and updates the second tuple based on specific conditions.
 *
 * @param tuple1 The first tuple.
 * @param tuple2 The second tuple.
 * @return The updated tuple after applying the given conditions.
 */
fun updateTuple(tuple1: Triple<Int, Int, Int>, tuple2: Triple<Int, Int, Int>): Triple<Int, Int, Int> {

    // Separate the elements from each tuple
    val (a, b, c) = tuple1
    var (d, e, f) = tuple2

    // Update the second tuple based on specific conditions
    // Condition 1: If the element in tuple1 is even and the corresponding element in tuple2 is odd,
    // replace the element in tuple2 with the double of the element in tuple1.
    if (a % 2 == 0 && d % 2 != 0) {
        d = 2 * a
    }
    if (b % 2 == 0 && e % 2 != 0) {
        e = 2 * b
    }
    if (c % 2 == 0 && f % 2 != 0) {
        f = 2 * c
    }

    // Return the updated tuple
    return Triple(d, e, f)
}