


'''simple docstring'''
def     a   (    __a				,      __a				,      __a				,      __a     )						->			int:
					UpperCamelCase__     :Any							      =				len(lowercase_     ), len(grid[0]     )
					if (
					    min(lowercase_				,      lowercase_     ) < 0
					    or row == row_length
					    or col == col_length
					    or (row, col) in visit
					    or grid[row][col] == 1
					):
										return 0
					if row == row_length - 1 and col == col_length - 1:
										return 1

					visit.add((row, col)     )

					UpperCamelCase__     :Union[str, Any]							      =				0
					count += depth_first_search(lowercase_				,      row + 1				,      lowercase_				,      lowercase_     )
					count += depth_first_search(lowercase_				,      row - 1				,      lowercase_				,      lowercase_     )
					count += depth_first_search(lowercase_				,      lowercase_				,      col + 1				,      lowercase_     )
					count += depth_first_search(lowercase_				,      lowercase_				,      col - 1				,      lowercase_     )

					visit.remove((row, col)     )
					return count


if __name__ == "__main__":
		import doctest

		doctest.testmod()



'''simple docstring'''
from __future__ import annotations

from decimal import Decimal
from math import *  # noqa: F403

from sympy import diff


def     a   (    __a				,      __a				,      __a = 10**-10     )						->			float:



					'''simple docstring'''






					UpperCamelCase__     :Tuple							      =				a
					while True:
										UpperCamelCase__     :Dict							      =				Decimal(__a     ) - (
										    Decimal(eval(__a     )     ) / Decimal(eval(str(diff(__a     )     )     )     )  # noqa: S307
										)
										# This number dictates the accuracy of the answer
										if abs(eval(__a     )     ) < precision:  # noqa: S307
															return float(__a     )


# Let's Execute
if __name__ == "__main__":
		# Find root of trigonometric function
		# Find value of pi
		print(F"""The root of sin(x) = 0 is {newton_raphson('sin(x)', 2)}""")
		# Find root of polynomial
		print(F"""The root of x**2 - 5*x + 2 = 0 is {newton_raphson('x**2 - 5*x + 2', 0.4)}""")
		# Find Square Root of 5
		print(F"""The root of log(x) - 1 = 0 is {newton_raphson('log(x) - 1', 2)}""")
		# Exponential Roots
		print(F"""The root of exp(x) - 1 = 0 is {newton_raphson('exp(x) - 1', 0)}""")