



'''simple docstring'''


from collections.abc import Sequence






def  UpperCAmelCase_       (		lowercase__ = None       ):


					'''simple docstring'''







					if nums is None or not nums:
										raise ValueError("Input sequence should not be empty"       )

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

					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 typing import Any

import numpy as np






def  UpperCAmelCase_       (		lowercase__       ):


     '''simple docstring'''







     return np.array_equal(lowercase__       ,	matrix.conjugate().T       )






def  UpperCAmelCase_       (		lowercase__       ,	lowercase__       ):


     '''simple docstring'''







     a_       		=v.conjugate().T
     a_       		=v_star.dot(lowercase__       )
     assert isinstance(lowercase__       ,	np.ndarray       )
     return (v_star_dot.dot(lowercase__       )) / (v_star.dot(lowercase__       ))






def  UpperCAmelCase_       (		):


     '''simple docstring'''







     a_       		=np.array([[2, 2 + 1j, 4], [2 - 1j, 3, 1j], [4, -1j, 1]]       )
     a_       		=np.array([[1], [2], [3]]       )
     assert is_hermitian(lowercase__       ), F"""{a} is not hermitian."""
     print(rayleigh_quotient(lowercase__       ,	lowercase__       )       )

     a_       		=np.array([[1, 2, 4], [2, 3, -1], [4, -1, 1]]       )
     assert is_hermitian(lowercase__       ), F"""{a} is not hermitian."""
     assert rayleigh_quotient(lowercase__       ,	lowercase__       ) == float(3       )


if __name__ == "__main__":
  import doctest

  doctest.testmod()
  tests()


