/**
 * This function calculates the total area of a list of rectangles.
 *
 * @param rectangles a list of pairs representing the length and width of each rectangle.
 * @return The total area of all the rectangles.
 */
fun calculateTotalArea(rectangles: List<Pair<Int, Int>>): Int {

    var totalArea = 0

    // Iterate over each rectangle in the list
    for (rectangle in rectangles) {
        val (length, width) = rectangle

        // Calculate and add the area of the current rectangle to the total area
        totalArea += (length * width)
    }

    return totalArea
}
/**
 * This function calculates the total area of a list of rectangles.
 *
 * @param rectangles a list of pairs representing the length and width of each rectangle.
 * @return The total area of all the rectangles.
 */
fun calculateTotalArea(rectangles: List<Pair<Int, Int>>): Int {
/**
 * This function calculates the total area of a list of rectangles.
 *
 * @param rectangles a list of pairs representing the length and width of each rectangle.
 * @return The total area of all the rectangles.
 */
fun calculateTotalArea(rectangles: List<Pair<Int, Int>>): Int {

    var totalArea = 0

    // Iterate over each rectangle in the list
    for (rectangle in rectangles) {
        val (length, width) = rectangle

        // Calculate and add the area of the current rectangle to the total area
        totalArea += (length * width)
    }

    return totalArea
}