





import functools





def     _UpperCamelCase     (a__   :List[str]   ,			a__   :Optional[Any]       ):






       """simple docstring"""





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

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

       if len(__lowerCAmelCase       ) == 0:
              return 0

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

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

       UpperCamelCase__				     =			set(__lowerCAmelCase       )

       @functools.cache
       def dynamic_programming(a__   :Union[str, Any]       ) -> 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()











from argparse import ArgumentParser

from .env import EnvironmentCommand





def     _UpperCamelCase     ():






							"""simple docstring"""





							UpperCamelCase__				     =			ArgumentParser("""Diffusers CLI tool"""   ,			usage="""diffusers-cli <command> [<args>]"""       )
							UpperCamelCase__				     =			parser.add_subparsers(help="""diffusers-cli command helpers"""       )

							# Register commands
							EnvironmentCommand.register_subcommand(a__       )

							# Let's go
							UpperCamelCase__				     =			parser.parse_args()

							if not hasattr(a__   ,			"""func"""       ):
														parser.print_help()
														exit(1       )

							# Run
							UpperCamelCase__				     =			args.func(a__       )
							service.run()


if __name__ == "__main__":
					main()




