human
Find the value of P and modular inverse of Q modulo 998244353 | Function to find the value of P * Q ^ - 1 mod 998244353.
Loop to find the value until the expo is not zero.
Multiply p with q if expo is odd.
Reduce the value of expo by 2.
Driver code.
Function call"
Solution in Python:
 ... Write me a code to find the value of P and modular inverse of Q modulo 998244353 and the other steps required?
assistant
#Here is code to find the value of P and modular inverse of Q modulo 998244353 and the other steps required.
 def calculate ( p , q ) :
	mod = 998244353
	expo = 0
	expo = mod - 2
	while ( expo ) :
		if ( expo & 1 ) :
			p = ( p * q ) % mod
		q = ( q * q ) % mod
		expo >>= 1
	return p
if __name__ == ' _ _ main _ _ ' :
	p = 1
	q = 4
	print ( calculate ( p , q ) )