/**
 * The thickness of different geological layers needs to be calculated based on the given depths and velocities.
 * Calculate the thickness of each layer by dividing the difference in depth by the average velocity of that layer.
 *
 * @param depths A list of measured depths (in meters) of each layer from the surface, in ascending order.
 * @param velocities A list of average velocities (in meters per second) of each layer, corresponding to the depths.
 * @return A list of calculated thicknesses (in meters) for each layer.
 *
 * Note:
 * - The lengths of the 'depths" and 'velocities" lists will always be the same.
 * - Layers are assumed to be continuous and their depths are measured relative to the surface.
 */
fun calculateThickness(depths: List<Double>, velocities: List<Double>): List<Double> {

    val thicknesses = mutableListOf<Double>()

    for (i in 0 until depths.size - 1) {
        val thickness = (depths[i + 1] - depths[i]) / velocities[i]  // Calculate thickness using the formula
        thicknesses.add(thickness)
    }

    return thicknesses
}
/**
 * The thickness of different geological layers needs to be calculated based on the given depths and velocities.
 * Calculate the thickness of each layer by dividing the difference in depth by the average velocity of that layer.
 *
 * @param depths A list of measured depths (in meters) of each layer from the surface, in ascending order.
 * @param velocities A list of average velocities (in meters per second) of each layer, corresponding to the depths.
 * @return A list of calculated thicknesses (in meters) for each layer.
 *
 * Note:
 * - The lengths of the 'depths" and 'velocities" lists will always be the same.
 * - Layers are assumed to be continuous and their depths are measured relative to the surface.
 */
fun calculateThickness(depths: List<Double>, velocities: List<Double>): List<Double> {
/**
 * The thickness of different geological layers needs to be calculated based on the given depths and velocities.
 * Calculate the thickness of each layer by dividing the difference in depth by the average velocity of that layer.
 *
 * @param depths A list of measured depths (in meters) of each layer from the surface, in ascending order.
 * @param velocities A list of average velocities (in meters per second) of each layer, corresponding to the depths.
 * @return A list of calculated thicknesses (in meters) for each layer.
 *
 * Note:
 * - The lengths of the 'depths" and 'velocities" lists will always be the same.
 * - Layers are assumed to be continuous and their depths are measured relative to the surface.
 */
fun calculateThickness(depths: List<Double>, velocities: List<Double>): List<Double> {

    val thicknesses = mutableListOf<Double>()

    for (i in 0 until depths.size - 1) {
        val thickness = (depths[i + 1] - depths[i]) / velocities[i]  // Calculate thickness using the formula
        thicknesses.add(thickness)
    }

    return thicknesses
}