
"""simple docstring"""





def 				A_  (__a					, __a					, __a					):

					'''simple docstring'''





					if n == 0:
										return 1

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

					else:
										A_								=    binary_exponentiation(lowerCAmelCase__					, n / 2					, lowerCAmelCase__					)
										return (b * b) % mod


# a prime number
UpperCamelCase_       :    Union[str, Any]						      =			701

UpperCamelCase_       :    str						      =			10_0000_0000
UpperCamelCase_       :    List[str]						      =			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)











def 		_SCREAMING_SNAKE_CASE     ( lowerCAmelCase__							,lowerCAmelCase__						):
		if number < 0 or shift_amount < 0:
				raise ValueError('both inputs must be positive integers'						)

		lowerCamelCase_	:     int 						=      str(bin(lowerCAmelCase__						)						)
		binary_number += "0" * shift_amount
		return binary_number


def 		_SCREAMING_SNAKE_CASE     ( lowerCAmelCase__							,lowerCAmelCase__						):
		if number < 0 or shift_amount < 0:
				raise ValueError('both inputs must be positive integers'						)

		lowerCamelCase_	:     Union[str, Any] 						=      str(bin(lowerCAmelCase__						)						)[2:]
		if shift_amount >= len(lowerCAmelCase__						):
				return "0b0"
		lowerCamelCase_	:     List[str] 						=      binary_number[: len(lowerCAmelCase__						) - shift_amount]
		return "0b" + shifted_binary_number


def 		_SCREAMING_SNAKE_CASE     ( lowerCAmelCase__							,lowerCAmelCase__						):
		if number >= 0:  # Get binary representation of positive number
				lowerCamelCase_	:     List[Any] 						=      '0' + str(bin(lowerCAmelCase__						)						).strip('-'						)[2:]
		else:  # Get binary (2's complement) representation of negative number
				lowerCamelCase_	:     Any 						=      len(bin(lowerCAmelCase__						)[3:]						)  # Find 2's complement of number
				lowerCamelCase_	:     List[str] 						=      bin(abs(lowerCAmelCase__						) - (1 << binary_number_length)						)[3:]
				lowerCamelCase_	:     List[str] 						=      (
				    '1' + '0' * (binary_number_length - len(lowerCAmelCase__						)) + binary_number
				)

		if shift_amount >= len(lowerCAmelCase__						):
				return "0b" + binary_number[0] * len(lowerCAmelCase__						)
		return (
		    "0b"
		    + binary_number[0] * shift_amount
		    + binary_number[: len(lowerCAmelCase__						) - shift_amount]
		)


if __name__ == "__main__":
		import doctest

		doctest.testmod()
