





def      _A       (		SCREAMING_SNAKE_CASE     :   Optional[int]       ,       SCREAMING_SNAKE_CASE     :   Optional[int]       ,       SCREAMING_SNAKE_CASE     :   int						):





  """simple docstring"""



  if n == 0:
    return 1

  elif n % 2 == 1:
    return (binary_exponentiation(SCREAMING_SNAKE_CASE       ,       n - 1       ,       SCREAMING_SNAKE_CASE						) * a) % mod

  else:
    a__	:					List[str]										=binary_exponentiation(SCREAMING_SNAKE_CASE       ,       n / 2       ,       SCREAMING_SNAKE_CASE						)
    return (b * b) % mod


# a prime number
UpperCAmelCase	:	Any		     =       701

UpperCAmelCase	:	List[Any]		     =       1000000000
UpperCAmelCase	:	Any		     =       10

# using binary exponentiation function, O(log(p)):
print((a / b) % p == (a * binary_exponentiation(b, p - 2, p)) % p)





print((a / b) % p == (a * b ** (p - 2)) % p)













import numpy as np
def      _A       (		SCREAMING_SNAKE_CASE     :   np.array						):





  """simple docstring"""



  return 1 / (1 + np.exp(-vector						))


if __name__ == "__main__":
     import doctest

     doctest.testmod()






