




'''simple docstring'''





import functools


def 					UpperCamelCase_(     snake_case							:	List[str]							,    snake_case							:	List[str]					):

							'''simple docstring'''






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

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

							if len(snake_case					) == 0:
														return 0

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

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

							snake_case_      =				set(snake_case					)

							@functools.cache
							def dynamic_programming(snake_case							:	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()










'''simple docstring'''





def 					UpperCamelCase_(     snake_case							:	int = 1_0_0_0					):

							'''simple docstring'''






							snake_case_      =				3
							snake_case_      =				0
							while a < n:
														if a % 3 == 0 or a % 5 == 0:
																					result += a
														elif a % 1_5 == 0:
																					result -= a
														a += 1
							return result


if __name__ == "__main__":
		print(F"{solution() = }")




