




import os





def 							lowerCamelCase    (							)->			str:

       """simple docstring"""




       a			   =os.path.dirname(os.path.realpath(_lowerCAmelCase      )      )
       a			   =os.path.join(_lowerCAmelCase   ,       """triangle.txt"""      )

       with open(_lowerCAmelCase      ) as f:
              a			   =f.readlines()

       a			   =[[int(_lowerCAmelCase      ) for y in x.rstrip("""\r\n"""      ).split(""" """      )] for x in triangle]

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


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




"""simple docstring"""






import math
import os

import cva
import numpy as np

__snake_case												=							255.0
def    A_ ( _lowerCAmelCase  :       float,  _lowerCAmelCase  :       float							):






     """simple docstring"""

     _a     						=					np.mean((original - contrast) ** 2							)
     if mse == 0:
          return 1_00

     return 20 * math.logaa(PIXEL_MAX / math.sqrt(_lowerCAmelCase							)							)
def    A_ ( ):






     """simple docstring"""

     _a     						=					os.path.dirname(os.path.realpath(_lowerCAmelCase							)							)
     # Loading images (original image and compressed image)
     _a     						=					cva.imread(os.path.join(_lowerCAmelCase,  '''image_data/original_image.png'''							)							)
     _a     						=					cva.imread(os.path.join(_lowerCAmelCase,  '''image_data/compressed_image.png'''							),  1							)

     _a     						=					cva.imread(os.path.join(_lowerCAmelCase,  '''image_data/PSNR-example-base.png'''							)							)
     _a     						=					cva.imread(
         os.path.join(_lowerCAmelCase,  '''image_data/PSNR-example-comp-10.jpg'''							),  1							)

     # Value expected: 29.73dB
     print('''-- First Test --'''							)
     print(f'PSNR value is {peak_signal_to_noise_ratio(_lowerCAmelCase,  _lowerCAmelCase							)} dB'							)

     # # Value expected: 31.53dB (Wikipedia Example)
     print('''\n-- Second Test --'''							)
     print(f'PSNR value is {peak_signal_to_noise_ratio(_lowerCAmelCase,  _lowerCAmelCase							)} dB'							)


if __name__ == "__main__":
   main()