/**
 * A firefighter is assigned to extinguish a fire using a water hose.
 * The hose has a limited capacity and can spray water for a certain number of seconds.
 *
 * Complete the code below to determine if the firefighter will be able to completely
 * extinguish the fire within the given time limit.
 *
 * @param fire The intensity of the fire, measured in arbitrary units.
 * @param n The number of seconds the water hose can spray without refilling.
 * @return True if the firefighter can completely extinguish the fire within the time limit, False otherwise.
 */
fun extinguishFire(fire: Int, n: Int): Boolean {

    var waterCapacity = 100  // Arbitrary water capacity of the hose
    var timeRemaining = n  // Initialize the time remaining

    repeat(fire) {
        timeRemaining--

        if (timeRemaining <= 0) {
            return false
        }

        if (fire > waterCapacity) {
            waterCapacity--
        } else {
            waterCapacity -= fire
        }

        if (waterCapacity <= 0) {
            return false
        }
    }

    return true
}
/**
 * A firefighter is assigned to extinguish a fire using a water hose.
 * The hose has a limited capacity and can spray water for a certain number of seconds.
 *
 * Complete the code below to determine if the firefighter will be able to completely
 * extinguish the fire within the given time limit.
 *
 * @param fire The intensity of the fire, measured in arbitrary units.
 * @param n The number of seconds the water hose can spray without refilling.
 * @return True if the firefighter can completely extinguish the fire within the time limit, False otherwise.
 */
fun extinguishFire(fire: Int, n: Int): Boolean {
/**
 * A firefighter is assigned to extinguish a fire using a water hose.
 * The hose has a limited capacity and can spray water for a certain number of seconds.
 *
 * Complete the code below to determine if the firefighter will be able to completely
 * extinguish the fire within the given time limit.
 *
 * @param fire The intensity of the fire, measured in arbitrary units.
 * @param n The number of seconds the water hose can spray without refilling.
 * @return True if the firefighter can completely extinguish the fire within the time limit, False otherwise.
 */
fun extinguishFire(fire: Int, n: Int): Boolean {

    var waterCapacity = 100  // Arbitrary water capacity of the hose
    var timeRemaining = n  // Initialize the time remaining

    repeat(fire) {
        timeRemaining--

        if (timeRemaining <= 0) {
            return false
        }

        if (fire > waterCapacity) {
            waterCapacity--
        } else {
            waterCapacity -= fire
        }

        if (waterCapacity <= 0) {
            return false
        }
    }

    return true
}