


"""simple docstring"""


import os



def   snake_case						(				_a:     Tuple							)->		List[str]:
      '''simple docstring'''


      lowerCamelCase__           =		len(grid[0]							)
      lowerCamelCase__           =		len(_a							)

      lowerCamelCase__           =		0
      lowerCamelCase__           =		0
      lowerCamelCase__           =		0

      # Check vertically, horizontally, diagonally at the same time (only works
      # for nxn grid)
      for i in range(_a							):
            for j in range(n_rows - 3							):
                  lowerCamelCase__           =		grid[j][i] * grid[j + 1][i] * grid[j + 2][i] * grid[j + 3][i]
                  lowerCamelCase__           =		grid[i][j] * grid[i][j + 1] * grid[i][j + 2] * grid[i][j + 3]

                  # Left-to-right diagonal (\) product
                  if i < n_columns - 3:
                        lowerCamelCase__           =		(
                            grid[i][j]
                            * grid[i + 1][j + 1]
                            * grid[i + 2][j + 2]
                            * grid[i + 3][j + 3]
                        )

                  # Right-to-left diagonal(/) product
                  if i > 2:
                        lowerCamelCase__           =		(
                            grid[i][j]
                            * grid[i - 1][j + 1]
                            * grid[i - 2][j + 2]
                            * grid[i - 3][j + 3]
                        )

                  lowerCamelCase__           =		max(
                      _a		,   _a		,   _a		,   _a							)
                  if max_product > largest:
                        lowerCamelCase__           =		max_product

      return largest



def   snake_case						(				)->		Optional[int]:
      '''simple docstring'''


      lowerCamelCase__           =		[]
      with open(os.path.dirname(_a							) + '/grid.txt'							) as file:
            for line in file:
                  grid.append(line.strip('\n'							).split(' '							)							)

      lowerCamelCase__           =		[[int(_a							) for i in grid[j]] for j in range(len(_a							)							)]

      return largest_product(_a							)


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







"""simple docstring"""


def   snake_case						(				_a:     int		,   _a:     list[int]		,   _a:     int							)->		int:
      '''simple docstring'''


      def count_of_possible_combinations(_a:     int							) -> int:
            if target < 0:
                  return 0
            if target == 0:
                  return 1
            return sum(count_of_possible_combinations(target - item							) for item in array							)

      return count_of_possible_combinations(_a							)



def   snake_case						(				_a:     int		,   _a:     list[int]		,   _a:     int							)->		int:
      '''simple docstring'''


      def count_of_possible_combinations_with_dp_array(
          _a:     int		,   _a:     list[int]							) -> int:
            if target < 0:
                  return 0
            if target == 0:
                  return 1
            if dp_array[target] != -1:
                  return dp_array[target]
            lowerCamelCase__           =		sum(
                count_of_possible_combinations_with_dp_array(target - item		,   _a							)
                for item in array							)
            lowerCamelCase__           =		answer
            return answer

      lowerCamelCase__           =		[-1] * (target + 1)
      return count_of_possible_combinations_with_dp_array(_a		,   _a							)



def   snake_case						(				_a:     int		,   _a:     list[int]		,   _a:     int							)->		int:
      '''simple docstring'''


      lowerCamelCase__           =		[0] * (target + 1)
      lowerCamelCase__           =		1

      for i in range(1		,   target + 1							):
            for j in range(_a							):
                  if i - array[j] >= 0:
                        dp_array[i] += dp_array[i - array[j]]

      return dp_array[target]


if __name__ == "__main__":
   import doctest

   doctest.testmod()
   _snake_case          =							3
   _snake_case          =							5
   _snake_case          =							[1, 2, 5]
   print(combination_sum_iv(n, array, target))



