






from decimal import Decimal, getcontext
from math import ceil, factorial







def     a_   (__A      )				->						str:



					"""simple docstring"""

					if not isinstance(__A				,       __A      ):
										raise TypeError("Undefined for non-integers"      )
					elif precision < 1:
										raise ValueError("Undefined for non-natural numbers"      )

					__a					:						Dict      =					precision
					__a					:						Tuple      =					ceil(precision / 14      )
					__a					:						Tuple      =					426_880 * Decimal(10_005      ).sqrt()
					__a					:						Dict      =					1
					__a					:						Optional[int]      =					13_591_409
					__a					:						List[str]      =					Decimal(__A      )
					for k in range(1				,       __A      ):
										__a					:						int      =					factorial(6 * k      ) // (factorial(3 * k      ) * factorial(__A      ) ** 3)
										linear_term += 545_140_134
										exponential_term *= -262_537_412_640_768_000
										partial_sum += Decimal(multinomial_term * linear_term      ) / exponential_term
					return str(constant_term / partial_sum      )[:-1]


if __name__ == "__main__":
			UpperCAmelCase__      			=						50
			print(F"The first {n} digits of pi is: {pi(n)}")













def     a_   (__A				,       __A				,       __A				,       __A      )				->						int:



					"""simple docstring"""
					__a      ,			__a					:						Any      =					len(__A      ), len(grid[0]      )
					if (
					    min(__A				,       __A      ) < 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)      )

					__a					:						Dict      =					0
					count += depth_first_search(__A				,       row + 1				,       __A				,       __A      )
					count += depth_first_search(__A				,       row - 1				,       __A				,       __A      )
					count += depth_first_search(__A				,       __A				,       col + 1				,       __A      )
					count += depth_first_search(__A				,       __A				,       col - 1				,       __A      )

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


if __name__ == "__main__":
			import doctest

			doctest.testmod()





