/**
 * This function checks the eligibility and status of an athlete based on their age, number of medals won,
 * and country of origin.
 *
 * @param age The age of the athlete.
 * @param medals The number of medals won by the athlete.
 * @param country The country of origin of the athlete.
 * @return The eligibility and status of the athlete.
 */
fun checkAthleteStatus(age: Int, medals: Int, country: String): String {

    return when {
        age >= 18 -> {
            when {
                medals > 10 -> {
                    when (country) {
                        "USA" -> "Eligible - Top athlete from USA"
                        "CAN" -> "Eligible - Top athlete from Canada"
                        "GBR" -> "Eligible - Top athlete from Great Britain"
                        else -> "Eligible - Distinguished athlete from another country"
                    }
                }
                else -> "Eligible - Talented athlete with potential"
            }
        }
        age >= 15 -> {
            when {
                medals >= 5 -> {
                    when (country) {
                        "USA" -> "Eligible - Rising star from USA"
                        "CAN" -> "Eligible - Rising star from Canada"
                        "GBR" -> "Eligible - Rising star from Great Britain"
                        else -> "Eligible - Promising athlete from another country"
                    }
                }
                else -> "Eligible - Young athlete with potential"
            }
        }
        else -> "Not eligible - Athlete must be at least 15 years old"
    }
}
/**
 * This function checks the eligibility and status of an athlete based on their age, number of medals won,
 * and country of origin.
 *
 * @param age The age of the athlete.
 * @param medals The number of medals won by the athlete.
 * @param country The country of origin of the athlete.
 * @return The eligibility and status of the athlete.
 */
fun checkAthleteStatus(age: Int, medals: Int, country: String): String {
/**
 * This function checks the eligibility and status of an athlete based on their age, number of medals won,
 * and country of origin.
 *
 * @param age The age of the athlete.
 * @param medals The number of medals won by the athlete.
 * @param country The country of origin of the athlete.
 * @return The eligibility and status of the athlete.
 */
fun checkAthleteStatus(age: Int, medals: Int, country: String): String {

    return when {
        age >= 18 -> {
            when {
                medals > 10 -> {
                    when (country) {
                        "USA" -> "Eligible - Top athlete from USA"
                        "CAN" -> "Eligible - Top athlete from Canada"
                        "GBR" -> "Eligible - Top athlete from Great Britain"
                        else -> "Eligible - Distinguished athlete from another country"
                    }
                }
                else -> "Eligible - Talented athlete with potential"
            }
        }
        age >= 15 -> {
            when {
                medals >= 5 -> {
                    when (country) {
                        "USA" -> "Eligible - Rising star from USA"
                        "CAN" -> "Eligible - Rising star from Canada"
                        "GBR" -> "Eligible - Rising star from Great Britain"
                        else -> "Eligible - Promising athlete from another country"
                    }
                }
                else -> "Eligible - Young athlete with potential"
            }
        }
        else -> "Not eligible - Athlete must be at least 15 years old"
    }
}