

from __future__ import annotations

from collections.abc import Callable




def 			UpperCAmelCase__				(			_A      : Callable[[int | float], int | float]	,      _A      : int | float	,      _A      : int | float	,      _A      : int = 1_00	,      ):





  '''simple docstring'''







  a__  =x_start
  a__  =fnc(_A							)
  a__  =0.0
  for _ in range(_A							):
    # Approximates small segments of curve as linear and solve
    # for trapezoidal area
    a__  =(x_end - x_start) / steps + xa
    a__  =fnc(_A							)
    area += abs(fxa + fxa							) * (xa - xa) / 2
    # Increment step
    a__  =xa
    a__  =fxa
  return area


if __name__ == "__main__":




       def 			UpperCAmelCase__				(			_A      : Optional[Any]							):





         '''simple docstring'''







         return x**3 + x**2

       print('''f(x) = x^3 + x^2''')
       print('''The area between the curve, x = -5, x = 5 and the x axis is:''')
       lowerCamelCase           =					10
       while i <= 10_0000:
              print(f"""with {i} steps: {trapezoidal_area(f, -5, 5, i)}""")
              i *= 10



import os




def 			UpperCAmelCase__				(			_A      : Any							):





  '''simple docstring'''







  a__  =len(grid[0]							)
  a__  =len(_A							)

  a__  =0
  a__  =0
  a__  =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							):
      a__  =grid[j][i] * grid[j + 1][i] * grid[j + 2][i] * grid[j + 3][i]
      a__  =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:
        a__  =(
            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:
        a__  =(
            grid[i][j]
            * grid[i - 1][j + 1]
            * grid[i - 2][j + 2]
            * grid[i - 3][j + 3]
        )

      a__  =max(
          _A	,      _A	,      _A	,      _A							)
      if max_product > largest:
        a__  =max_product

  return largest




def 			UpperCAmelCase__				(			):





  '''simple docstring'''







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

  a__  =[[int(_A							) for i in grid[j]] for j in range(len(_A							)							)]

  return largest_product(_A							)


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