/**
 * This function takes two lists of integers, multiplies the corresponding elements together,
 * and exits the while loop until it finds a pair of elements that results in a product greater than 1000.
 * It returns the product and the index of the pair.
 *
 * @param list1 A list of integers.
 * @param list2 A list of integers.
 * @return A Pair containing the product and the index of the pair.
 */
fun exitLoopAndMultiply(list1: List<Int>, list2: List<Int>): Pair<Int, Int> {

    var i = 0
    var product = 0

    while (i < list1.size) {
        product = list1[i] * list2[i]

        if (product > 1000) {
            break
        }

        i++
    }

    return Pair(product, i)
}

// Example usage
/**
 * This function takes two lists of integers, multiplies the corresponding elements together,
 * and exits the while loop until it finds a pair of elements that results in a product greater than 1000.
 * It returns the product and the index of the pair.
 *
 * @param list1 A list of integers.
 * @param list2 A list of integers.
 * @return A Pair containing the product and the index of the pair.
 */
fun exitLoopAndMultiply(list1: List<Int>, list2: List<Int>): Pair<Int, Int> {
/**
 * This function takes two lists of integers, multiplies the corresponding elements together,
 * and exits the while loop until it finds a pair of elements that results in a product greater than 1000.
 * It returns the product and the index of the pair.
 *
 * @param list1 A list of integers.
 * @param list2 A list of integers.
 * @return A Pair containing the product and the index of the pair.
 */
fun exitLoopAndMultiply(list1: List<Int>, list2: List<Int>): Pair<Int, Int> {

    var i = 0
    var product = 0

    while (i < list1.size) {
        product = list1[i] * list2[i]

        if (product > 1000) {
            break
        }

        i++
    }

    return Pair(product, i)
}

// Example usage