/**
 * This function calculates the total volume of a geological rock formation by summing up the volumes of individual layers.
 * Each layer's volume is calculated by multiplying its thickness with its area.
 * The thickness is given in meters, and the area is obtained by multiplying the length of the layer by its width.
 *
 * @param layers A list of tuples where each tuple contains the thickness, length and width of a layer.
 * @return The total volume of the rock formation in cubic meters.
 */
fun calculateVolume(layers: List<Triple<Double, Double, Double>>): Double {

    var totalVolume = 0.0

    for (layer in layers) {
        val (thickness, length, width) = layer
        val volume = thickness * length * width
        totalVolume += volume
    }

    return totalVolume
}
/**
 * This function calculates the total volume of a geological rock formation by summing up the volumes of individual layers.
 * Each layer's volume is calculated by multiplying its thickness with its area.
 * The thickness is given in meters, and the area is obtained by multiplying the length of the layer by its width.
 *
 * @param layers A list of tuples where each tuple contains the thickness, length and width of a layer.
 * @return The total volume of the rock formation in cubic meters.
 */
fun calculateVolume(layers: List<Triple<Double, Double, Double>>): Double {
/**
 * This function calculates the total volume of a geological rock formation by summing up the volumes of individual layers.
 * Each layer's volume is calculated by multiplying its thickness with its area.
 * The thickness is given in meters, and the area is obtained by multiplying the length of the layer by its width.
 *
 * @param layers A list of tuples where each tuple contains the thickness, length and width of a layer.
 * @return The total volume of the rock formation in cubic meters.
 */
fun calculateVolume(layers: List<Triple<Double, Double, Double>>): Double {

    var totalVolume = 0.0

    for (layer in layers) {
        val (thickness, length, width) = layer
        val volume = thickness * length * width
        totalVolume += volume
    }

    return totalVolume
}