




'''simple docstring'''







import os



def        lowerCamelCase__				(      ):
     snake_case			:      Optional[int]        =			os.path.dirname(os.path.realpath(__lowercase				)				)
     snake_case			:      Dict        =			os.path.join(__lowercase     ,   """triangle.txt"""				)

     with open(__lowercase				) as f:
          snake_case			:      List[str]        =			f.readlines()

     snake_case			:      Optional[Any]        =			[]
     for line in triangle:
          snake_case			:      Tuple        =			[]
          for number in line.strip().split(""" """				):
               numbers_from_line.append(int(__lowercase				)				)
          a.append(__lowercase				)

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


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









'''simple docstring'''







import numpy as np
from cva import destroyAllWindows, imread, imshow, waitKey







class 					_a :





     '''simple docstring'''



     def __init__(				self							,__a							,__a							,__a							)      ->				Tuple:
          if dst_width < 0 or dst_height < 0:
               raise ValueError("""Destination width/height should be > 0"""							)

          snake_case			:      str        =			img
          snake_case			:      str        =			img.shape[1]
          snake_case			:      Union[str, Any]        =			img.shape[0]
          snake_case			:      Optional[int]        =			dst_width
          snake_case			:      List[str]        =			dst_height

          snake_case			:      List[str]        =			self.src_w / self.dst_w
          snake_case			:      int        =			self.src_h / self.dst_h

          snake_case			:      List[Any]        =			(
              np.ones((self.dst_h, self.dst_w, 3)							,np.uinta							) * 255
          )







     def 			snake_case_      (				self							)      ->				int:
          for i in range(self.dst_h							):
               for j in range(self.dst_w							):
                    snake_case			:      Optional[Any]        =			self.img[self.get_y(__a							)][self.get_x(__a							)]







     def 			snake_case_      (				self							,__a							)      ->				int:
          return int(self.ratio_x * x							)







     def 			snake_case_      (				self							,__a							)      ->				int:
          return int(self.ratio_y * y							)


if __name__ == "__main__":
      lowercase,	lowercase      :   Optional[int]      =       800, 600
      lowercase      :   Union[str, Any]      =       imread("""image_data/lena.jpg""", 1)
      lowercase      :   int      =       NearestNeighbour(im, dst_w, dst_h)
      n.process()

      imshow(
          F"""Image resized from: {im.shape[1]}x{im.shape[0]} to {dst_w}x{dst_h}""", n.output
      )
      waitKey(0)
      destroyAllWindows()



