def get_bytes_used(current_time, process_durations):
    """
    Return bytes used at given time.

    >>> get_bytes_used(12, [2, 3, 4])
    13
    >>> get_bytes_used(14, [2, 3, 4])
    14

    :type current_time: int
    :param current_time: Array index

    :type process_durations: list
    :param process_durations: List containing process durations to exhaust 1 byte.

    :return: bytes_used
    :rtype: int
    """
    bytes_used = 0
    for p_time in process_durations:
        if p_time > current_time:
            # Since the array is sorted we can break early
            # and avoid unnecessary calculations.
            break
        bytes_used += current_time // p_time

    return bytes_used