
"""simple docstring"""




import os




def  _lowerCAmelCase		(		):






  """simple docstring"""



  _lowercase:			Any       =     os.path.dirname(os.path.realpath(_UpperCamelCase						)						)
  _lowercase:			Any       =     os.path.join(_UpperCamelCase ,				'''triangle.txt'''						)

  with open(_UpperCamelCase						) as f:
    _lowercase:			Optional[Any]       =     f.readlines()

  _lowercase:			Union[str, Any]       =     []
  for line in triangle:
    _lowercase:			Dict       =     []
    for number in line.strip().split(''' '''						):
      numbers_from_line.append(int(_UpperCamelCase						)						)
    a.append(_UpperCamelCase						)

  for i in range(1 ,				len(_UpperCamelCase						)						):
    for j in range(len(a[i]						)						):
      _lowercase:			int       =     a[i - 1][j] if j != len(a[i - 1]						) else 0
      _lowercase:			Any       =     a[i - 1][j - 1] if j > 0 else 0
      a[i][j] += max(_UpperCamelCase ,				_UpperCamelCase						)
  return max(a[-1]						)


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


"""simple docstring"""




from typing import Any

import numpy as np




def  _lowerCAmelCase		(		_UpperCamelCase						):






  """simple docstring"""



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




def  _lowerCAmelCase		(		_UpperCamelCase ,				_UpperCamelCase						):






  """simple docstring"""



  _lowercase:			str       =     v.conjugate().T
  _lowercase:			List[Any]       =     v_star.dot(_UpperCamelCase						)
  assert isinstance(_UpperCamelCase ,				np.ndarray						)
  return (v_star_dot.dot(_UpperCamelCase						)) / (v_star.dot(_UpperCamelCase						))




def  _lowerCAmelCase		(		):






  """simple docstring"""



  _lowercase:			int       =     np.array([[2, 2 + 1j, 4], [2 - 1j, 3, 1j], [4, -1j, 1]]						)
  _lowercase:			str       =     np.array([[1], [2], [3]]						)
  assert is_hermitian(_UpperCamelCase						), f'''{a} is not hermitian.'''
  print(rayleigh_quotient(_UpperCamelCase ,				_UpperCamelCase						)						)

  _lowercase:			Any       =     np.array([[1, 2, 4], [2, 3, -1], [4, -1, 1]]						)
  assert is_hermitian(_UpperCamelCase						), f'''{a} is not hermitian.'''
  assert rayleigh_quotient(_UpperCamelCase ,				_UpperCamelCase						) == float(3						)


if __name__ == "__main__":
  import doctest

  doctest.testmod()
  tests()
