

'''simple docstring'''
_UpperCAmelCase  :		dict[str, float]  =		{
    "joule": 1.0,
    "kilojoule": 10_00,
    "megajoule": 1_00_00_00,
    "gigajoule": 10_00_00_00_00,
    "wattsecond": 1.0,
    "watthour": 36_00,
    "kilowatthour": 3_60_00_00,
    "newtonmeter": 1.0,
    "calorie_nutr": 41_86.8,
    "kilocalorie_nutr": 4_18_68_00.00,
    "electronvolt": 1.6_02_17_66_34e-19,
    "britishthermalunit_it": 10_55.0_55_85,
    "footpound": 1.35_5818,
}




def 	UpperCamelCase   (       lowercase_						:    str     ,					lowercase_						:    str     ,					lowercase_						:    float	)		->	float:




  '''simple docstring'''



  if to_type not in ENERGY_CONVERSION or from_type not in ENERGY_CONVERSION:
    lowercase									=(
        f'Incorrect \'from_type\' or \'to_type\' value: {from_type!r}, {to_type!r}\n'
        f'Valid values are: {", ".join(lowercase_	)}'
    )
    raise ValueError(lowercase_	)
  return value * ENERGY_CONVERSION[from_type] / ENERGY_CONVERSION[to_type]


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.
__snake_case				:      Optional[Any]   		=			10


def 					_UpperCAmelCase				(						a__  ,	a__  ,	a__  ,	a__):

			'''simple docstring'''



			for i in range(a__  ,	a__):
						if array[i] == target:
									return i
			return -1


def 					_UpperCAmelCase				(						a__  ,	a__):

			'''simple docstring'''



			a_						:						Any 							= 0
			a_						:						List[str] 							= len(a__)
			while left <= right:
						if right - left < precision:
									return lin_search(a__  ,	a__  ,	a__  ,	a__)

						a_						:						Dict 							= (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]:
									a_						:						int 							= one_third - 1
						elif array[two_third] < target:
									a_						:						Any 							= two_third + 1

						else:
									a_						:						Optional[int] 							= one_third + 1
									a_						:						int 							= two_third - 1
			else:
						return -1


def 					_UpperCAmelCase				(						a__  ,	a__  ,	a__  ,	a__):

			'''simple docstring'''



			if left < right:
						if right - left < precision:
									return lin_search(a__  ,	a__  ,	a__  ,	a__)
						a_						:						Optional[int] 							= (left + right) // 3 + 1
						a_						:						Union[str, 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(a__  ,	one_third - 1  ,	a__  ,	a__)
						elif array[two_third] < target:
									return rec_ternary_search(two_third + 1  ,	a__  ,	a__  ,	a__)
						else:
									return rec_ternary_search(one_third + 1  ,	two_third - 1  ,	a__  ,	a__)
			else:
						return -1


if __name__ == "__main__":
	import doctest

	doctest.testmod()

	__snake_case				:      Optional[int]   		=			input("""Enter numbers separated by comma:\n""").strip()
	__snake_case				:      Optional[int]   		=			[int(item.strip()) for item in user_input.split(""",""")]
	assert collection == sorted(collection), F"List must be ordered.\n{collection}."
	__snake_case				:      int   		=			int(input("""Enter the number to be found in the list:\n""").strip())
	__snake_case				:      List[Any]   		=			ite_ternary_search(collection, target)
	__snake_case				:      Optional[int]   		=			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""")


