
'''simple docstring'''



def A (__lowerCamelCase :int					,      __lowerCamelCase :list						):
						_enforce_args(__lowerCamelCase					,      __lowerCamelCase						)
						if n == 0:
												return 0
						_lowerCAmelCase    		=					float("""-inf"""						)
						for i in range(1					,      n + 1						):
												_lowerCAmelCase    		=					max(
												    __lowerCamelCase					,      prices[i - 1] + naive_cut_rod_recursive(n - i					,      __lowerCamelCase						)						)

						return max_revue


def A (__lowerCamelCase :int					,      __lowerCamelCase :list						):
						_enforce_args(__lowerCamelCase					,      __lowerCamelCase						)
						_lowerCAmelCase    		=					[float("""-inf"""						) for _ in range(n + 1						)]
						return _top_down_cut_rod_recursive(__lowerCamelCase					,      __lowerCamelCase					,      __lowerCamelCase						)


def A (__lowerCamelCase :int					,      __lowerCamelCase :list					,      __lowerCamelCase :list						):
						if max_rev[n] >= 0:
												return max_rev[n]
						elif n == 0:
												return 0
						else:
												_lowerCAmelCase    		=					float("""-inf"""						)
												for i in range(1					,      n + 1						):
																		_lowerCAmelCase    		=					max(
																		    __lowerCamelCase					,      prices[i - 1] + _top_down_cut_rod_recursive(n - i					,      __lowerCamelCase					,      __lowerCamelCase						)					,      )

												_lowerCAmelCase    		=					max_revenue

						return max_rev[n]


def A (__lowerCamelCase :int					,      __lowerCamelCase :list						):
						_enforce_args(__lowerCamelCase					,      __lowerCamelCase						)

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

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

												_lowerCAmelCase    		=					max_revenue_i

						return max_rev[n]


def A (__lowerCamelCase :int					,      __lowerCamelCase :list						):
						if n < 0:
												_lowerCAmelCase    		=					f'n must be greater than or equal to 0. Got n = {n}'
												raise ValueError(__lowerCamelCase						)

						if n > len(__lowerCamelCase						):
												_lowerCAmelCase    		=					(
												    """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 ():
						_lowerCAmelCase    		=					[6, 10, 12, 15, 20, 23]
						_lowerCAmelCase    		=					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.
						_lowerCAmelCase    		=					36

						_lowerCAmelCase    		=					top_down_cut_rod(__lowerCamelCase					,      __lowerCamelCase						)
						_lowerCAmelCase    		=					bottom_up_cut_rod(__lowerCamelCase					,      __lowerCamelCase						)
						_lowerCAmelCase    		=					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'''



def A ():
						for n in range(1					,      1000000						):
												yield n * (n + 1) // 2


def A (__lowerCamelCase :List[Any]						):
						_lowerCAmelCase    		=					1
						_lowerCAmelCase    		=					2
						while i * i <= n:
												_lowerCAmelCase    		=					0
												while n % i == 0:
																		n //= i
																		multiplicity += 1
												divisors_count *= multiplicity + 1
												i += 1
						if n > 1:
												divisors_count *= 2
						return divisors_count


def A ():
						return next(i for i in triangle_number_generator() if count_divisors(__lowerCamelCase						) > 500						)


if __name__ == "__main__":
						print(solution())
