/**
 * A Physical Therapist wants to calculate the average speed (distance divided by time) of their patients.
 * They have a list of distances (in meters) covered by the patients and a list of times (in minutes) taken to cover those distances.
 * The task is to write a function that calculates the average speed for each patient and returns a list of their average speeds.
 * The average speed is calculated by dividing the distance by the time taken to cover that distance.
 */
fun calculateAverageSpeed(distances: List<Double>, times: List<Double>): List<Double?> {

    val averageSpeeds = mutableListOf<Double?>()
    for (i in distances.indices) {
        if (distances[i] < 0 || times[i] <= 0) {
            averageSpeeds.add(null)
        } else {
            averageSpeeds.add(distances[i] / times[i])
        }
    }
    return averageSpeeds
}
/**
 * A Physical Therapist wants to calculate the average speed (distance divided by time) of their patients.
 * They have a list of distances (in meters) covered by the patients and a list of times (in minutes) taken to cover those distances.
 * The task is to write a function that calculates the average speed for each patient and returns a list of their average speeds.
 * The average speed is calculated by dividing the distance by the time taken to cover that distance.
 */
fun calculateAverageSpeed(distances: List<Double>, times: List<Double>): List<Double?> {
/**
 * A Physical Therapist wants to calculate the average speed (distance divided by time) of their patients.
 * They have a list of distances (in meters) covered by the patients and a list of times (in minutes) taken to cover those distances.
 * The task is to write a function that calculates the average speed for each patient and returns a list of their average speeds.
 * The average speed is calculated by dividing the distance by the time taken to cover that distance.
 */
fun calculateAverageSpeed(distances: List<Double>, times: List<Double>): List<Double?> {

    val averageSpeeds = mutableListOf<Double?>()
    for (i in distances.indices) {
        if (distances[i] < 0 || times[i] <= 0) {
            averageSpeeds.add(null)
        } else {
            averageSpeeds.add(distances[i] / times[i])
        }
    }
    return averageSpeeds
}