/**
 * A function that calculates the total cost for each room in a house based on its dimensions.
 * Each room is given a price per square foot, and the function calculates the cost for each room.
 *
 * @param lengths A list of integers representing the lengths of various rooms.
 * @param widths A list of integers representing the widths of various rooms.
 * @return A list of total costs for each room in the house.
 */
fun calculateRoomCosts(lengths: List<Int>, widths: List<Int>): List<Int> {

    val prices = listOf(15, 20, 25, 30)  // Price per square foot for each room type
    val totalCosts = mutableListOf<Int>()

    for (length in lengths) {
        for (width in widths) {
            // Randomly select a room type price per square foot
            val pricePerSqFoot = prices.random()

            // Calculate the area of the room
            val area = length * width

            // Calculate the total cost for the room
            val totalCost = pricePerSqFoot * area

            // Add the total cost to the list
            totalCosts.add(totalCost)
        }
    }

    return totalCosts
}
/**
 * A function that calculates the total cost for each room in a house based on its dimensions.
 * Each room is given a price per square foot, and the function calculates the cost for each room.
 *
 * @param lengths A list of integers representing the lengths of various rooms.
 * @param widths A list of integers representing the widths of various rooms.
 * @return A list of total costs for each room in the house.
 */
fun calculateRoomCosts(lengths: List<Int>, widths: List<Int>): List<Int> {
/**
 * A function that calculates the total cost for each room in a house based on its dimensions.
 * Each room is given a price per square foot, and the function calculates the cost for each room.
 *
 * @param lengths A list of integers representing the lengths of various rooms.
 * @param widths A list of integers representing the widths of various rooms.
 * @return A list of total costs for each room in the house.
 */
fun calculateRoomCosts(lengths: List<Int>, widths: List<Int>): List<Int> {

    val prices = listOf(15, 20, 25, 30)  // Price per square foot for each room type
    val totalCosts = mutableListOf<Int>()

    for (length in lengths) {
        for (width in widths) {
            // Randomly select a room type price per square foot
            val pricePerSqFoot = prices.random()

            // Calculate the area of the room
            val area = length * width

            // Calculate the total cost for the room
            val totalCost = pricePerSqFoot * area

            // Add the total cost to the list
            totalCosts.add(totalCost)
        }
    }

    return totalCosts
}