/**
 * Calculates the final score of an athlete based on the number of gold, silver, and bronze medals won.
 * The score is determined as follows:
 * - Each gold medal adds 10 points.
 * - Each silver medal adds 5 points.
 * - Each bronze medal adds 2 points.
 * - If the athlete has won more than 3 gold medals, deduct 5 points from the total score.
 * - If the athlete has won more than 5 silver medals, deduct 2 points from the total score.
 * - If the athlete has won more than 10 bronze medals, deduct 1 point from the total score.
 *
 * @param gold The number of gold medals won.
 * @param silver The number of silver medals won.
 * @param bronze The number of bronze medals won.
 * @return The final score of the athlete.
 */
fun calculateFinalScore(gold: Int, silver: Int, bronze: Int): Int {

    var score = gold * 10 + silver * 5 + bronze * 2

    return if (gold > 3) {
        score - 5
    } else if (silver > 5) {
        score - 2
    } else if (bronze > 10) {
        score - 1
    } else {
        score
    }
}
/**
 * Calculates the final score of an athlete based on the number of gold, silver, and bronze medals won.
 * The score is determined as follows:
 * - Each gold medal adds 10 points.
 * - Each silver medal adds 5 points.
 * - Each bronze medal adds 2 points.
 * - If the athlete has won more than 3 gold medals, deduct 5 points from the total score.
 * - If the athlete has won more than 5 silver medals, deduct 2 points from the total score.
 * - If the athlete has won more than 10 bronze medals, deduct 1 point from the total score.
 *
 * @param gold The number of gold medals won.
 * @param silver The number of silver medals won.
 * @param bronze The number of bronze medals won.
 * @return The final score of the athlete.
 */
fun calculateFinalScore(gold: Int, silver: Int, bronze: Int): Int {
/**
 * Calculates the final score of an athlete based on the number of gold, silver, and bronze medals won.
 * The score is determined as follows:
 * - Each gold medal adds 10 points.
 * - Each silver medal adds 5 points.
 * - Each bronze medal adds 2 points.
 * - If the athlete has won more than 3 gold medals, deduct 5 points from the total score.
 * - If the athlete has won more than 5 silver medals, deduct 2 points from the total score.
 * - If the athlete has won more than 10 bronze medals, deduct 1 point from the total score.
 *
 * @param gold The number of gold medals won.
 * @param silver The number of silver medals won.
 * @param bronze The number of bronze medals won.
 * @return The final score of the athlete.
 */
fun calculateFinalScore(gold: Int, silver: Int, bronze: Int): Int {

    var score = gold * 10 + silver * 5 + bronze * 2

    return if (gold > 3) {
        score - 5
    } else if (silver > 5) {
        score - 2
    } else if (bronze > 10) {
        score - 1
    } else {
        score
    }
}