



'''simple docstring'''




def 	a			( lowerCamelCase__						,      lowerCamelCase__    ):
			'''simple docstring'''





			_enforce_args(lowerCamelCase__						,      lowerCamelCase__    )
			if n == 0:
						return 0
			A_	:						Union[str, Any]	=     float("""-inf"""    )
			for i in range(1						,      n + 1    ):
						A_	:						Tuple	=     max(
						    lowerCamelCase__						,      prices[i - 1] + naive_cut_rod_recursive(n - i						,      lowerCamelCase__    )    )

			return max_revue



def 	a			( lowerCamelCase__						,      lowerCamelCase__    ):
			'''simple docstring'''





			_enforce_args(lowerCamelCase__						,      lowerCamelCase__    )
			A_	:						Union[str, Any]	=     [float("""-inf"""    ) for _ in range(n + 1    )]
			return _top_down_cut_rod_recursive(lowerCamelCase__						,      lowerCamelCase__						,      lowerCamelCase__    )



def 	a			( lowerCamelCase__						,      lowerCamelCase__						,      lowerCamelCase__    ):
			'''simple docstring'''





			if max_rev[n] >= 0:
						return max_rev[n]
			elif n == 0:
						return 0
			else:
						A_	:						Union[str, Any]	=     float("""-inf"""    )
						for i in range(1						,      n + 1    ):
									A_	:						int	=     max(
									    lowerCamelCase__						,      prices[i - 1] + _top_down_cut_rod_recursive(n - i						,      lowerCamelCase__						,      lowerCamelCase__    )						,      )

						A_	:						Union[str, Any]	=     max_revenue

			return max_rev[n]



def 	a			( lowerCamelCase__						,      lowerCamelCase__    ):
			'''simple docstring'''





			_enforce_args(lowerCamelCase__						,      lowerCamelCase__    )

			# length(max_rev) = n + 1, to accommodate for the revenue obtainable from a rod of
			# length 0.
			A_	:						Any	=     [float("""-inf"""    ) for _ in range(n + 1    )]
			A_	:						Tuple	=     0

			for i in range(1						,      n + 1    ):
						A_	:						Union[str, Any]	=     max_rev[i]
						for j in range(1						,      i + 1    ):
									A_	:						Union[str, Any]	=     max(lowerCamelCase__						,      prices[j - 1] + max_rev[i - j]    )

						A_	:						Tuple	=     max_revenue_i

			return max_rev[n]



def 	a			( lowerCamelCase__						,      lowerCamelCase__    ):
			'''simple docstring'''





			if n < 0:
						A_	:						Optional[Any]	=     f'n must be greater than or equal to 0. Got n = {n}'
						raise ValueError(lowerCamelCase__    )

			if n > len(lowerCamelCase__    ):
						A_	:						List[str]	=     (
						    """Each integral piece of rod must have a corresponding price. """
						    f'Got n = {n} but length of prices = {len(lowerCamelCase__    )}'
						)
						raise ValueError(lowerCamelCase__    )



def 	a			( ):
			'''simple docstring'''





			A_	:						List[Any]	=     [6, 10, 12, 15, 20, 23]
			A_	:						Dict	=     len(lowerCamelCase__    )

			# the best revenue comes from cutting the rod into 6 pieces, each
			# of length 1 resulting in a revenue of 6 * 6 = 36.
			A_	:						Optional[int]	=     36

			A_	:						Any	=     top_down_cut_rod(lowerCamelCase__						,      lowerCamelCase__    )
			A_	:						str	=     bottom_up_cut_rod(lowerCamelCase__						,      lowerCamelCase__    )
			A_	:						Union[str, Any]	=     naive_cut_rod_recursive(lowerCamelCase__						,      lowerCamelCase__    )

			assert expected_max_revenue == max_rev_top_down
			assert max_rev_top_down == max_rev_bottom_up
			assert max_rev_bottom_up == max_rev_naive


if __name__ == "__main__":
						main()




'''simple docstring'''




from string import ascii_lowercase, ascii_uppercase



def 	a			( lowerCamelCase__    ):
			'''simple docstring'''





			if not sentence:
						return ""
			A_	:						Optional[int]	=     dict(zip(lowerCamelCase__						,      lowerCamelCase__    )    )
			return lower_to_upper.get(sentence[0]						,      sentence[0]    ) + sentence[1:]


if __name__ == "__main__":
						from doctest import testmod

						testmod()