






def 					lowercase__				(					__snake_case   :							int  ):


					'''simple docstring'''


					if not isinstance(__snake_case					,	__snake_case  ):
										raise ValueError('multiplicative_persistence() only accepts integral values'  )
					if num < 0:
										raise ValueError('multiplicative_persistence() does not accept negative values'  )

					UpperCAmelCase_   :				Union[str, Any]						=						0
					UpperCAmelCase_   :				Tuple						=						str(__snake_case  )

					while len(__snake_case  ) != 1:
										UpperCAmelCase_   :				Any						=						[int(__snake_case  ) for i in num_string]

										UpperCAmelCase_   :				Optional[int]						=						1
										for i in range(0					,	len(__snake_case  )  ):
															total *= numbers[i]

										UpperCAmelCase_   :				Tuple						=						str(__snake_case  )

										steps += 1
					return steps




def 					lowercase__				(					__snake_case   :							int  ):


					'''simple docstring'''


					if not isinstance(__snake_case					,	__snake_case  ):
										raise ValueError('additive_persistence() only accepts integral values'  )
					if num < 0:
										raise ValueError('additive_persistence() does not accept negative values'  )

					UpperCAmelCase_   :				Tuple						=						0
					UpperCAmelCase_   :				str						=						str(__snake_case  )

					while len(__snake_case  ) != 1:
										UpperCAmelCase_   :				Optional[int]						=						[int(__snake_case  ) for i in num_string]

										UpperCAmelCase_   :				Tuple						=						0
										for i in range(0					,	len(__snake_case  )  ):
															total += numbers[i]

										UpperCAmelCase_   :				Any						=						str(__snake_case  )

										steps += 1
					return steps


if __name__ == "__main__":
		import doctest

		doctest.testmod()














from __future__ import annotations




def 					lowercase__				(					__snake_case   :							list[int]					,	__snake_case   :							int  ):


					'''simple docstring'''


					if len(__snake_case  ) < k or k < 0:
										raise ValueError('Invalid Input'  )
					UpperCAmelCase_   :				int						=						sum(array[:k]  )
					for i in range(len(__snake_case  ) - k  ):
										UpperCAmelCase_   :				List[Any]						=						current_sum - array[i] + array[i + k]
										UpperCAmelCase_   :				List[Any]						=						max(__snake_case					,	__snake_case  )
					return max_sum


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

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






