





def 							__snake_case							(    lowerCAmelCase_	)				->						bool:
    if not isinstance(lowerCAmelCase_ ,							lowerCAmelCase_	):
        raise ValueError('''Input series is not valid, valid series - [2, 4, 6]'''	)
    if len(lowerCAmelCase_	) == 0:
        raise ValueError('''Input list must be a non empty list'''	)
    if len(lowerCAmelCase_	) == 1:
        return True
    SCREAMING_SNAKE_CASE__											=			series[1] - series[0]
    for index in range(len(lowerCAmelCase_	) - 1	):
        if series[index + 1] - series[index] != common_diff:
            return False
    return True


def 							__snake_case							(    lowerCAmelCase_	)				->						float:
    if not isinstance(lowerCAmelCase_ ,							lowerCAmelCase_	):
        raise ValueError('''Input series is not valid, valid series - [2, 4, 6]'''	)
    if len(lowerCAmelCase_	) == 0:
        raise ValueError('''Input list must be a non empty list'''	)
    SCREAMING_SNAKE_CASE__											=			0
    for val in series:
        answer += val
    return answer / len(lowerCAmelCase_	)


if __name__ == "__main__":
  import doctest

  doctest.testmod()






import functools


def 					_a							(					lowerCAmelCase    ,						lowerCAmelCase )->	int:

		# Validation
		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' )

		SCREAMING_SNAKE_CASE_					      =							set(lowerCAmelCase )

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