






lowerCamelCase	:							Optional[Any]				=0  # The first color of the flag.
lowerCamelCase	:							List[Any]				=1  # The second color of the flag.
lowerCamelCase	:							Dict				=2  # The third color of the flag.
lowerCamelCase	:							Optional[Any]				=(red, white, blue)







def 		SCREAMING_SNAKE_CASE							(					__lowerCAmelCase			) ->	Tuple:





     if not sequence:
          return []
     if len(_A			) == 1:
          return list(_A			)
     UpperCamelCase__			:   Optional[Any]       				=  0
     UpperCamelCase__			:   int       				=  len(_A			) - 1
     UpperCamelCase__			:   Dict       				=  0
     while mid <= high:
          if sequence[mid] == colors[0]:
               UpperCamelCase__				,     UpperCamelCase__			:   Any       				=  sequence[mid], sequence[low]
               low += 1
               mid += 1
          elif sequence[mid] == colors[1]:
               mid += 1
          elif sequence[mid] == colors[2]:
               UpperCamelCase__				,     UpperCamelCase__			:   Any       				=  sequence[high], sequence[mid]
               high -= 1
          else:
               UpperCamelCase__			:   Optional[Any]       				=  f'The elements inside the sequence must contains only {colors} values'
               raise ValueError(_A			)
     return sequence


if __name__ == "__main__":
 import doctest

 doctest.testmod()

 lowerCamelCase	:							Optional[Any]				=input('''Enter numbers separated by commas:\n''').strip()
 lowerCamelCase	:							List[str]				=[int(item.strip()) for item in user_input.split(''',''')]
 print(F"""{dutch_national_flag_sort(unsorted)}""")





import functools


def 						lowerCamelCase__    (		_A     ,	_A							):







	'''simple docstring'''





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

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

	if len(_A							) == 0:
		return 0

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

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

	snake_case_		    =     set(_A							)

	@functools.cache
	def dynamic_programming(_A							) -> int:
		if index > 365:
			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 + 30							)     ,	)

	return dynamic_programming(1							)


if __name__ == "__main__":
		import doctest

		doctest.testmod()
