




'''simple docstring'''




from collections import defaultdict
def      __snake_case       (   lowercase   :							int  ):
					snake_case_	=      1
					snake_case_	=      True
					for v in tree[start]:
										if v not in visited:
															ret += dfs(_SCREAMING_SNAKE_CASE  )
					if ret % 2 == 0:
										cuts.append(_SCREAMING_SNAKE_CASE  )
					return ret
def      __snake_case       (   ):
					dfs(1  )


if __name__ == "__main__":
					lowercase__  							=					10, 9
					lowercase__  							=					defaultdict(list)
					lowercase__  							=					{}
					lowercase__  							=					[]
					lowercase__  							=					0
					lowercase__  							=					[(2, 1), (3, 1), (4, 3), (5, 2), (6, 1), (7, 2), (8, 6), (9, 8), (10, 8)]
					for u, v in edges:
										tree[u].append(v)
										tree[v].append(u)
					even_tree()
					print(len(cuts) - 1)






from heapq import heappop, heappush

import numpy as np






def     lowerCAmelCase_			(   _SCREAMING_SNAKE_CASE     :				np.ndarray		, _SCREAMING_SNAKE_CASE     :				tuple[int, int]		, _SCREAMING_SNAKE_CASE     :				tuple[int, int]		, _SCREAMING_SNAKE_CASE     :				bool		, ):
						UpperCamelCase_,UpperCamelCase_		:							Union[str, Any]  =		grid.shape
						UpperCamelCase_		:							List[str]  =		[-1, 1, 0, 0]
						UpperCamelCase_		:							Dict  =		[0, 0, -1, 1]
						if allow_diagonal:
												dx += [-1, -1, 1, 1]
												dy += [-1, 1, -1, 1]

						UpperCamelCase_,UpperCamelCase_		:							List[Any]  =		[(0, source)], set()
						UpperCamelCase_		:							Any  =		np.full((rows, cols)		, np.inf			)
						UpperCamelCase_		:							List[str]  =		0
						UpperCamelCase_		:							Union[str, Any]  =		np.empty((rows, cols)		, dtype=_SCREAMING_SNAKE_CASE			)
						UpperCamelCase_		:							Optional[int]  =		None

						while queue:
												((UpperCamelCase_),(UpperCamelCase_))		:							Any  =		heappop(_SCREAMING_SNAKE_CASE			)
												if (x, y) in visited:
																		continue
												visited.add((x, y)			)

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

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

						return np.inf, []


if __name__ == "__main__":
	import doctest

	doctest.testmod()






