



from __future__ import annotations






def        A       (      _lowerCamelCase       ,				_lowerCamelCase						):





							'''simple docstring'''




							_lowerCAmelCase     ,					_lowerCAmelCase  :							Any				     =					position
							_lowerCAmelCase  :							Union[str, Any]				     =					[
							    (y + 1, x + 2),
							    (y - 1, x + 2),
							    (y + 1, x - 2),
							    (y - 1, x - 2),
							    (y + 2, x + 1),
							    (y + 2, x - 1),
							    (y - 2, x + 1),
							    (y - 2, x - 1),
							]
							_lowerCAmelCase  :							Optional[Any]				     =					[]

							for position in positions:
														_lowerCAmelCase     ,					_lowerCAmelCase  :							str				     =					position
														if 0 <= y_test < n and 0 <= x_test < n:
																					permissible_positions.append(_lowerCamelCase						)

							return permissible_positions






def        A       (      _lowerCamelCase						):





							'''simple docstring'''




							return not any(elem == 0 for row in board for elem in row						)






def        A       (      _lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase						):





							'''simple docstring'''




							if is_complete(_lowerCamelCase						):
														return True

							for position in get_valid_pos(_lowerCamelCase       ,				len(_lowerCamelCase						)						):
														_lowerCAmelCase     ,					_lowerCAmelCase  :							Union[str, Any]				     =					position

														if board[y][x] == 0:
																					_lowerCAmelCase  :							Any				     =					curr + 1
																					if open_knight_tour_helper(_lowerCamelCase       ,				_lowerCamelCase       ,				curr + 1						):
																												return True
																					_lowerCAmelCase  :							List[str]				     =					0

							return False






def        A       (      _lowerCamelCase						):





							'''simple docstring'''




							_lowerCAmelCase  :							List[Any]				     =					[[0 for i in range(_lowerCamelCase						)] for j in range(_lowerCamelCase						)]

							for i in range(_lowerCamelCase						):
														for j in range(_lowerCamelCase						):
																					_lowerCAmelCase  :							Optional[int]				     =					1
																					if open_knight_tour_helper(_lowerCamelCase       ,				(i, j)       ,				1						):
																												return board
																					_lowerCAmelCase  :							List[str]				     =					0

							_lowerCAmelCase  :							List[Any]				     =					F"Open Kight Tour cannot be performed on a board of size {n}"
							raise ValueError(_lowerCamelCase						)


if __name__ == "__main__":
						import doctest

						doctest.testmod()





def        A       (      _lowerCamelCase						):





							'''simple docstring'''




							if length <= 0 or not isinstance(_lowerCamelCase       ,				_lowerCamelCase						):
														raise ValueError("Length must be a positive integer."						)
							return [n * (2 * n - 1) for n in range(_lowerCamelCase						)]


if __name__ == "__main__":
						print(hexagonal_numbers(length=5))
						print(hexagonal_numbers(length=10))
