/**
 * This function calculates the total salary earned by a group of economists.
 */
fun calculateTotalSalary(economists: List<Map<String, Int>>): Int {

    var totalSalary = 0

    // Iterate through each economist
    for (economist in economists) {

        // Calculate the salary for each economist based on their level of experience
        val baseSalary = when {
            economist["experience"]!! < 5 -> 50000
            economist["experience"]!! < 10 -> 75000
            else -> 100000
        }

        // Add the bonus based on the number of publications
        val bonus = when {
            economist["publications"]!! < 5 -> 0
            economist["publications"]!! < 10 -> 1000
            else -> 5000
        }

        // Calculate the total salary for the economist
        totalSalary += baseSalary + bonus
    }

    return totalSalary
}
/**
 * This function calculates the total salary earned by a group of economists.
 */
fun calculateTotalSalary(economists: List<Map<String, Int>>): Int {
/**
 * This function calculates the total salary earned by a group of economists.
 */
fun calculateTotalSalary(economists: List<Map<String, Int>>): Int {

    var totalSalary = 0

    // Iterate through each economist
    for (economist in economists) {

        // Calculate the salary for each economist based on their level of experience
        val baseSalary = when {
            economist["experience"]!! < 5 -> 50000
            economist["experience"]!! < 10 -> 75000
            else -> 100000
        }

        // Add the bonus based on the number of publications
        val bonus = when {
            economist["publications"]!! < 5 -> 0
            economist["publications"]!! < 10 -> 1000
            else -> 5000
        }

        // Calculate the total salary for the economist
        totalSalary += baseSalary + bonus
    }

    return totalSalary
}