

"""simple docstring"""

def 					__UpperCamelCase (     a__:			list      )					->      bool:




					"""simple docstring"""



					if not isinstance(a__			,						a__      ):
										raise ValueError('''Input series is not valid, valid series - [2, 4, 8]'''      )
					if len(a__      ) == 0:
										raise ValueError('''Input list must be a non empty list'''      )
					if len(a__      ) == 1:
										return True
					try:
										__lowercase        =      series[1] / series[0]
										for index in range(len(a__      ) - 1      ):
															if series[index + 1] / series[index] != common_ratio:
																				return False
					except ZeroDivisionError:
										return False
					return True





def 					__UpperCamelCase (     a__:			list      )					->      float:




					"""simple docstring"""



					if not isinstance(a__			,						a__      ):
										raise ValueError('''Input series is not valid, valid series - [2, 4, 8]'''      )
					if len(a__      ) == 0:
										raise ValueError('''Input list must be a non empty list'''      )
					__lowercase        =      1
					for value in series:
										answer *= value
					return pow(a__			,						1 / len(a__      )      )


if __name__ == "__main__":
							import doctest

							doctest.testmod()





"""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())


