def 	__lowerCamelCase							(UpperCAmelCase__     :							int = 1_0      , UpperCAmelCase__     :							int = 1_0_0_0      , UpperCAmelCase__     :							bool = True  ):
					assert (
					    isinstance(UpperCAmelCase__      , UpperCAmelCase__  )
					    and isinstance(UpperCAmelCase__      , UpperCAmelCase__  )
					    and isinstance(UpperCAmelCase__      , UpperCAmelCase__  )
					), "Invalid type of value(s) specified to function!"

					if min_val > max_val:
										raise ValueError("Invalid value for min_val or max_val (min_value < max_value)"  )
					return min_val if option else max_val





def 	__lowerCamelCase							(UpperCAmelCase__     :							int      , UpperCAmelCase__     :							int  ):
					return int((number_a + number_a) / 2  )





def 	__lowerCamelCase							(UpperCAmelCase__     :							int      , UpperCAmelCase__     :							int      , UpperCAmelCase__     :							int  ):
					assert (
					    isinstance(UpperCAmelCase__      , UpperCAmelCase__  ) and isinstance(UpperCAmelCase__      , UpperCAmelCase__  ) and isinstance(UpperCAmelCase__      , UpperCAmelCase__  )
					), 'argument values must be type of "int"'

					if lower > higher:
										raise ValueError("argument value for lower and higher must be(lower > higher)"  )

					if not lower < to_guess < higher:
										raise ValueError(
										    "guess value must be within the range of lower and higher value"  )

					def answer(UpperCAmelCase__     :							int  ) -> str:
										if number > to_guess:
															return "high"
										elif number < to_guess:
															return "low"
										else:
															return "same"

					print("started..."  )

					SCREAMING_SNAKE_CASE    			=       lower
					SCREAMING_SNAKE_CASE    			=       higher

					SCREAMING_SNAKE_CASE    			=       []

					while True:
										SCREAMING_SNAKE_CASE    			=       get_avg(UpperCAmelCase__      , UpperCAmelCase__  )
										last_numbers.append(UpperCAmelCase__  )

										if answer(UpperCAmelCase__  ) == "low":
															SCREAMING_SNAKE_CASE    			=       number
										elif answer(UpperCAmelCase__  ) == "high":
															SCREAMING_SNAKE_CASE    			=       number
										else:
															break

					print(F"guess the number : {last_numbers[-1]}"  )
					print(F"details : {last_numbers!s}"  )





def 	__lowerCamelCase							():
					SCREAMING_SNAKE_CASE    			=       int(input("Enter lower value : "  ).strip()  )
					SCREAMING_SNAKE_CASE    			=       int(input("Enter high value : "  ).strip()  )
					SCREAMING_SNAKE_CASE    			=       int(input("Enter value to guess : "  ).strip()  )
					guess_the_number(UpperCAmelCase__      , UpperCAmelCase__      , UpperCAmelCase__  )


if __name__ == "__main__":
			main()





import functools





def 	__lowerCamelCase							(UpperCAmelCase__     :							list[int]      , UpperCAmelCase__     :							list[int]  ):

					# Validation
					if not isinstance(UpperCAmelCase__      , UpperCAmelCase__  ) or not all(isinstance(UpperCAmelCase__      , UpperCAmelCase__  ) for day in days  ):
										raise ValueError("The parameter days should be a list of integers"  )

					if len(UpperCAmelCase__  ) != 3 or not all(isinstance(UpperCAmelCase__      , UpperCAmelCase__  ) for cost in costs  ):
										raise ValueError("The parameter costs should be a list of three integers"  )

					if len(UpperCAmelCase__  ) == 0:
										return 0

					if min(UpperCAmelCase__  ) <= 0:
										raise ValueError("All days elements should be greater than 0"  )

					if max(UpperCAmelCase__  ) >= 3_6_6:
										raise ValueError("All days elements should be less than 366"  )

					SCREAMING_SNAKE_CASE    			=       set(UpperCAmelCase__  )

					@functools.cache
					def dynamic_programming(UpperCAmelCase__     :							int  ) -> int:
										if index > 3_6_5:
															return 0

										if index not in days_set:
															return dynamic_programming(index + 1  )

										return min(
										    costs[0] + dynamic_programming(index + 1  )      , costs[1] + dynamic_programming(index + 7  )      , costs[2] + dynamic_programming(index + 3_0  )      , )

					return dynamic_programming(1  )


if __name__ == "__main__":
							import doctest

							doctest.testmod()




