/**
 * A function to calculate the total cost for an interior designer given the number of rooms and the prices of the furniture.
 *
 * @param roomCount An integer representing the number of rooms.
 * @param prices A list of floating point numbers representing the prices of the furniture for each room.
 * @return The total cost of all the furniture.
 *
 * Example:
 * calculateTotalCost(3, listOf(1500.0, 2000.0, 3000.0))
 * Output: 6500.0
 */
fun calculateTotalCost(roomCount: Int, prices: List<Double>): Double {

    val totalCost = prices.take(roomCount).mapIndexed { index, price ->
        if (index % 2 == 0) price else price * 0.8
    }.sum()

    return totalCost
}
/**
 * A function to calculate the total cost for an interior designer given the number of rooms and the prices of the furniture.
 *
 * @param roomCount An integer representing the number of rooms.
 * @param prices A list of floating point numbers representing the prices of the furniture for each room.
 * @return The total cost of all the furniture.
 *
 * Example:
 * calculateTotalCost(3, listOf(1500.0, 2000.0, 3000.0))
 * Output: 6500.0
 */
fun calculateTotalCost(roomCount: Int, prices: List<Double>): Double {
/**
 * A function to calculate the total cost for an interior designer given the number of rooms and the prices of the furniture.
 *
 * @param roomCount An integer representing the number of rooms.
 * @param prices A list of floating point numbers representing the prices of the furniture for each room.
 * @return The total cost of all the furniture.
 *
 * Example:
 * calculateTotalCost(3, listOf(1500.0, 2000.0, 3000.0))
 * Output: 6500.0
 */
fun calculateTotalCost(roomCount: Int, prices: List<Double>): Double {

    val totalCost = prices.take(roomCount).mapIndexed { index, price ->
        if (index % 2 == 0) price else price * 0.8
    }.sum()

    return totalCost
}