

"""simple docstring"""




from __future__ import annotations



def     UpperCAmelCase__   (				A__	,    A__   )      ->      Optional[Any]:




   """simple docstring"""



   if b == 0:
      return (1, 0)
   ((lowerCamelCase__)					,       (lowerCamelCase__))						=			extended_euclid(A__	,    a % b   )
   lowerCamelCase__						=			a // b
   return (y, x - k * y)



def     UpperCAmelCase__   (				A__	,    A__	,    A__	,    A__   )      ->      int:




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



def     UpperCAmelCase__   (				A__	,    A__   )      ->      Any:




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



def     UpperCAmelCase__   (				A__	,    A__	,    A__	,    A__   )      ->      Optional[Any]:




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




import numpy as np



def 	UpperCAmelCase__   (				A__   )      ->      np.array:




   """simple docstring"""
   return 1 / (1 + np.exp(-vector   ))


if __name__ == "__main__":
     import doctest

     doctest.testmod()




