/**
 * Calculate the cost of materials for a room in a house.
 *
 * @param length The length of the room in feet.
 * @param width The width of the room in feet.
 * @param height The height of the room in feet.
 * @return The cost of materials for the room, or null if dimensions are negative.
 * @throws IllegalArgumentException If any dimension is negative.
 */
fun calculateCost(length: Int, width: Int, height: Int): Int? {

    if (length < 0 || width < 0 || height < 0) {
        throw IllegalArgumentException("Dimensions cannot be negative.")
    }

    // Calculate the total area of all walls
    val totalArea = 2 * (length + width) * height

    // Calculate the cost of materials based on the total area
    val costPerSquareFoot = 10  // Assume $10 per square foot
    val cost = totalArea * costPerSquareFoot

    return cost
}
/**
 * Calculate the cost of materials for a room in a house.
 *
 * @param length The length of the room in feet.
 * @param width The width of the room in feet.
 * @param height The height of the room in feet.
 * @return The cost of materials for the room, or null if dimensions are negative.
 * @throws IllegalArgumentException If any dimension is negative.
 */
fun calculateCost(length: Int, width: Int, height: Int): Int? {
/**
 * Calculate the cost of materials for a room in a house.
 *
 * @param length The length of the room in feet.
 * @param width The width of the room in feet.
 * @param height The height of the room in feet.
 * @return The cost of materials for the room, or null if dimensions are negative.
 * @throws IllegalArgumentException If any dimension is negative.
 */
fun calculateCost(length: Int, width: Int, height: Int): Int? {

    if (length < 0 || width < 0 || height < 0) {
        throw IllegalArgumentException("Dimensions cannot be negative.")
    }

    // Calculate the total area of all walls
    val totalArea = 2 * (length + width) * height

    // Calculate the cost of materials based on the total area
    val costPerSquareFoot = 10  // Assume $10 per square foot
    val cost = totalArea * costPerSquareFoot

    return cost
}