'''simple docstring'''

from __future__ import annotations

import bisect



def snake_case_      (					__snake_case  :							list[int]	,   __snake_case  :							int	,   __snake_case  :							int = 0	,   __snake_case  :							int = -1)			->					int:
   if hi < 0:
      lowerCAmelCase_			=      len(__snake_case)

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

   return lo



def snake_case_      (					__snake_case  :							list[int]	,   __snake_case  :							int	,   __snake_case  :							int = 0	,   __snake_case  :							int = -1)			->					int:
   if hi < 0:
      lowerCAmelCase_			=      len(__snake_case)

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

   return lo



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



def snake_case_      (					__snake_case  :							list[int]	,   __snake_case  :							int	,   __snake_case  :							int = 0	,   __snake_case  :							int = -1)			->					None:
   sorted_collection.insert(bisect_right(__snake_case	,   __snake_case	,   __snake_case	,   __snake_case)	,   __snake_case)



def snake_case_      (					__snake_case  :							list[int]	,   __snake_case  :							int)			->					int | None:
   lowerCAmelCase_			=      0
   lowerCAmelCase_			=      len(__snake_case) - 1

   while left <= right:
      lowerCAmelCase_			=      left + (right - left) // 2
      lowerCAmelCase_			=      sorted_collection[midpoint]
      if current_item == item:
         return midpoint
      elif item < current_item:
         lowerCAmelCase_			=      midpoint - 1
      else:
         lowerCAmelCase_			=      midpoint + 1
   return None



def snake_case_      (					__snake_case  :							list[int]	,   __snake_case  :							int)			->					int | None:
   lowerCAmelCase_			=      bisect.bisect_left(__snake_case	,   __snake_case)
   if index != len(__snake_case) and sorted_collection[index] == item:
      return index
   return None



def snake_case_      (					__snake_case  :							list[int]	,   __snake_case  :							int	,   __snake_case  :							int	,   __snake_case  :							int)			->					int | None:
   if right < left:
      return None

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

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


if __name__ == "__main__":
 A_     :						int    							=input('''Enter numbers separated by comma:\n''').strip()
 A_     :						List[str]    							=sorted(int(item) for item in user_input.split(''','''))
 A_     :						Optional[Any]    							=int(input('''Enter a single number to be found in the list:\n'''))
 A_     :						Optional[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'''

def snake_case_      (					__snake_case  :							int	,   __snake_case  :							int	,   __snake_case  :							int)			->					float:
   lowerCAmelCase_			=      (num_of_terms / 2) * (2 * first_term + (num_of_terms - 1) * common_diff)
   # formula for sum of series
   return total



def snake_case_      (					)			->					str:
   print(sum_of_series(1	,   1	,   10))


if __name__ == "__main__":
 import doctest

 doctest.testmod()





