"""simple docstring"""



import copy
import os

import cva
import numpy as np
from matplotlib import pyplot as plt






class 				snake_case__     :


 def __init__(				self		):
        __a     				=  ""
        __a     				=  ""
        __a     				=  []
        __a     				=  0
        __a     				=  256
        __a     				=  0
        __a     				=  0
        __a     				=  0
        __a     				=  0


 def 		a__ (				self  ,						lowerCamelCase		):
        __a     				=  cva.imread(lowerCamelCase  ,						0		)
        __a     				=  copy.deepcopy(self.img		)
        __a				, __a				, __a     				=  plt.hist(self.img.ravel()  ,						256  ,						[0, 256]  ,						label="x"		)
        __a     				=  np.sum(lowerCamelCase		)
        for i in range(len(lowerCamelCase		)		):
               __a     				=  x[i] / self.k
               self.sk += prk
               __a     				=  (self.L - 1) * self.sk
               if self.rem != 0:
                      __a     				=  int(last % last		)
               __a     				=  int(last + 1 if self.rem >= 0.5 else last		)
               self.last_list.append(lowerCamelCase		)
               __a     				=  int(np.ma.count(self.img		) / self.img[1].size		)
               __a     				=  self.img[1].size
        for i in range(self.number_of_cols		):
               for j in range(self.number_of_rows		):
                      __a     				=  self.img[j][i]
                      if num != self.last_list[num]:
                             __a     				=  self.last_list[num]
        cva.imwrite("output_data/output.jpg"  ,						self.img		)


 def 		a__ (				self		):
        plt.hist(self.img.ravel()  ,						256  ,						[0, 256]		)






 def 		a__ (				self		):
        cva.imshow("Output-Image"  ,						self.img		)
        cva.imshow("Input-Image"  ,						self.original_image		)
        cva.waitKey(5000		)
        cva.destroyAllWindows()


if __name__ == "__main__":
   SCREAMING_SNAKE_CASE__:Union[str, Any]			=	os.path.join(os.path.basename(__file__), """image_data/input.jpg""")
   SCREAMING_SNAKE_CASE__:str			=	ConstantStretch()
   stretcher.stretch(file_path)
   stretcher.plot_histogram()
   stretcher.show_image()

"""simple docstring"""



import os



def 					_lowerCamelCase(					):
       with open(os.path.dirname(a							) + "/grid.txt"							) as f:
              __a     				=  []  # noqa: E741
              for _ in range(2_0							):
                     l.append([int(a							) for x in f.readline().split()]							)

              __a     				=  0

              # right
              for i in range(2_0							):
                     for j in range(1_7							):
                            __a     				=  l[i][j] * l[i][j + 1] * l[i][j + 2] * l[i][j + 3]
                            if temp > maximum:
                                   __a     				=  temp

        # down
              for i in range(1_7							):
                     for j in range(2_0							):
                            __a     				=  l[i][j] * l[i + 1][j] * l[i + 2][j] * l[i + 3][j]
                            if temp > maximum:
                                   __a     				=  temp

        # diagonal 1
              for i in range(1_7							):
                     for j in range(1_7							):
                            __a     				=  l[i][j] * l[i + 1][j + 1] * l[i + 2][j + 2] * l[i + 3][j + 3]
                            if temp > maximum:
                                   __a     				=  temp

        # diagonal 2
              for i in range(1_7							):
                     for j in range(3 ,  2_0							):
                            __a     				=  l[i][j] * l[i + 1][j - 1] * l[i + 2][j - 2] * l[i + 3][j - 3]
                            if temp > maximum:
                                   __a     				=  temp
              return maximum


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