



"""simple docstring"""






def 			snake_case_    ( A_   :						int,							A_   :						list		):


       '''simple docstring'''





       _enforce_args(A_,							A_		)
       if n == 0:
              return 0
       _lowerCamelCase		:							Tuple            =					float('''-inf'''		)
       for i in range(1,							n + 1		):
              _lowerCamelCase		:							List[Any]            =					max(
                  A_,							prices[i - 1] + naive_cut_rod_recursive(n - i,							A_		)		)

       return max_revue






def 			snake_case_    ( A_   :						int,							A_   :						list		):


       '''simple docstring'''





       _enforce_args(A_,							A_		)
       _lowerCamelCase		:							Dict            =					[float('''-inf'''		) for _ in range(n + 1		)]
       return _top_down_cut_rod_recursive(A_,							A_,							A_		)






def 			snake_case_    ( A_   :						int,							A_   :						list,							A_   :						list		):


       '''simple docstring'''





       if max_rev[n] >= 0:
              return max_rev[n]
       elif n == 0:
              return 0
       else:
              _lowerCamelCase		:							Tuple            =					float('''-inf'''		)
              for i in range(1,							n + 1		):
                     _lowerCamelCase		:							int            =					max(
                         A_,							prices[i - 1] + _top_down_cut_rod_recursive(n - i,							A_,							A_		),							)

              _lowerCamelCase		:							int            =					max_revenue

       return max_rev[n]






def 			snake_case_    ( A_   :						int,							A_   :						list		):


       '''simple docstring'''





       _enforce_args(A_,							A_		)

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

       for i in range(1,							n + 1		):
              _lowerCamelCase		:							Dict            =					max_rev[i]
              for j in range(1,							i + 1		):
                     _lowerCamelCase		:							Optional[Any]            =					max(A_,							prices[j - 1] + max_rev[i - j]		)

              _lowerCamelCase		:							Tuple            =					max_revenue_i

       return max_rev[n]






def 			snake_case_    ( A_   :						int,							A_   :						list		):


       '''simple docstring'''





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

       if n > len(A_		):
              _lowerCamelCase		:							Union[str, Any]            =					(
                  '''Each integral piece of rod must have a corresponding price. '''
                  F'''Got n = {n} but length of prices = {len(A_		)}'''
              )
              raise ValueError(A_		)






def 			snake_case_    ( ):


       '''simple docstring'''





       _lowerCamelCase		:							int            =					[6, 10, 12, 15, 20, 23]
       _lowerCamelCase		:							int            =					len(A_		)

       # the best revenue comes from cutting the rod into 6 pieces, each
       # of length 1 resulting in a revenue of 6 * 6 = 36.
       _lowerCamelCase		:							Any            =					36

       _lowerCamelCase		:							Optional[int]            =					top_down_cut_rod(A_,							A_		)
       _lowerCamelCase		:							int            =					bottom_up_cut_rod(A_,							A_		)
       _lowerCamelCase		:							List[Any]            =					naive_cut_rod_recursive(A_,							A_		)

       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()




def 				__A(lowerCAmelCase			)		->					bool:

		"""simple docstring"""






		if not isinstance(lowerCAmelCase    ,	lowerCAmelCase			):
				raise ValueError("""check_bouncy() accepts only integer arguments"""			)
		_UpperCamelCase         =						str(lowerCAmelCase			)
		_UpperCamelCase         =						"""""".join(sorted(lowerCAmelCase			)			)
		return sorted_str_n != str_n and sorted_str_n[::-1] != str_n


def 				__A(lowerCAmelCase = 9_9			)		->					int:

		"""simple docstring"""






		if not 0 < percent < 1_0_0:
				raise ValueError("""solution() only accepts values from 0 to 100"""			)
		_UpperCamelCase         =						0
		_UpperCamelCase         =						1

		while True:
				if check_bouncy(lowerCAmelCase			):
						bouncy_num += 1
				if (bouncy_num / num) * 1_0_0 >= percent:
						return num
				num += 1


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

		testmod()
		print(F"""{solution(99)}""")



