/**
 * This function takes a list of tuples representing the dimensions of each room in a house and calculates
 * the average area of all the rooms.
 *
 * @param rooms a list of tuples, where each tuple represents the length, width, and height of a room.
 * @return the average area of all the rooms.
 *
 * Example:
 * calculateAverageRoomArea(listOf(Pair(10, 5), Pair(7, 4), Pair(6, 2))) => 28.666666666666668
 */
fun calculateAverageRoomArea(rooms: List<Pair<Int, Int>>): Double {

    var totalArea = 0
    val numRooms = rooms.size
    for (room in rooms) {
        val (roomLength, roomWidth) = room
        val roomArea = roomLength * roomWidth
        totalArea += roomArea
    }
    val averageArea = totalArea.toDouble() / numRooms
    return averageArea
}
/**
 * This function takes a list of tuples representing the dimensions of each room in a house and calculates
 * the average area of all the rooms.
 *
 * @param rooms a list of tuples, where each tuple represents the length, width, and height of a room.
 * @return the average area of all the rooms.
 *
 * Example:
 * calculateAverageRoomArea(listOf(Pair(10, 5), Pair(7, 4), Pair(6, 2))) => 28.666666666666668
 */
fun calculateAverageRoomArea(rooms: List<Pair<Int, Int>>): Double {
/**
 * This function takes a list of tuples representing the dimensions of each room in a house and calculates
 * the average area of all the rooms.
 *
 * @param rooms a list of tuples, where each tuple represents the length, width, and height of a room.
 * @return the average area of all the rooms.
 *
 * Example:
 * calculateAverageRoomArea(listOf(Pair(10, 5), Pair(7, 4), Pair(6, 2))) => 28.666666666666668
 */
fun calculateAverageRoomArea(rooms: List<Pair<Int, Int>>): Double {

    var totalArea = 0
    val numRooms = rooms.size
    for (room in rooms) {
        val (roomLength, roomWidth) = room
        val roomArea = roomLength * roomWidth
        totalArea += roomArea
    }
    val averageArea = totalArea.toDouble() / numRooms
    return averageArea
}