






"""simple docstring"""






from __future__ import annotations

from collections.abc import MutableSequence

class  __SCREAMING_SNAKE_CASE			:


					'''simple docstring'''





					def __init__( self							:						str,						lowerCamelCase							:						Any,						lowerCamelCase							:						Tuple  )->      None:





								if len(lowercase__  ) != degree + 1:
											raise ValueError(
											    '''The number of coefficients should be equal to the degree + 1.'''  )

								lowerCamelCase__	:	list[float]				=list(lowercase__  )
								lowerCamelCase__	:	Optional[int]				=degree



					def __add__( self							:						List[str],						lowerCamelCase							:						Tuple  )->      Polynomial:





								if self.degree > polynomial_a.degree:
											lowerCamelCase__	:	Optional[Any]				=self.coefficients[:]
											for i in range(polynomial_a.degree + 1  ):
														coefficients[i] += polynomial_a.coefficients[i]
											return Polynomial(self.degree,						lowercase__  )
								else:
											lowerCamelCase__	:	Any				=polynomial_a.coefficients[:]
											for i in range(self.degree + 1  ):
														coefficients[i] += self.coefficients[i]
											return Polynomial(polynomial_a.degree,						lowercase__  )



					def __sub__( self							:						str,						lowerCamelCase							:						Optional[Any]  )->      Polynomial:
								return self + polynomial_a * Polynomial(0,						[-1]  )



					def __neg__( self							:						Any  )->      Polynomial:
								return Polynomial(self.degree,						[-c for c in self.coefficients]  )



					def __mul__( self							:						str,						lowerCamelCase							:						List[Any]  )->      Polynomial:
								lowerCamelCase__	:	list[float]				=[0] * (self.degree + polynomial_a.degree + 1)
								for i in range(self.degree + 1  ):
											for j in range(polynomial_a.degree + 1  ):
														coefficients[i + j] += (
														    self.coefficients[i] * polynomial_a.coefficients[j]
														)

								return Polynomial(self.degree + polynomial_a.degree,						lowercase__  )



					def 	snake_case ( self							:						str,						lowerCamelCase							:						str  )->      int | float:
								lowerCamelCase__	:	int | float				=0
								for i in range(self.degree + 1  ):
											result += self.coefficients[i] * (substitution**i)
								return result



					def __str__( self							:						str  )->      str:
								lowerCamelCase__	:	str				=''''''
								for i in range(self.degree,						-1,						-1  ):
											if self.coefficients[i] == 0:
														continue
											elif self.coefficients[i] > 0:
														if polynomial:
																	polynomial += " + "
											else:
														polynomial += " - "

											if i == 0:
														polynomial += str(abs(self.coefficients[i]  )  )
											elif i == 1:
														polynomial += str(abs(self.coefficients[i]  )  ) + "x"
											else:
														polynomial += str(abs(self.coefficients[i]  )  ) + "x^" + str(lowercase__  )

								return polynomial



					def __repr__( self							:						Union[str, Any]  )->      str:
								return self.__str__()



					def 	snake_case ( self							:						Union[str, Any]  )->      Polynomial:
								lowerCamelCase__	:	list[float]				=[0] * self.degree
								for i in range(self.degree  ):
											lowerCamelCase__	:	Optional[Any]				=self.coefficients[i + 1] * (i + 1)
								return Polynomial(self.degree - 1,						lowercase__  )



					def 	snake_case ( self							:						Union[str, Any],						lowerCamelCase							:						str = 0  )->      Polynomial:
								lowerCamelCase__	:	list[float]				=[0] * (self.degree + 2)
								lowerCamelCase__	:	Union[str, Any]				=constant
								for i in range(self.degree + 1  ):
											lowerCamelCase__	:	List[Any]				=self.coefficients[i] / (i + 1)
								return Polynomial(self.degree + 1,						lowercase__  )



					def __eq__( self							:						Any,						lowerCamelCase							:						Optional[int]  )->      bool:





								if not isinstance(lowercase__,						lowercase__  ):
											return False

								if self.degree != polynomial_a.degree:
											return False

								for i in range(self.degree + 1  ):
											if self.coefficients[i] != polynomial_a.coefficients[i]:
														return False

								return True




					def __ne__( self							:						List[str],						lowerCamelCase							:						str  )->      bool:
								return not self.__eq__(lowercase__  )









"""simple docstring"""






def   snake_case__     (	__lowerCamelCase       :					list[int]			):
			"""simple docstring"""
			if not numbers:
						return 0

			if not isinstance(__lowerCamelCase							,	(list, tuple)			) or not all(
			    isinstance(__lowerCamelCase							,	__lowerCamelCase			) for number in numbers			):
						raise ValueError('''numbers must be an iterable of integers'''			)

			lowerCamelCase__	:	Any				=numbers[0]

			for i in range(1							,	len(__lowerCamelCase			)			):
						# update the maximum and minimum subarray products
						lowerCamelCase__	:	Dict				=numbers[i]
						if number < 0:
									lowerCamelCase__			,     lowerCamelCase__	:	List[Any]				=min_till_now, max_till_now
						lowerCamelCase__	:	Optional[int]				=max(__lowerCamelCase							,	max_till_now * number			)
						lowerCamelCase__	:	Dict				=min(__lowerCamelCase							,	min_till_now * number			)

						# update the maximum product found till now
						lowerCamelCase__	:	Tuple				=max(__lowerCamelCase							,	__lowerCamelCase			)

			return max_prod




