/**
 * This function returns the index of the first element in the given list of numbers that is greater than the
 * provided threshold.
 *
 * @param numbers A list of integers.
 * @param threshold An integer representing the threshold value.
 * @return The index of the first element greater than the threshold, -1 if no element is greater.
 */
fun findIndexGreaterThan(numbers: List<Int>, threshold: Int): Int {

    var start = 0
    var end = numbers.size - 1

    while (start <= end) {
        val mid = (start + end) / 2

        if (numbers[mid] > threshold) {
            if (mid == 0 || numbers[mid - 1] <= threshold) {
                return mid
            }
            end = mid - 1
        } else {
            start = mid + 1
        }
    }

    return -1
}

// The journalist will provide a list of numbers and a threshold
val numbersList: List<Int> = TODO()
val threshold: Int = TODO()
val resultIndex = findIndexGreaterThan(numbersList, threshold)
/**
 * This function returns the index of the first element in the given list of numbers that is greater than the
 * provided threshold.
 *
 * @param numbers A list of integers.
 * @param threshold An integer representing the threshold value.
 * @return The index of the first element greater than the threshold, -1 if no element is greater.
 */
fun findIndexGreaterThan(numbers: List<Int>, threshold: Int): Int {
/**
 * This function returns the index of the first element in the given list of numbers that is greater than the
 * provided threshold.
 *
 * @param numbers A list of integers.
 * @param threshold An integer representing the threshold value.
 * @return The index of the first element greater than the threshold, -1 if no element is greater.
 */
fun findIndexGreaterThan(numbers: List<Int>, threshold: Int): Int {

    var start = 0
    var end = numbers.size - 1

    while (start <= end) {
        val mid = (start + end) / 2

        if (numbers[mid] > threshold) {
            if (mid == 0 || numbers[mid - 1] <= threshold) {
                return mid
            }
            end = mid - 1
        } else {
            start = mid + 1
        }
    }

    return -1
}

// The journalist will provide a list of numbers and a threshold
val numbersList: List<Int> = TODO()
val threshold: Int = TODO()
val resultIndex = findIndexGreaterThan(numbersList, threshold)