/**
 * This function takes the number of victims and whether they are trapped in a building as inputs.
 * It calculates the rescue operation requirements based on these inputs and returns the result as a string.
 */
fun firefighterRescueOperation(numberOfVictims: Int, trappedInBuilding: Boolean): String {

    var totalFirefightersRequired = 0

    when {
        numberOfVictims == 0 && !trappedInBuilding -> totalFirefightersRequired = 0
        numberOfVictims == 0 && trappedInBuilding -> totalFirefightersRequired = 5
        numberOfVictims > 0 && !trappedInBuilding -> totalFirefightersRequired = 1
        else -> totalFirefightersRequired = 3
    }

    return when (totalFirefightersRequired) {
        0 -> "There are no victims and no rescue operation is required."
        1 -> "There are victims but they are not trapped in a building. Only one firefighter is required."
        3 -> "There are victims trapped in a building. Three firefighters are required."
        else -> "There are no victims but a rescue operation is required."
    }
}
/**
 * This function takes the number of victims and whether they are trapped in a building as inputs.
 * It calculates the rescue operation requirements based on these inputs and returns the result as a string.
 */
fun firefighterRescueOperation(numberOfVictims: Int, trappedInBuilding: Boolean): String {
/**
 * This function takes the number of victims and whether they are trapped in a building as inputs.
 * It calculates the rescue operation requirements based on these inputs and returns the result as a string.
 */
fun firefighterRescueOperation(numberOfVictims: Int, trappedInBuilding: Boolean): String {

    var totalFirefightersRequired = 0

    when {
        numberOfVictims == 0 && !trappedInBuilding -> totalFirefightersRequired = 0
        numberOfVictims == 0 && trappedInBuilding -> totalFirefightersRequired = 5
        numberOfVictims > 0 && !trappedInBuilding -> totalFirefightersRequired = 1
        else -> totalFirefightersRequired = 3
    }

    return when (totalFirefightersRequired) {
        0 -> "There are no victims and no rescue operation is required."
        1 -> "There are victims but they are not trapped in a building. Only one firefighter is required."
        3 -> "There are victims trapped in a building. Three firefighters are required."
        else -> "There are no victims but a rescue operation is required."
    }
}