/**
 * This function takes in a list of distances covered by an athlete during a week of training
 * and a condition, and returns the total distance covered based on the condition.
 *
 * @param distanceList A list of distances covered by the athlete during a week of training.
 * @param condition A condition indicating whether to include or exclude a distance from the total.
 * @return The total distance covered based on the condition provided.
 */
fun calculateTrainingDistance(distanceList: List<Int>, condition: Boolean): Int {

    var totalDistance = 0

    for (distance in distanceList) {
        if (condition) {
            totalDistance *= distance
        } else {
            totalDistance += distance
        }
    }

    return totalDistance
}
/**
 * This function takes in a list of distances covered by an athlete during a week of training
 * and a condition, and returns the total distance covered based on the condition.
 *
 * @param distanceList A list of distances covered by the athlete during a week of training.
 * @param condition A condition indicating whether to include or exclude a distance from the total.
 * @return The total distance covered based on the condition provided.
 */
fun calculateTrainingDistance(distanceList: List<Int>, condition: Boolean): Int {
/**
 * This function takes in a list of distances covered by an athlete during a week of training
 * and a condition, and returns the total distance covered based on the condition.
 *
 * @param distanceList A list of distances covered by the athlete during a week of training.
 * @param condition A condition indicating whether to include or exclude a distance from the total.
 * @return The total distance covered based on the condition provided.
 */
fun calculateTrainingDistance(distanceList: List<Int>, condition: Boolean): Int {

    var totalDistance = 0

    for (distance in distanceList) {
        if (condition) {
            totalDistance *= distance
        } else {
            totalDistance += distance
        }
    }

    return totalDistance
}