

"""simple docstring"""

from __future__ import annotations

from collections.abc import Callable





def 					__UpperCamelCase (     a__:			Callable[[int | float], int | float]			,						a__:			int | float			,						a__:			int | float			,						a__:			int = 1_00			,						)					->      float:




					"""simple docstring"""



					__lowercase        =      x_start
					__lowercase        =      fnc(a__      )
					__lowercase        =      0.0

					for _ in range(a__      ):
										# Approximates small segments of curve as linear and solve
										# for trapezoidal area
										__lowercase        =      (x_end - x_start) / steps + xa
										__lowercase        =      fnc(a__      )
										area += abs(fxa + fxa      ) * (xa - xa) / 2

										# Increment step
										__lowercase        =      xa
										__lowercase        =      fxa
					return area


if __name__ == "__main__":





							def 					__UpperCamelCase (     a__:			int      )					->      Optional[int]:




												"""simple docstring"""



												return x**3

							print("""f(x) = x^3""")
							print("""The area between the curve, x = -10, x = 10 and the x axis is:""")
							a__			:						Dict							=			10
							while i <= 10_0000:
														a__			:						Dict							=			trapezoidal_area(f, -5, 5, i)
														print(f"""with {i} steps: {area}""")
														i *= 10





"""simple docstring"""

import os





def 					__UpperCamelCase (     )					->      int:




					"""simple docstring"""



					__lowercase        =      os.path.dirname(os.path.realpath(a__      )      )
					__lowercase        =      os.path.join(a__			,						'''triangle.txt'''      )

					with open(a__      ) as f:
										__lowercase        =      f.readlines()

					__lowercase        =      [[int(a__      ) for y in x.rstrip('''\r\n'''      ).split(''' '''      )] for x in triangle]

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


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


