




from __future__ import annotations




def 		lowerCAmelCase_ (						lowerCamelCase						,  lowerCamelCase ):
				if b == 0:
								return (1, 0)
				((__magic_name__)					,			(__magic_name__))						:						Optional[int]										=extended_euclid(lowerCamelCase						,  a % b )
				__magic_name__						:						Optional[Any]										=a // b
				return (y, x - k * y)




def 		lowerCAmelCase_ (						lowerCamelCase						,  lowerCamelCase						,  lowerCamelCase						,  lowerCamelCase ):
				((__magic_name__)					,			(__magic_name__))						:						int										=extended_euclid(lowerCamelCase						,  lowerCamelCase )
				__magic_name__						:						List[str]										=na * na
				__magic_name__						:						Optional[int]										=ra * x * na + ra * y * na
				return (n % m + m) % m




def 		lowerCAmelCase_ (						lowerCamelCase						,  lowerCamelCase ):
				((__magic_name__)					,			(__magic_name__))						:						Optional[int]										=extended_euclid(lowerCamelCase						,  lowerCamelCase )
				if b < 0:
								__magic_name__						:						str										=(b % n + n) % n
				return b




def 		lowerCAmelCase_ (						lowerCamelCase						,  lowerCamelCase						,  lowerCamelCase						,  lowerCamelCase ):
				__magic_name__					,			__magic_name__						:						Dict										=invert_modulo(lowerCamelCase						,  lowerCamelCase ), invert_modulo(lowerCamelCase						,  lowerCamelCase )
				__magic_name__						:						Dict										=na * na
				__magic_name__						:						List[Any]										=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)










import unittest

from accelerate import debug_launcher
from accelerate.test_utils import require_cpu, test_ops, test_script




@require_cpu
class 		__A   (      unittest.TestCase      ):

						def      A__    (		self :Tuple			):
										'''simple docstring'''

										debug_launcher(test_script.main			)


						def      A__    (		self :Dict			):
										'''simple docstring'''

										debug_launcher(test_ops.main			)




