



from __future__ import annotations






def        A       (      _lowerCamelCase       ,				_lowerCamelCase						):





							'''simple docstring'''




							if b == 0:
														return (1, 0)
							((_lowerCAmelCase)     ,					(_lowerCAmelCase))  :							Any				     =					extended_euclid(_lowerCamelCase       ,				a % b						)
							_lowerCAmelCase  :							List[str]				     =					a // b
							return (y, x - k * y)






def        A       (      _lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase						):





							'''simple docstring'''




							((_lowerCAmelCase)     ,					(_lowerCAmelCase))  :							Tuple				     =					extended_euclid(_lowerCamelCase       ,				_lowerCamelCase						)
							_lowerCAmelCase  :							List[Any]				     =					na * na
							_lowerCAmelCase  :							int				     =					ra * x * na + ra * y * na
							return (n % m + m) % m






def        A       (      _lowerCamelCase       ,				_lowerCamelCase						):





							'''simple docstring'''




							((_lowerCAmelCase)     ,					(_lowerCAmelCase))  :							List[Any]				     =					extended_euclid(_lowerCamelCase       ,				_lowerCamelCase						)
							if b < 0:
														_lowerCAmelCase  :							Dict				     =					(b % n + n) % n
							return b






def        A       (      _lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase						):





							'''simple docstring'''




							_lowerCAmelCase     ,					_lowerCAmelCase  :							Optional[int]				     =					invert_modulo(_lowerCamelCase       ,				_lowerCamelCase						), invert_modulo(_lowerCamelCase       ,				_lowerCamelCase						)
							_lowerCAmelCase  :							Union[str, Any]				     =					na * na
							_lowerCAmelCase  :							Dict				     =					ra * x * na + ra * y * na
							return (n % m + m) % m


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

						testmod(name="chinese_remainder_theorem", verbose=True)
						testmod(name="chinese_remainder_theorem2", verbose=True)
						testmod(name="invert_modulo", verbose=True)
						testmod(name="extended_euclid", verbose=True)





from __future__ import annotations






def        A       (      _lowerCamelCase						):





							'''simple docstring'''




							if not nums:
														raise ValueError("List is empty"						)
							return sum(_lowerCamelCase						) / len(_lowerCamelCase						)


if __name__ == "__main__":
						import doctest

						doctest.testmod()
