




'''simple docstring'''


from __future__ import annotations

import bisect
def 						snake_case_       (UpperCamelCase			:    list[int]					,		UpperCamelCase			:    int					,		UpperCamelCase			:    int = 0					,		UpperCamelCase			:    int = -1 ):





							'''simple docstring'''


							if hi < 0:
														_a      	=							len(UpperCamelCase )

							while lo < hi:
														_a      	=							lo + (hi - lo) // 2
														if sorted_collection[mid] < item:
																					_a      	=							mid + 1
														else:
																					_a      	=							mid

							return lo
def 						snake_case_       (UpperCamelCase			:    list[int]					,		UpperCamelCase			:    int					,		UpperCamelCase			:    int = 0					,		UpperCamelCase			:    int = -1 ):





							'''simple docstring'''


							if hi < 0:
														_a      	=							len(UpperCamelCase )

							while lo < hi:
														_a      	=							lo + (hi - lo) // 2
														if sorted_collection[mid] <= item:
																					_a      	=							mid + 1
														else:
																					_a      	=							mid

							return lo
def 						snake_case_       (UpperCamelCase			:    list[int]					,		UpperCamelCase			:    int					,		UpperCamelCase			:    int = 0					,		UpperCamelCase			:    int = -1 ):





							'''simple docstring'''


							sorted_collection.insert(bisect_left(UpperCamelCase					,		UpperCamelCase					,		UpperCamelCase					,		UpperCamelCase )					,		UpperCamelCase )
def 						snake_case_       (UpperCamelCase			:    list[int]					,		UpperCamelCase			:    int					,		UpperCamelCase			:    int = 0					,		UpperCamelCase			:    int = -1 ):





							'''simple docstring'''


							sorted_collection.insert(bisect_right(UpperCamelCase					,		UpperCamelCase					,		UpperCamelCase					,		UpperCamelCase )					,		UpperCamelCase )
def 						snake_case_       (UpperCamelCase			:    list[int]					,		UpperCamelCase			:    int ):





							'''simple docstring'''


							_a      	=							0
							_a      	=							len(UpperCamelCase ) - 1

							while left <= right:
														_a      	=							left + (right - left) // 2
														_a      	=							sorted_collection[midpoint]
														if current_item == item:
																					return midpoint
														elif item < current_item:
																					_a      	=							midpoint - 1
														else:
																					_a      	=							midpoint + 1
							return None
def 						snake_case_       (UpperCamelCase			:    list[int]					,		UpperCamelCase			:    int ):





							'''simple docstring'''


							_a      	=							bisect.bisect_left(UpperCamelCase					,		UpperCamelCase )
							if index != len(UpperCamelCase ) and sorted_collection[index] == item:
														return index
							return None
def 						snake_case_       (UpperCamelCase			:    list[int]					,		UpperCamelCase			:    int					,		UpperCamelCase			:    int					,		UpperCamelCase			:    int ):





							'''simple docstring'''


							if right < left:
														return None

							_a      	=							left + (right - left) // 2

							if sorted_collection[midpoint] == item:
														return midpoint
							elif sorted_collection[midpoint] > item:
														return binary_search_by_recursion(UpperCamelCase					,		UpperCamelCase					,		UpperCamelCase					,		midpoint - 1 )
							else:
														return binary_search_by_recursion(UpperCamelCase					,		UpperCamelCase					,		midpoint + 1					,		UpperCamelCase )


if __name__ == "__main__":
				_snake_case : Union[str, Any]  				=						input('Enter numbers separated by comma:\n').strip()
				_snake_case : Union[str, Any]  				=						sorted(int(item) for item in user_input.split(','))
				_snake_case : Union[str, Any]  				=						int(input('Enter a single number to be found in the list:\n'))
				_snake_case : Union[str, Any]  				=						binary_search(collection, target)
				if result is None:
								print(F'''{target} was not found in {collection}.''')
				else:
								print(F'''{target} was found at position {result} in {collection}.''')







'''simple docstring'''


from __future__ import annotations

from collections import deque
from collections.abc import Iterator
from dataclasses import dataclass

@dataclass
class      A       :
							lowercase_							     =							42
							lowercase_							     =							42



class      A       :







							def __init__(    self			:    Optional[Any]				,     lowerCAmelCase_			:    int   )     ->				str:


														"""simple docstring"""


														_a      	=							[[] for _ in range(lowerCAmelCase_   )]
														_a      	=							size







							def __getitem__(    self			:    Any				,     lowerCAmelCase_			:    int   )     ->				Iterator[Edge]:


														"""simple docstring"""


														return iter(self._graph[vertex]   )







							@property
							def   __lowerCAmelCase     (    self			:    str   )     ->				Tuple:


														"""simple docstring"""


														return self._size







							def   __lowerCAmelCase     (    self			:    Union[str, Any]				,     lowerCAmelCase_			:    int				,     lowerCAmelCase_			:    int				,     lowerCAmelCase_			:    int   )     ->				Dict:


														"""simple docstring"""


														if weight not in (0, 1):
																					raise ValueError('''Edge weight must be either 0 or 1.'''   )

														if to_vertex < 0 or to_vertex >= self.size:
																					raise ValueError('''Vertex indexes must be in [0; size).'''   )

														self._graph[from_vertex].append(Edge(lowerCAmelCase_				,     lowerCAmelCase_   )   )







							def   __lowerCAmelCase     (    self			:    Tuple				,     lowerCAmelCase_			:    int				,     lowerCAmelCase_			:    int   )     ->				int | None:


														"""simple docstring"""


														_a      	=							deque([start_vertex]   )
														_a      	=							[None] * self.size
														_a      	=							0

														while queue:
																					_a      	=							queue.popleft()
																					_a      	=							distances[current_vertex]
																					if current_distance is None:
																												continue

																					for edge in self[current_vertex]:
																												_a      	=							current_distance + edge.weight
																												_a      	=							distances[edge.destination_vertex]
																												if (
																												    isinstance(lowerCAmelCase_				,     lowerCAmelCase_   )
																												    and new_distance >= dest_vertex_distance
																												):
																																			continue
																												_a      	=							new_distance
																												if edge.weight == 0:
																																			queue.appendleft(edge.destination_vertex   )
																												else:
																																			queue.append(edge.destination_vertex   )

														if distances[finish_vertex] is None:
																					raise ValueError('''No path from start_vertex to finish_vertex.'''   )

														return distances[finish_vertex]


if __name__ == "__main__":
				import doctest

				doctest.testmod()

