/**
 * A function that calculates the total cost of items after applying discounts.
 * The function breaks out of the loop if a discount greater than 50% is encountered.
 *
 * @param items A list of item prices
 * @param discounts A list of discount percentages for each item
 * @return The total cost after applying discounts
 */
fun calculateTotalCost(items: List<Double>, discounts: List<Double>): Double {

    var totalCost = 0.0

    for (i in items.indices) {
        // Check if current item's discount is greater than 50%
        if (discounts[i] > 50) {
            break
        }

        val discountedPrice = items[i] * (1 - discounts[i] / 100)
        totalCost += discountedPrice
    }

    return totalCost
}
/**
 * A function that calculates the total cost of items after applying discounts.
 * The function breaks out of the loop if a discount greater than 50% is encountered.
 *
 * @param items A list of item prices
 * @param discounts A list of discount percentages for each item
 * @return The total cost after applying discounts
 */
fun calculateTotalCost(items: List<Double>, discounts: List<Double>): Double {
/**
 * A function that calculates the total cost of items after applying discounts.
 * The function breaks out of the loop if a discount greater than 50% is encountered.
 *
 * @param items A list of item prices
 * @param discounts A list of discount percentages for each item
 * @return The total cost after applying discounts
 */
fun calculateTotalCost(items: List<Double>, discounts: List<Double>): Double {

    var totalCost = 0.0

    for (i in items.indices) {
        // Check if current item's discount is greater than 50%
        if (discounts[i] > 50) {
            break
        }

        val discountedPrice = items[i] * (1 - discounts[i] / 100)
        totalCost += discountedPrice
    }

    return totalCost
}