


from __future__ import annotations

from collections.abc import Iterator


class 			_a				:

							def __init__(				self:      Union[str, Any]       ,		UpperCamelCase_:      int				)     ->  None:





									"""simple docstring"""







									lowercase__				= value
									lowercase__				= None
									lowercase__				= None


class 			_a				:

							def __init__(				self:      Any       ,		UpperCamelCase_:      Node				)     ->  None:





									"""simple docstring"""







									lowercase__				= tree

							def  lowerCamelCase_					(				self:      Union[str, Any]       ,		UpperCamelCase_:      Node | None				)     ->  int:





									"""simple docstring"""







									if node is None:
											return 0
									return node.value + (
									    self.depth_first_search(node.left				) + self.depth_first_search(node.right				)
									)


							def __iter__(				self:      Any				)     ->  Iterator[int]:





									"""simple docstring"""







									yield self.depth_first_search(self.tree				)


if __name__ == "__main__":
			import doctest

			doctest.testmod()







'''simple docstring'''



from __future__ import annotations
def        UpperCAmelCase (    A	:					list[int]       ,		A	:					int					):
							if len(A					) < k or k < 0:
														raise ValueError('''Invalid Input'''					)
							SCREAMING_SNAKE_CASE       :   Dict         =      sum(array[:k]					)
							for i in range(len(A					) - k					):
														SCREAMING_SNAKE_CASE       :   Optional[Any]         =      current_sum - array[i] + array[i + k]
														SCREAMING_SNAKE_CASE       :   Union[str, Any]         =      max(A       ,		A					)
							return max_sum


if __name__ == "__main__":
							from doctest import testmod
							from random import randint

							testmod()
							lowerCAmelCase_  :							Optional[int]             =    [randint(-1000, 1000) for i in range(100)]
							lowerCAmelCase_  :							Optional[int]             =    randint(0, 110)
							print(f'The maximum sum of {k} consecutive elements is {max_sum_in_array(array,k)}')




