/**
 * Given a list of tuples containing architects' names and their ages,
 * modify the ages of the architects which are above 30 to their square root.
 *
 * Example:
 * Input: [('John', 25), ('Emily', 33), ('Oliver', 42)]
 * Output: [('John', 5), ('Emily', 33), ('Oliver', 6)]
 *
 * @param architects List of tuples containing architects' names (str) and ages (int)
 * @return List of tuples with modified ages
 */
fun modifyTuples(architects: List<Pair<String, Int>>): List<Pair<String, Int>> {

    return architects.map { (name, age) ->
        Pair(name, if (age > 30) Math.sqrt(age.toDouble()).toInt() else age)
    }
}
/**
 * Given a list of tuples containing architects' names and their ages,
 * modify the ages of the architects which are above 30 to their square root.
 *
 * Example:
 * Input: [('John', 25), ('Emily', 33), ('Oliver', 42)]
 * Output: [('John', 5), ('Emily', 33), ('Oliver', 6)]
 *
 * @param architects List of tuples containing architects' names (str) and ages (int)
 * @return List of tuples with modified ages
 */
fun modifyTuples(architects: List<Pair<String, Int>>): List<Pair<String, Int>> {
/**
 * Given a list of tuples containing architects' names and their ages,
 * modify the ages of the architects which are above 30 to their square root.
 *
 * Example:
 * Input: [('John', 25), ('Emily', 33), ('Oliver', 42)]
 * Output: [('John', 5), ('Emily', 33), ('Oliver', 6)]
 *
 * @param architects List of tuples containing architects' names (str) and ages (int)
 * @return List of tuples with modified ages
 */
fun modifyTuples(architects: List<Pair<String, Int>>): List<Pair<String, Int>> {

    return architects.map { (name, age) ->
        Pair(name, if (age > 30) Math.sqrt(age.toDouble()).toInt() else age)
    }
}