






import math







def       lowercase__	(					A_:						int		)	->				bool:







       """simple docstring"""






       assert isinstance(A_  ,      A_		) and (
           number >= 0
       ), "'number' must been an int and positive"

       if 1 < number < 4:
              # 2 and 3 are primes
              return True
       elif number < 2 or not number % 2:
              # Negatives, 0, 1 and all even numbers are not primes
              return False

       __UpperCAmelCase     				=range(3  ,      int(math.sqrt(A_		) + 1		)  ,      2		)
       return not any(not number % i for i in odd_numbers		)







def       lowercase__	(					A_:						Any  ,      A_:						Optional[int]=1  ,      **A_:						int		)	->				int:







       """simple docstring"""






       __UpperCAmelCase     				=factor * value
       __UpperCAmelCase     				=value

       while not is_prime(A_		):
              value += 1 if not ("desc" in kwargs and kwargs["desc"] is True) else -1

       if value == first_value_val:
              return next_prime(value + 1  ,      **A_		)
       return value







import functools





def a(lowercase__      ,			lowercase__						):





	'''simple docstring'''

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

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

	if len(lowercase__						) == 0:
		return 0

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

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

	snake_case_   		=			set(lowercase__						)

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