/**
 * A function that calculates the maximum number of circuits
 * needed to accommodate a given set of rooms based on their power consumption.
 *
 * @param rooms A set of rooms.
 * @param circuitCapacity The maximum power capacity of each circuit.
 * @return The maximum number of circuits needed.
 */
fun calculateTotalCircuits(rooms: Set<Int>, circuitCapacity: Int): Int {

    val totalPowerConsumption = rooms.sum()  // Total power consumption of all rooms
    var circuitsNeeded = 0  // Counter for the number of circuits needed

    if (totalPowerConsumption % circuitCapacity == 0) {
        circuitsNeeded = totalPowerConsumption / circuitCapacity
    } else {
        circuitsNeeded = totalPowerConsumption / circuitCapacity + 1
    }

    return circuitsNeeded
}
/**
 * A function that calculates the maximum number of circuits
 * needed to accommodate a given set of rooms based on their power consumption.
 *
 * @param rooms A set of rooms.
 * @param circuitCapacity The maximum power capacity of each circuit.
 * @return The maximum number of circuits needed.
 */
fun calculateTotalCircuits(rooms: Set<Int>, circuitCapacity: Int): Int {
/**
 * A function that calculates the maximum number of circuits
 * needed to accommodate a given set of rooms based on their power consumption.
 *
 * @param rooms A set of rooms.
 * @param circuitCapacity The maximum power capacity of each circuit.
 * @return The maximum number of circuits needed.
 */
fun calculateTotalCircuits(rooms: Set<Int>, circuitCapacity: Int): Int {

    val totalPowerConsumption = rooms.sum()  // Total power consumption of all rooms
    var circuitsNeeded = 0  // Counter for the number of circuits needed

    if (totalPowerConsumption % circuitCapacity == 0) {
        circuitsNeeded = totalPowerConsumption / circuitCapacity
    } else {
        circuitsNeeded = totalPowerConsumption / circuitCapacity + 1
    }

    return circuitsNeeded
}