


"""simple docstring"""


from __future__ import annotations

from collections.abc import MutableSequence


class       A__						:


     """simple docstring"""

     def __init__(						self:    Any  ,		__a:    int  ,		__a:    MutableSequence[float]						)->     None:


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

           lowerCamelCase       :       Dict   =						list(SCREAMING_SNAKE_CASE_						)
           lowerCamelCase       :       List[str]   =						degree

     def __add__(						self:    Union[str, Any]  ,		__a:    Polynomial						)->     Polynomial:


           if self.degree > polynomial_a.degree:
                 lowerCamelCase       :       List[str]   =						self.coefficients[:]
                 for i in range(polynomial_a.degree + 1						):
                       coefficients[i] += polynomial_a.coefficients[i]
                 return Polynomial(self.degree  ,		SCREAMING_SNAKE_CASE_						)
           else:
                 lowerCamelCase       :       List[Any]   =						polynomial_a.coefficients[:]
                 for i in range(self.degree + 1						):
                       coefficients[i] += self.coefficients[i]
                 return Polynomial(polynomial_a.degree  ,		SCREAMING_SNAKE_CASE_						)

     def __sub__(						self:    List[Any]  ,		__a:    Polynomial						)->     Polynomial:
           return self + polynomial_a * Polynomial(0  ,		[-1]						)

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

     def __mul__(						self:    str  ,		__a:    Polynomial						)->     Polynomial:
           lowerCamelCase       :       Dict   =						[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  ,		SCREAMING_SNAKE_CASE_						)

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

     def __str__(						self:    Optional[Any]						)->     str:
           lowerCamelCase       :       Union[str, Any]   =						""""""
           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(SCREAMING_SNAKE_CASE_						)

           return polynomial

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

     def 		a__    (						self:    str						)->     Polynomial:
           lowerCamelCase       :       Union[str, Any]   =						[0] * self.degree
           for i in range(self.degree						):
                 lowerCamelCase       :       List[str]   =						self.coefficients[i + 1] * (i + 1)
           return Polynomial(self.degree - 1  ,		SCREAMING_SNAKE_CASE_						)

     def 		a__    (						self:    Any  ,		__a:    int | float = 0						)->     Polynomial:
           lowerCamelCase       :       Any   =						[0] * (self.degree + 2)
           lowerCamelCase       :       Any   =						constant
           for i in range(self.degree + 1						):
                 lowerCamelCase       :       Union[str, Any]   =						self.coefficients[i] / (i + 1)
           return Polynomial(self.degree + 1  ,		SCREAMING_SNAKE_CASE_						)

     def __eq__(						self:    Dict  ,		__a:    object						)->     bool:


           if not isinstance(SCREAMING_SNAKE_CASE_  ,		SCREAMING_SNAKE_CASE_						):
                 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:    str  ,		__a:    object						)->     bool:
           return not self.__eq__(SCREAMING_SNAKE_CASE_						)






"""simple docstring"""






UpperCAmelCase        =				8.3_144_598




def __magic_name__	(				_lowerCamelCase:		float,					_lowerCamelCase:		float			)					->						float:

	'''simple docstring'''




	if temperature < 0:
		raise Exception('''Temperature cannot be less than 0 K'''			)
	if molar_mass <= 0:
		raise Exception('''Molar mass cannot be less than or equal to 0 kg/mol'''			)
	else:
		return (3 * UNIVERSAL_GAS_CONSTANT * temperature / molar_mass) ** 0.5


if __name__ == "__main__":
					import doctest

					# run doctest
					doctest.testmod()

					# example
					UpperCAmelCase        =				3_0_0
					UpperCAmelCase        =				2_8
					UpperCAmelCase        =				rms_speed_of_molecule(temperature, molar_mass)
					print(f"""Vrms of Nitrogen gas at 300 K is {vrms} m/s""")


