/**
 * This function calculates the final payment of an actor/actress based on the total box office gross
 * and the total number of sales of a movie.
 *
 * @param totalGross Total box office gross of the movie.
 * @param totalSales Total number of sales of the movie.
 * @return Final payment of the actor/actress for the movie.
 */
fun calculatePayment(totalGross: Double, totalSales: Int): Double {

    return when {
        totalGross < 1000000 && totalSales > 50000 -> totalGross * 0.2
        totalGross < 5000000 -> totalGross * 0.15
        totalGross < 10000000 && totalSales >= 100000 -> totalGross * 0.2
        totalGross >= 10000000 -> totalGross * 0.25
        else -> totalGross * 0.1
    }
}
/**
 * This function calculates the final payment of an actor/actress based on the total box office gross
 * and the total number of sales of a movie.
 *
 * @param totalGross Total box office gross of the movie.
 * @param totalSales Total number of sales of the movie.
 * @return Final payment of the actor/actress for the movie.
 */
fun calculatePayment(totalGross: Double, totalSales: Int): Double {
/**
 * This function calculates the final payment of an actor/actress based on the total box office gross
 * and the total number of sales of a movie.
 *
 * @param totalGross Total box office gross of the movie.
 * @param totalSales Total number of sales of the movie.
 * @return Final payment of the actor/actress for the movie.
 */
fun calculatePayment(totalGross: Double, totalSales: Int): Double {

    return when {
        totalGross < 1000000 && totalSales > 50000 -> totalGross * 0.2
        totalGross < 5000000 -> totalGross * 0.15
        totalGross < 10000000 && totalSales >= 100000 -> totalGross * 0.2
        totalGross >= 10000000 -> totalGross * 0.25
        else -> totalGross * 0.1
    }
}