from typing import Sequence


def binary_search(sequence: Sequence[int], target: int) -> int:
    """
    Performs as binary search on an ordered sequence of ints to
    find the index of the first value greater than or equal to
    the target value.

    :param sequence:    The order sequence of ints.
    :param target:      The target value to find.
    :return:            The index of the found element.
    """
    start = 0
    end = len(sequence)
    while end != start:
        pivot = (start + end) // 2
        if sequence[pivot] >= target:
            end = pivot
        else:
            start = pivot + 1

    return start