






"""simple docstring"""





from heapq import heappop, heappush

import numpy as np



def   a    (     __UpperCAmelCase      :    np.ndarray      ,   __UpperCAmelCase      :    tuple[int, int]      ,   __UpperCAmelCase      :    tuple[int, int]      ,   __UpperCAmelCase      :    bool      ,   )    ->							tuple[float | int, list[tuple[int, int]]]:
						__magic_name__,			__magic_name__:	Dict							=       grid.shape
						__magic_name__:	Optional[Any]							=       [-1, 1, 0, 0]
						__magic_name__:	int							=       [0, 0, -1, 1]
						if allow_diagonal:
												dx += [-1, -1, 1, 1]
												dy += [-1, 1, -1, 1]

						__magic_name__,			__magic_name__:	Any							=       [(0, source)], set()
						__magic_name__:	Optional[int]							=       np.full((rows, cols)      ,   np.inf  )
						__magic_name__:	int							=       0
						__magic_name__:	Tuple							=       np.empty((rows, cols)      ,   dtype=__UpperCAmelCase  )
						__magic_name__:	List[Any]							=       None

						while queue:
												((__magic_name__),			(__magic_name__)):	str							=       heappop(__UpperCAmelCase  )
												if (x, y) in visited:
																		continue
												visited.add((x, y)  )

												if (x, y) == destination:
																		__magic_name__:	Tuple							=       []
																		while (x, y) != source:
																								path.append((x, y)  )
																								__magic_name__,			__magic_name__:	Union[str, Any]							=       predecessors[x, y]
																		path.append(__UpperCAmelCase  )  # add the source manually
																		path.reverse()
																		return matrix[destination], path

												for i in range(len(__UpperCAmelCase  )  ):
																		__magic_name__,			__magic_name__:	List[Any]							=       x + dx[i], y + dy[i]
																		if 0 <= nx < rows and 0 <= ny < cols:
																								__magic_name__:	str							=       grid[nx][ny]
																								if next_node == 1 and matrix[nx, ny] > dist + 1:
																														heappush(__UpperCAmelCase      ,   (dist + 1, (nx, ny))  )
																														__magic_name__:	Union[str, Any]							=       dist + 1
																														__magic_name__:	Dict							=       (x, y)

						return np.inf, []


if __name__ == "__main__":
							import doctest

							doctest.testmod()










def 		lowerCAmelCase  (	UpperCamelCase__   :   List[Any]       ,			UpperCamelCase__   :   Dict					)      ->    List[Any]:

						"""simple docstring"""





						__SCREAMING_SNAKE_CASE:				int           =   [0 for i in range(r + 1					)]
						# nc0 = 1
						__SCREAMING_SNAKE_CASE:				Dict           =   1
						for i in range(1       ,			n + 1					):
												# to compute current row from previous row.
												__SCREAMING_SNAKE_CASE:				Optional[Any]           =   min(UpperCamelCase__       ,			UpperCamelCase__					)
												while j > 0:
																		c[j] += c[j - 1]
																		j -= 1
						return c[r]




print(binomial_coefficient(n=10, r=5))



