
def        __UpperCamelCase					(    lowerCAmelCase__							:    int  ,       lowerCAmelCase__							:    int  ):
	if number < 0 or shift_amount < 0:
		raise ValueError('''both inputs must be positive integers'''  )

	__a			:  Any		    =  str(bin(lowerCAmelCase__  )  )
	binary_number += "0" * shift_amount
	return binary_number




def        __UpperCamelCase					(    lowerCAmelCase__							:    int  ,       lowerCAmelCase__							:    int  ):
	if number < 0 or shift_amount < 0:
		raise ValueError('''both inputs must be positive integers'''  )

	__a			:  Union[str, Any]		    =  str(bin(lowerCAmelCase__  )  )[2:]
	if shift_amount >= len(lowerCAmelCase__  ):
		return "0b0"
	__a			:  Union[str, Any]		    =  binary_number[: len(lowerCAmelCase__  ) - shift_amount]
	return "0b" + shifted_binary_number




def        __UpperCamelCase					(    lowerCAmelCase__							:    int  ,       lowerCAmelCase__							:    int  ):
	if number >= 0:  # Get binary representation of positive number
		__a			:  Tuple		    =  '''0''' + str(bin(lowerCAmelCase__  )  ).strip('''-'''  )[2:]
	else:  # Get binary (2's complement) representation of negative number
		__a			:  Union[str, Any]		    =  len(bin(lowerCAmelCase__  )[3:]  )  # Find 2's complement of number
		__a			:  Tuple		    =  bin(abs(lowerCAmelCase__  ) - (1 << binary_number_length)  )[3:]
		__a			:  Optional[int]		    =  (
		    '''1''' + '''0''' * (binary_number_length - len(lowerCAmelCase__  )) + binary_number
		)

	if shift_amount >= len(lowerCAmelCase__  ):
		return "0b" + binary_number[0] * len(lowerCAmelCase__  )
	return (
	    "0b"
	    + binary_number[0] * shift_amount
	    + binary_number[: len(lowerCAmelCase__  ) - shift_amount]
	)


if __name__ == "__main__":
						import doctest

						doctest.testmod()


from __future__ import annotations

# This is the precision for this function which can be altered.
# It is recommended for users to keep this number greater than or equal to 10.
lowercase__          =10




def        __UpperCamelCase					(    lowerCAmelCase__							:    int  ,       lowerCAmelCase__							:    int  ,       lowerCAmelCase__							:    list[int]  ,       lowerCAmelCase__							:    int  ):
 for i in range(lowerCAmelCase__  ,       lowerCAmelCase__  ):
  if array[i] == target:
   return i
 return -1




def        __UpperCamelCase					(    lowerCAmelCase__							:    list[int]  ,       lowerCAmelCase__							:    int  ):
 __a			:  List[Any]		    =  0
 __a			:  Union[str, Any]		    =  len(lowerCAmelCase__  )
 while left <= right:
  if right - left < precision:
   return lin_search(lowerCAmelCase__  ,       lowerCAmelCase__  ,       lowerCAmelCase__  ,       lowerCAmelCase__  )

  __a			:  str		    =  (left + right) // 3 + 1
  __a			:  List[Any]		    =  2 * (left + right) // 3 + 1

  if array[one_third] == target:
   return one_third
  elif array[two_third] == target:
   return two_third

  elif target < array[one_third]:
   __a			:  List[str]		    =  one_third - 1
  elif array[two_third] < target:
   __a			:  List[str]		    =  two_third + 1

  else:
   __a			:  Dict		    =  one_third + 1
   __a			:  Any		    =  two_third - 1
 else:
  return -1




def        __UpperCamelCase					(    lowerCAmelCase__							:    int  ,       lowerCAmelCase__							:    int  ,       lowerCAmelCase__							:    list[int]  ,       lowerCAmelCase__							:    int  ):
 if left < right:
  if right - left < precision:
   return lin_search(lowerCAmelCase__  ,       lowerCAmelCase__  ,       lowerCAmelCase__  ,       lowerCAmelCase__  )
  __a			:  Union[str, Any]		    =  (left + right) // 3 + 1
  __a			:  Optional[Any]		    =  2 * (left + right) // 3 + 1

  if array[one_third] == target:
   return one_third
  elif array[two_third] == target:
   return two_third

  elif target < array[one_third]:
   return rec_ternary_search(lowerCAmelCase__  ,       one_third - 1  ,       lowerCAmelCase__  ,       lowerCAmelCase__  )
  elif array[two_third] < target:
   return rec_ternary_search(two_third + 1  ,       lowerCAmelCase__  ,       lowerCAmelCase__  ,       lowerCAmelCase__  )
  else:
   return rec_ternary_search(one_third + 1  ,       two_third - 1  ,       lowerCAmelCase__  ,       lowerCAmelCase__  )
 else:
  return -1


if __name__ == "__main__":
      import doctest

      doctest.testmod()

      lowercase__          =input('Enter numbers separated by comma:\n').strip()
      lowercase__          =[int(item.strip()) for item in user_input.split(',')]
      assert collection == sorted(collection), F"List must be ordered.\n{collection}."
      lowercase__          =int(input('Enter the number to be found in the list:\n').strip())
      lowercase__          =ite_ternary_search(collection, target)
      lowercase__          =rec_ternary_search(0, len(collection) - 1, collection, target)
      if resulta != -1:
            print(F"""Iterative search: {target} found at positions: {resulta}""")
            print(F"""Recursive search: {target} found at positions: {resulta}""")
      else:
            print('Not found')
