import functools





def  _lowerCamelCase					(   a_				: list[int]						,			a_				: list[int]):

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

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

			if len(a_) == 0:
						return 0

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

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

			lowerCamelCase						:Any						  =     set(a_)

			@functools.cache
			def dynamic_programming(a_				: int) -> int:
						if index > 3_65:
									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()




def  _lowerCamelCase					(   a_				: list):

			if not grid or not grid[0]:
						raise TypeError('''The grid does not contain the appropriate information''')

			for cell_n in range(1						,			len(grid[0])):
						grid[0][cell_n] += grid[0][cell_n - 1]
			lowerCamelCase						:Any						  =     grid[0]

			for row_n in range(1						,			len(a_)):
						lowerCamelCase						:List[str]						  =     grid[row_n]
						lowerCamelCase						:Union[str, Any]						  =     fill_row(a_						,			a_)
						lowerCamelCase						:List[Any]						  =     grid[row_n]

			return grid[-1][-1]





def  _lowerCamelCase					(   a_				: list						,			a_				: list):
			current_row[0] += row_above[0]
			for cell_n in range(1						,			len(a_)):
						current_row[cell_n] += min(current_row[cell_n - 1]						,			row_above[cell_n])

			return current_row


if __name__ == "__main__":
			import doctest

			doctest.testmod()



