




def       UpperCAmelCase       (     _snake_case							):
							lowerCAmelCase   =		[1]

							lowerCAmelCase   ,     lowerCAmelCase   ,     lowerCAmelCase   =		0, 0, 0
							lowerCAmelCase   =		ugly_nums[ia] * 2
							lowerCAmelCase   =		ugly_nums[ia] * 3
							lowerCAmelCase   =		ugly_nums[ia] * 5

							for _ in range(1						, _snake_case							):
														lowerCAmelCase   =		min(_snake_case						, _snake_case						, _snake_case							)
														ugly_nums.append(_snake_case							)
														if next_num == next_a:
																					ia += 1
																					lowerCAmelCase   =		ugly_nums[ia] * 2
														if next_num == next_a:
																					ia += 1
																					lowerCAmelCase   =		ugly_nums[ia] * 3
														if next_num == next_a:
																					ia += 1
																					lowerCAmelCase   =		ugly_nums[ia] * 5
							return ugly_nums[-1]


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

		testmod(verbose=True)
		print(F'''{ugly_numbers(200) = }''')









from collections.abc import Sequence



def       UpperCAmelCase       (     _snake_case						, _snake_case = False							):
							if not arr:
														return 0

							lowerCAmelCase   =		0 if allow_empty_subarrays else float('''-inf'''							)
							lowerCAmelCase   =		0.0
							for num in arr:
														lowerCAmelCase   =		max(0 if allow_empty_subarrays else num						, curr_sum + num							)
														lowerCAmelCase   =		max(_snake_case						, _snake_case							)

							return max_sum


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

		testmod()

		UpperCAmelCase_						=[-2, 1, -3, 4, -1, 2, 1, -5, 4]
		print(F'''{max_subarray_sum(nums) = }''')



