
"""simple docstring"""


from collections.abc import Sequence






def       _snake_case				(		snake_case__   :     Sequence[int] | None = None     ):
	if nums is None or not nums:
		raise ValueError('Input sequence should not be empty'     )

	A						   =   nums[0]
	for i in range(1	,      len(snake_case__     )     ):
		A						   =   nums[i]
		A						   =   max(snake_case__	,      ans + num	,      snake_case__     )

	return ans


if __name__ == "__main__":
		import doctest

		doctest.testmod()

		# Try on a sample input from the user
		_lowercase							   =				int(input('''Enter number of elements : ''').strip())
		_lowercase							   =				list(map(int, input('''\nEnter the numbers : ''').strip().split()))[:n]
		print(max_subsequence_sum(array))

"""simple docstring"""


from math import pi, sqrt






def       _snake_case				(		snake_case__   :     float     ):
	if num <= 0:
		raise ValueError('math domain error'     )
	if num > 171.5:
		raise OverflowError('math range error'     )
	elif num - int(snake_case__     ) not in (0, 0.5):
		raise NotImplementedError('num must be an integer or a half-integer'     )
	elif num == 0.5:
		return sqrt(snake_case__     )
	else:
		return 1.0 if num == 1 else (num - 1) * gamma(num - 1     )






def       _snake_case				(		):
	assert gamma(0.5     ) == sqrt(snake_case__     )
	assert gamma(1     ) == 1.0
	assert gamma(2     ) == 1.0


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

		testmod()
		_lowercase							   =				1.0
		while num:
				_lowercase							   =				float(input('''Gamma of: '''))
				print(F"""gamma({num}) = {gamma(num)}""")
				print('''\nEnter 0 to exit...''')