/**
 * This function takes the total number of blocks and the base area as input and calculates the total volume of the stack of blocks.
 *
 * @param totalBlocks The total number of blocks in the stack.
 * @param baseArea The area of the base of each block.
 * @return The total volume of the stack of blocks.
 */
fun calculateVolume(totalBlocks: Int, baseArea: Double): Double {

    var totalVolume = 0.0

    // Iterate over the range from 1 to the total number of blocks + 1
    for (i in 1..totalBlocks) {
        // Calculate the volume of the current block
        var currentVolume = baseArea * i

        // Round the currentVolume to the nearest integer
        currentVolume = currentVolume.toInt().toDouble()

        // Increment the total volume by the current volume
        totalVolume += currentVolume
    }

    return totalVolume
}
/**
 * This function takes the total number of blocks and the base area as input and calculates the total volume of the stack of blocks.
 *
 * @param totalBlocks The total number of blocks in the stack.
 * @param baseArea The area of the base of each block.
 * @return The total volume of the stack of blocks.
 */
fun calculateVolume(totalBlocks: Int, baseArea: Double): Double {
/**
 * This function takes the total number of blocks and the base area as input and calculates the total volume of the stack of blocks.
 *
 * @param totalBlocks The total number of blocks in the stack.
 * @param baseArea The area of the base of each block.
 * @return The total volume of the stack of blocks.
 */
fun calculateVolume(totalBlocks: Int, baseArea: Double): Double {

    var totalVolume = 0.0

    // Iterate over the range from 1 to the total number of blocks + 1
    for (i in 1..totalBlocks) {
        // Calculate the volume of the current block
        var currentVolume = baseArea * i

        // Round the currentVolume to the nearest integer
        currentVolume = currentVolume.toInt().toDouble()

        // Increment the total volume by the current volume
        totalVolume += currentVolume
    }

    return totalVolume
}