


'''simple docstring'''




from __future__ import annotations





def   _a		(lowercase__			:   int							,   lowercase__			:   int						)			->			tuple[int, int]:






     """simple docstring"""
     if b == 0:
          return (1, 0)
     ((__snake_case)      ,       (__snake_case))           =						extended_euclid(lowercase__							,   a % b						)
     __snake_case           =						a // b
     return (y, x - k * y)





def   _a		(lowercase__			:   int							,   lowercase__			:   int							,   lowercase__			:   int							,   lowercase__			:   int						)			->			int:






     """simple docstring"""
     ((__snake_case)      ,       (__snake_case))           =						extended_euclid(lowercase__							,   lowercase__						)
     __snake_case           =						na * na
     __snake_case           =						ra * x * na + ra * y * na
     return (n % m + m) % m





def   _a		(lowercase__			:   int							,   lowercase__			:   int						)			->			int:






     """simple docstring"""
     ((__snake_case)      ,       (__snake_case))           =						extended_euclid(lowercase__							,   lowercase__						)
     if b < 0:
          __snake_case           =						(b % n + n) % n
     return b





def   _a		(lowercase__			:   int							,   lowercase__			:   int							,   lowercase__			:   int							,   lowercase__			:   int						)			->			int:






     """simple docstring"""
     __snake_case      ,       __snake_case           =						invert_modulo(lowercase__							,   lowercase__						), invert_modulo(lowercase__							,   lowercase__						)
     __snake_case           =						na * na
     __snake_case           =						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)









'''simple docstring'''





from __future__ import annotations





def   a_   (		_UpperCAmelCase    :      list[int]				)    ->  bool:
      return len(set(_UpperCAmelCase				)				) == len(_UpperCAmelCase				)


if __name__ == "__main__":
    import doctest

    doctest.testmod()



