/**
 * The purpose of this exercise is to find the average speed of an athlete.
 * The athlete has run different distances at different times,
 * and you need to calculate their average speed by iterating over the distances and times provided.
 * The distances and times will always have the same length.
 */
fun averageSpeed(distances: List<Double>, times: List<Double>): Double {

    var totalDistance = 0.0
    var totalTime = 0.0

    for (i in distances.indices) {
        totalDistance += distances[i]
        totalTime += times[i]
    }

    val averageSpeed = totalDistance / totalTime

    return averageSpeed
}
/**
 * The purpose of this exercise is to find the average speed of an athlete.
 * The athlete has run different distances at different times,
 * and you need to calculate their average speed by iterating over the distances and times provided.
 * The distances and times will always have the same length.
 */
fun averageSpeed(distances: List<Double>, times: List<Double>): Double {
/**
 * The purpose of this exercise is to find the average speed of an athlete.
 * The athlete has run different distances at different times,
 * and you need to calculate their average speed by iterating over the distances and times provided.
 * The distances and times will always have the same length.
 */
fun averageSpeed(distances: List<Double>, times: List<Double>): Double {

    var totalDistance = 0.0
    var totalTime = 0.0

    for (i in distances.indices) {
        totalDistance += distances[i]
        totalTime += times[i]
    }

    val averageSpeed = totalDistance / totalTime

    return averageSpeed
}