


def        _lowerCamelCase(	lowercase__   , lowercase__   , lowercase__	)						->	float:

		'''simple docstring'''







		if principal <= 0:
				raise Exception('Principal borrowed must be > 0'	)
		if rate_per_annum < 0:
				raise Exception('Rate of interest must be >= 0'	)
		if years_to_repay <= 0 or not isinstance(lowercase__   , lowercase__	):
				raise Exception('Years to repay must be an integer > 0'	)

		# Yearly rate is divided by 12 to get monthly rate
		__lowercase=			rate_per_annum / 1_2

		# Years to repay is multiplied by 12 to get number of payments as payment is monthly
		__lowercase=			years_to_repay * 1_2

		return (
		    principal
		    * rate_per_month
		    * (1 + rate_per_month) ** number_of_payments
		    / ((1 + rate_per_month) ** number_of_payments - 1)
		)


if __name__ == "__main__":
	import doctest

	doctest.testmod()










from collections.abc import Sequence







def        _lowerCamelCase(	lowercase__   , lowercase__ = False	)						->	float:

		'''simple docstring'''







		if not arr:
				return 0

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

		return max_sum


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

	testmod()

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






