
def 				a						(							snake_case__:					int						,   snake_case__:					list					):


				'''simple docstring'''
				_enforce_args(snake_case__						,   snake_case__					)
				if n == 0:
								return 0
				lowercase_       =					float('''-inf'''					)
				for i in range(1						,   n + 1					):
								lowercase_       =					max(
								    snake_case__						,   prices[i - 1] + naive_cut_rod_recursive(n - i						,   snake_case__					)					)

				return max_revue




def 				a						(							snake_case__:					int						,   snake_case__:					list					):


				'''simple docstring'''
				_enforce_args(snake_case__						,   snake_case__					)
				lowercase_       =					[float('''-inf'''					) for _ in range(n + 1					)]
				return _top_down_cut_rod_recursive(snake_case__						,   snake_case__						,   snake_case__					)




def 				a						(							snake_case__:					int						,   snake_case__:					list						,   snake_case__:					list					):


				'''simple docstring'''
				if max_rev[n] >= 0:
								return max_rev[n]
				elif n == 0:
								return 0
				else:
								lowercase_       =					float('''-inf'''					)
								for i in range(1						,   n + 1					):
												lowercase_       =					max(
												    snake_case__						,   prices[i - 1] + _top_down_cut_rod_recursive(n - i						,   snake_case__						,   snake_case__					)						,   )

								lowercase_       =					max_revenue

				return max_rev[n]




def 				a						(							snake_case__:					int						,   snake_case__:					list					):


				'''simple docstring'''
				_enforce_args(snake_case__						,   snake_case__					)

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

				for i in range(1						,   n + 1					):
								lowercase_       =					max_rev[i]
								for j in range(1						,   i + 1					):
												lowercase_       =					max(snake_case__						,   prices[j - 1] + max_rev[i - j]					)

								lowercase_       =					max_revenue_i

				return max_rev[n]




def 				a						(							snake_case__:					int						,   snake_case__:					list					):


				'''simple docstring'''
				if n < 0:
								lowercase_       =					F'''n must be greater than or equal to 0. Got n = {n}'''
								raise ValueError(snake_case__					)

				if n > len(snake_case__					):
								lowercase_       =					(
								    '''Each integral piece of rod must have a corresponding price. '''
								    F'''Got n = {n} but length of prices = {len(snake_case__					)}'''
								)
								raise ValueError(snake_case__					)




def 				a						(							):


				'''simple docstring'''
				lowercase_       =					[6, 10, 12, 15, 20, 23]
				lowercase_       =					len(snake_case__					)

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

				lowercase_       =					top_down_cut_rod(snake_case__						,   snake_case__					)
				lowercase_       =					bottom_up_cut_rod(snake_case__						,   snake_case__					)
				lowercase_       =					naive_cut_rod_recursive(snake_case__						,   snake_case__					)

				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						(							snake_case__:					list					):


				'''simple docstring'''

				if len(snake_case__					) <= 1:
								return [tuple(snake_case__					)]

				lowercase_       =					[]

				def generate(snake_case__:					int						,   snake_case__:					list					):
								if k == 1:
												res.append(tuple(arr[:]					)					)
												return

								generate(k - 1						,   snake_case__					)

								for i in range(k - 1					):
												if k % 2 == 0:  # k is even
																lowercase_  ,	lowercase_       =					arr[k - 1], arr[i]
												else:  # k is odd
																lowercase_  ,	lowercase_       =					arr[k - 1], arr[0]
												generate(k - 1						,   snake_case__					)

				generate(len(snake_case__					)						,   snake_case__					)
				return res


if __name__ == "__main__":
						__a  			=					input('Enter numbers separated by a comma:\n').strip()
						__a  			=					[int(item) for item in user_input.split(',')]
						print(heaps(arr))




