/**
 * Calculate the percentage of employed and educated economists in a given population.
 *
 * @param population The total population.
 * @param employed The number of economists who are employed.
 * @param educated The number of economists who are educated.
 * @param economist The total number of economists.
 * @return The percentage of employed and educated economists in the population.
 */
fun calculatePercentage(population: Int, employed: Int, educated: Int, economist: Int): String {

    if (population in 1 until 10_000_000) {
        if (economist in 1 until population) {
            if (educated in 1 until economist) {
                if (employed in 1 until educated) {
                    val employedPercentage = (employed.toDouble() / population) * 100
                    val educatedPercentage = (educated.toDouble() / population) * 100
                    return "The percentage of employed economists is %.2f%% and the percentage of educated economists is %.2f%%.".format(employedPercentage, educatedPercentage)
                } else {
                    return "Invalid input: The number of employed economists should be greater than the number of economists who are educated."
                }
            } else {
                return "Invalid input: The number of economists who are educated should be greater than 0 and less than the total number of economists."
            }
        } else {
            return "Invalid input: The total number of economists should be greater than 1 and less than the population."
        }
    } else {
        return "Invalid input: The population should be between 1 and 10,000,000."
    }
}
/**
 * Calculate the percentage of employed and educated economists in a given population.
 *
 * @param population The total population.
 * @param employed The number of economists who are employed.
 * @param educated The number of economists who are educated.
 * @param economist The total number of economists.
 * @return The percentage of employed and educated economists in the population.
 */
fun calculatePercentage(population: Int, employed: Int, educated: Int, economist: Int): String {
/**
 * Calculate the percentage of employed and educated economists in a given population.
 *
 * @param population The total population.
 * @param employed The number of economists who are employed.
 * @param educated The number of economists who are educated.
 * @param economist The total number of economists.
 * @return The percentage of employed and educated economists in the population.
 */
fun calculatePercentage(population: Int, employed: Int, educated: Int, economist: Int): String {

    if (population in 1 until 10_000_000) {
        if (economist in 1 until population) {
            if (educated in 1 until economist) {
                if (employed in 1 until educated) {
                    val employedPercentage = (employed.toDouble() / population) * 100
                    val educatedPercentage = (educated.toDouble() / population) * 100
                    return "The percentage of employed economists is %.2f%% and the percentage of educated economists is %.2f%%.".format(employedPercentage, educatedPercentage)
                } else {
                    return "Invalid input: The number of employed economists should be greater than the number of economists who are educated."
                }
            } else {
                return "Invalid input: The number of economists who are educated should be greater than 0 and less than the total number of economists."
            }
        } else {
            return "Invalid input: The total number of economists should be greater than 1 and less than the population."
        }
    } else {
        return "Invalid input: The population should be between 1 and 10,000,000."
    }
}