
import os


def 							SCREAMING_SNAKE_CASE_      (			):
      UpperCamelCase__    :   Any					=				os.path.dirname(os.path.realpath(UpperCamelCase__		)		)
      UpperCamelCase__    :   Tuple					=				os.path.join(UpperCamelCase__ ,		'''triangle.txt'''		)

      with open(UpperCamelCase__		) as f:
            UpperCamelCase__    :   Union[str, Any]					=				f.readlines()

      UpperCamelCase__    :   List[Any]					=				[]
      for line in triangle:
            UpperCamelCase__    :   List[Any]					=				[]
            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]		)		):
                  UpperCamelCase__    :   Union[str, Any]					=				a[i - 1][j] if j != len(a[i - 1]		) else 0
                  UpperCamelCase__    :   List[str]					=				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())




import doctest
from collections import deque

import numpy as np




class 				_lowerCamelCase :





     """simple docstring"""







     def __init__(							self  )  ->   None:




           """simple docstring"""







           UpperCamelCase__    :   Tuple					=				[2, 1, 2, -1]
           UpperCamelCase__    :   Union[str, Any]					=				[1, 2, 3, 4]






     def    __SCREAMING_SNAKE_CASE			(							self  )  ->   list[float]:




           """simple docstring"""







           UpperCamelCase__    :   List[str]					=				len(self.first_signal  )
           UpperCamelCase__    :   Any					=				len(self.second_signal  )

           UpperCamelCase__    :   Dict					=				max(__SCREAMING_SNAKE_CASE						,						__SCREAMING_SNAKE_CASE  )

           # create a zero matrix of max_length x max_length
           UpperCamelCase__    :   List[Any]					=				[[0] * max_length for i in range(__SCREAMING_SNAKE_CASE  )]

           # fills the smaller signal with zeros to make both signals of same length
           if length_first_signal < length_second_signal:
                 self.first_signal += [0] * (max_length - length_first_signal)
           elif length_first_signal > length_second_signal:
                 self.second_signal += [0] * (max_length - length_second_signal)
           for i in range(__SCREAMING_SNAKE_CASE  ):
                 UpperCamelCase__    :   Optional[int]					=				deque(self.second_signal  )
                 rotated_signal.rotate(__SCREAMING_SNAKE_CASE  )
                 for j, item in enumerate(__SCREAMING_SNAKE_CASE  ):
                       matrix[i][j] += item

        # multiply the matrix with the first signal
           UpperCamelCase__    :   Optional[Any]					=				np.matmul(np.transpose(__SCREAMING_SNAKE_CASE  )						,						np.transpose(self.first_signal  )  )

           # rounding-off to two decimal places
           return [round(__SCREAMING_SNAKE_CASE						,						2  ) for i in final_signal]


if __name__ == "__main__":
    doctest.testmod()


