"""simple docstring"""







import logging
import os
from logging import (
    CRITICAL,  # NOQA
    DEBUG,  # NOQA
    ERROR,  # NOQA
    FATAL,  # NOQA
    INFO,  # NOQA
    NOTSET,  # NOQA
    WARN,  # NOQA
    WARNING,  # NOQA
)
from typing import Optional

from tqdm import auto as tqdm_lib


SCREAMING_SNAKE_CASE									=						{
    'debug': logging.DEBUG,
    'info': logging.INFO,
    'warning': logging.WARNING,
    'error': logging.ERROR,
    'critical': logging.CRITICAL,
}

SCREAMING_SNAKE_CASE									=						logging.WARNING


def      __lowerCAmelCase(		):






	"""simple docstring"""





	_lowercase :    List[Any]							=							os.getenv('DATASETS_VERBOSITY'     ,__UpperCAmelCase			)
	if env_level_str:
		if env_level_str in log_levels:
			return log_levels[env_level_str]
		else:
			logging.getLogger().warning(
			    F'''Unknown option DATASETS_VERBOSITY={env_level_str}, '''
			    F'''has to be one of: { ', '.join(log_levels.keys()			) }'''			)
	return _default_log_level


def      __lowerCAmelCase(		):






	"""simple docstring"""





	return __name__.split('.'			)[0]


def      __lowerCAmelCase(		):






	"""simple docstring"""





	return logging.getLogger(_get_library_name()			)


def      __lowerCAmelCase(		):






	"""simple docstring"""





	_lowercase :    Union[str, Any]							=							_get_library_root_logger()
	library_root_logger.setLevel(_get_default_logging_level()			)


def      __lowerCAmelCase(		):






	"""simple docstring"""





	_lowercase :    Any							=							_get_library_root_logger()
	library_root_logger.setLevel(logging.NOTSET			)


def      __lowerCAmelCase(		__UpperCAmelCase = None			):






	"""simple docstring"""





	if name is None:
		_lowercase :    str							=							_get_library_name()
	return logging.getLogger(__UpperCAmelCase			)


def      __lowerCAmelCase(		):






	"""simple docstring"""





	return _get_library_root_logger().getEffectiveLevel()


def      __lowerCAmelCase(		__UpperCAmelCase			):






	"""simple docstring"""





	_get_library_root_logger().setLevel(__UpperCAmelCase			)


def      __lowerCAmelCase(		):






	"""simple docstring"""





	return set_verbosity(__UpperCAmelCase			)


def      __lowerCAmelCase(		):






	"""simple docstring"""





	return set_verbosity(__UpperCAmelCase			)


def      __lowerCAmelCase(		):






	"""simple docstring"""





	return set_verbosity(__UpperCAmelCase			)


def      __lowerCAmelCase(		):






	"""simple docstring"""





	return set_verbosity(__UpperCAmelCase			)


def      __lowerCAmelCase(		):






	"""simple docstring"""





	_lowercase :    Union[str, Any]							=							False


def      __lowerCAmelCase(		):






	"""simple docstring"""





	_lowercase :    int							=							True


# Configure the library root logger at the module level (singleton-like)
_configure_library_root_logger()



class  _lowerCamelCase			:







				def __init__( self    :       Optional[Any]			,					*lowerCamelCase_    :       Union[str, Any]			,					**lowerCamelCase_    :       List[Any]						):  # pylint: disable=unused-argument

					"""simple docstring"""






					_lowercase :    List[str]							=							args[0] if args else None







				def __iter__( self    :       Any						):

					"""simple docstring"""






					return iter(self._iterator						)







				def __getattr__( self    :       Optional[Any]			,					lowerCamelCase_    :       str						):

					"""simple docstring"""






					def empty_fn(*lowerCamelCase_    :       int			,					**lowerCamelCase_    :       Tuple						):  # pylint: disable=unused-argument
						return

					return empty_fn







				def __enter__( self    :       str						):

					"""simple docstring"""






					return self







				def __exit__( self    :       List[str]			,					lowerCamelCase_    :       List[str]			,					lowerCamelCase_    :       Any			,					lowerCamelCase_    :       int						):

					"""simple docstring"""






					return



SCREAMING_SNAKE_CASE									=						True



class  _lowerCamelCase			:







				def __call__( self    :       Optional[int]			,					*lowerCamelCase_    :       List[str]			,					lowerCamelCase_    :       str=False			,					**lowerCamelCase_    :       Dict						):

					"""simple docstring"""






					if _tqdm_active and not disable:
						return tqdm_lib.tqdm(*lowerCamelCase_			,					**lowerCamelCase_						)
					else:
						return EmptyTqdm(*lowerCamelCase_			,					**lowerCamelCase_						)







				def 							__UpperCAmelCase					( self    :       Dict			,					*lowerCamelCase_    :       Union[str, Any]			,					**lowerCamelCase_    :       Optional[Any]						):

					"""simple docstring"""






					_lowercase :    Dict							=							None
					if _tqdm_active:
						return tqdm_lib.tqdm.set_lock(*lowerCamelCase_			,					**lowerCamelCase_						)







				def 							__UpperCAmelCase					( self    :       List[Any]						):

					"""simple docstring"""






					if _tqdm_active:
						return tqdm_lib.tqdm.get_lock()



SCREAMING_SNAKE_CASE									=						_tqdm_cls()


def      __lowerCAmelCase(		):






	"""simple docstring"""





	global _tqdm_active
	return bool(_tqdm_active			)


def      __lowerCAmelCase(		):






	"""simple docstring"""





	global _tqdm_active
	_lowercase :    List[str]							=							True







def      __lowerCAmelCase(		):






	"""simple docstring"""





	global _tqdm_active
	_lowercase :    List[Any]							=							False




"""simple docstring"""







import functools


def      __lowerCAmelCase(		__UpperCAmelCase     ,__UpperCAmelCase			):






	"""simple docstring"""





	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			) >= 366:
		raise ValueError('All days elements should be less than 366'			)

	_lowercase :    List[Any]							=							set(__UpperCAmelCase			)

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



